343745 Commits

Author SHA1 Message Date
Tetsutoki Shiozawa
f9f15fce9d Fix: ConnectivityManager is initialized with a wrong context
ActivityThread#setHttpProxy uses a system context to get
a ConnectivityManager instance. If it's not already cached, the
system service registry will cache this instance initialized
with the system context, and subsequent calls to get this service
will return the bad instance.
This patch uses the application context instead, unless it's
not available for some unlikely reason.

A possible symptom of this issue is to have Bluetooth tethering
failing with a security exception, because it's requested by
the "android" package without system uid.

Merged-In: Ib8815f010883cdb94fcad2cdfb237de39327b20a
Bug: 73572062
Change-Id: Id652c1625194dc73dcbf8dfcad4b4e2e6fbebf4e
2018-05-25 15:04:59 +00:00
Treehugger Robot
2aed62d664 Merge "Add Tethering's UID to the legacy type NetworkCapabilities" 2018-01-27 07:20:10 +00:00
Treehugger Robot
35520445be Merge "Added nullable callback support" 2018-01-27 03:24:52 +00:00
Jack Yu
f00ff3c93b Added nullable callback support
Sometimes data service clients do not care the result of the
requests so they pass null callback. In this case the data service
should handle it.

Test: Manual
Bug: 64132030
Change-Id: Ib188994fed4e708de875a24d5386a74a8f6db4dd
2018-01-27 01:28:21 +00:00
Treehugger Robot
b8b7589531 Merge "Add UID and Service for Secure Element Application" 2018-01-27 00:53:00 +00:00
Treehugger Robot
093ab1dc61 Merge "Renamed Result to ResultCode" 2018-01-27 00:39:37 +00:00
Treehugger Robot
a0f863d4fb Merge "Support Background Service Limitations." 2018-01-26 23:36:21 +00:00
Treehugger Robot
bb5318df8a Merge "Add support for Multi-A2DP state machines per device" 2018-01-26 22:43:53 +00:00
Pavlin Radoslavov
080a0e781c Add support for Multi-A2DP state machines per device
* Update usage of A2dpService API calls that take BluetoothDevice
  as an additional argument
* Update the description for BluetoothA2dp.connect()

Exempt-From-Owner-Approval: De-facto owner of the relevant changes is
the Bluetooth team.
Bug: 69269748
Test: Manual
Change-Id: I190ed48ef65bbc8b88b45f84ebd6ab3d21cf0b4e
Merged-In: I190ed48ef65bbc8b88b45f84ebd6ab3d21cf0b4e
(cherry picked from commit 502af2192c6d291174efa434a70101f302a5bd97)
2018-01-26 13:08:00 -08:00
Treehugger Robot
3151e86aa8 Merge "Add Settings support for Bluetooth Multi-A2DP and Multi-HFP" 2018-01-26 20:46:45 +00:00
Jack Yu
045ff781b9 Merge "Added slot id in the internal API" 2018-01-26 19:25:13 +00:00
Pavlin Radoslavov
03d44ce815 Add Settings support for Bluetooth Multi-A2DP and Multi-HFP
When there are multiple connected A2DP/HFP devices, if a connected
device's name is clicked on, that device will be chosen as
Active - i.e., it will be the device chosen for audio out / phone call.

Also:
 * Listen to the BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED
   and BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intents
   and update the the status of the current active device.
 * When connecting a new device, and Multi-A2DP is enabled, don't
   disconnect the currently connected device.
 * Update the implementation of isA2dpPlaying() so it correctly checks
   all connected devices, not only the first one.

Test: Manual: multiple connected A2DP devices, and selecting each as
      the Active Device.
Bug: 64767509

Change-Id: I69f3c85ebf5a7f07f6deed484c6dd65705460ae4
Merged-In: I69f3c85ebf5a7f07f6deed484c6dd65705460ae4
(cherry picked from commit 1af33a192614bb490701ab2e8e21866690b3b4fa)
2018-01-26 11:12:17 -08:00
Ruchi Kandoi
dcf4c6dc26 Add UID and Service for Secure Element Application
Bug: 64994044
Test: Boot; Check Service loaded.
Merged-In: I2f48ff204acd29b1a9f6819910aba5f8f3762977
Change-Id: I2f48ff204acd29b1a9f6819910aba5f8f3762977
(cherry picked from commit dfaf4bdd1e7e12caf9bb69c8facc38e879861baf)
2018-01-26 11:11:52 -08:00
Jack Yu
b83cc78bfd Renamed Result to ResultCode
Test: Manual
Bug: 64132030
Change-Id: Idd49322186d1a60c9846cc205964f3b2e318c31a
2018-01-26 09:21:16 -08:00
David Brazdil
656096516c Merge "Copy hidden API blacklist/dark greylist into build folder" 2018-01-26 16:03:25 +00:00
Treehugger Robot
a946cc9f53 Merge "DropBoxManager: Allow adding a file using an fd" 2018-01-26 15:51:57 +00:00
Primiano Tucci
5490b610b3 DropBoxManager: Allow adding a file using an fd
This patch adds an overload to DropBoxManager::addFile() which accepts
an already-opened file as a file descriptor. This avoids the need for
clients to create a filesystem-visible file when uploading data to
DropBox.

Test: Tested with perfetto using https://android-review.googlesource.com/c/platform/external/perfetto/+/587674
Change-Id: I076bfd3180fb9b4baff7e1bae2e611419061b2a7
Merged-In: I076bfd3180fb9b4baff7e1bae2e611419061b2a7
2018-01-26 14:25:18 +00:00
Tobias Thierer
9f82b6bab5 Merge "Track removal of Os.waitpid(..., Int32Ref, ...) from API." 2018-01-26 13:05:06 +00:00
David Srbecky
418a96457c Merge "Add dalvik.vm.minidebuginfo property for ART" 2018-01-26 12:37:48 +00:00
David Brazdil
f16ac00fe8 Copy hidden API blacklist/dark greylist into build folder
This change is meant for ART buildbots which build against a pinned
commit of the framework and thus do not have the commit which
introduced hidden API lists. Normal builds will now copy the blacklist
and dark greylist into the build folder first, and then generate the
light greylist as usual. If a buildbot does not have the framework
changes, it can create dummy API lists in the build folder before
starting the build and avoid the issue.

Test: make
Bug: 64382372
Change-Id: Ib6e53a45bcc917abb4ba67fdcbf01d4a19c2d56f
2018-01-26 11:49:54 +00:00
Erik Kline
89c6362def Add Tethering's UID to the legacy type NetworkCapabilities
This is needed because satisfiedByNC() compares UIDs by default now, and
the NCs we receive in callbacks have Tethering's UID patched in.

Bug: 72498421
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes, module library loading failures:
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libdexfile.so" not found
    - manually starting tethering works fine

Change-Id: I31f6516e2c1539809f8d052333fd2a616158cb92
2018-01-26 20:01:25 +09:00
Treehugger Robot
8e8c9664ae Merge "Watchdog: Add statsd to interesting processes" 2018-01-26 03:52:14 +00:00
Xiangyu/Malcolm Chen
ffdbbc533c Merge "Add Voice / Data network specific reg states." 2018-01-26 00:41:27 +00:00
Treehugger Robot
71a9e66d4a Merge "Deprecate android.util.Mutable*." 2018-01-26 00:28:52 +00:00
Ruchi Kandoi
183865f3e1 Merge "Open Mobile API for frameworks/base" 2018-01-25 23:30:50 +00:00
hirotaka motegi
233baef5b2 Support Background Service Limitations.
In order to receive SMS-Push,
Target SDK will use "Context.startForegroundService ()" API
for more than 26 service applications.

Test: manual

Bug: 63048126
Change-Id: I701eab6002d01cfc6e559db7aad5455781dc162c
Signed-off-by: hirotaka motegi <hirotaka.motegi.um@nttdocomo.com>
2018-01-25 21:37:48 +00:00
David Brazdil
fbef950d95 Merge "Show a warning toast/dialog when an app uses hidden APIs" 2018-01-25 19:53:13 +00:00
Treehugger Robot
93b1787a3d Merge "Tcp socket metrics: implement INetdEventListener callback" 2018-01-25 19:23:18 +00:00
Malcolm Chen
4c01328d90 Add Voice / Data network specific reg states.
In NetworkRegistrationState.java, add hidden inner classes that
stores information specific to voice network registration state
and data network registration state.

Bug: 64132030
Test: build
Change-Id: I746be2a50cfa138acc5b2b40e38ab875ceab6d8d
2018-01-25 10:57:43 -08:00
Treehugger Robot
d5cba89b98 Merge "ActivityManager: Add support for agents on startup" 2018-01-25 18:08:07 +00:00
Ruchi Kandoi
a1f9401a22 Open Mobile API for frameworks/base
This contribution is an implementation of the GlobalPlatform
Open Mobile API for Android with some modifications to
namespaces and packages to make it suitable as a core
Android component.

This contribution is based on
0001-Open-Source-Contribution-of-Smartcard-Service-for-fr.patch
which can be found in
https://portland.source.codeaurora.org/patches/quic/la/PATCH_217881_OpenMobileAPI_20171206.tar.gz

The submitted patch was derived from
https://source.codeaurora.org/quic/la/platform/packages/apps/SmartCardService/commit/?h=LA.BF64.1.2.1&id=06ecea9abb8264049f52c7e31c0bc13330a425d5.

Test: Sample Application; open Channels and transmit APDUs

Change-Id: Iac5206bd84798ca0fcdb504c89e1da5383012a5a
Signed-off-by: Jeremy O'Donoghue <jodonogh@codeaurora.org>
2018-01-25 18:04:17 +00:00
Holly Jiuyu Sun
197f072da2 Merge "Fill in methods in EuiccCardController." 2018-01-25 17:22:50 +00:00
Treehugger Robot
ffcf3ff77d Merge "PrintSpooler: Fix EqualsNaN in test" 2018-01-25 15:05:27 +00:00
Tobias Thierer
833501d0a0 Track removal of Os.waitpid(..., Int32Ref, ...) from API.
Test: Treehugger
Bug: 70985234

(cherry picked from commit 08005bbe9157c84f88189a7d7e9db466324af910)

Change-Id: I62229d01c13ac12e8c263e601d46ceb4f7ae7a0e
Merged-In: I62229d01c13ac12e8c263e601d46ceb4f7ae7a0e
2018-01-25 13:54:56 +00:00
Treehugger Robot
7e73c73f89 Merge "Update CellInfo API to accomodate new fields." 2018-01-25 12:50:37 +00:00
Tobias Thierer
9223fd6b6b Deprecate android.util.Mutable*.
Since http://r.android.com/565744 , these classes do not appear
in the signature of any other Android API. There are no plans to
make them part of any future API signatures.

They do not provide useful abstractions because:
 - They lack encapsulation and functionality (value is nonfinal;
   lack of equals/hashCode and toString).
 - It's trivial for apps to implement similar types for their
   internal use.

Only three of these eight classes (Mutable{Int,Long,Boolean}) are
used internally in Android; most of these usages could be written
better with named, more specific classes.

Therefore these classes do not pull their own weight on the API
surface of android.util.

This CL deprecates all eight classes in preparation for removing
them from the Android API surface at some point in the future, and
to allow the unused classes to be removed entirely.

Bug: 71546998
Test: Treehugger

(cherry picked from commit d57219411b3718da0850ef109e63d1a311a03d31)

Change-Id: Ib8736faa86d0ae5eec2c47a294f21adcf21d3dc4
Merged-In: I1cc1eb5ca9c36749bbb9a233d60036f6319bf2d3
2018-01-25 12:29:40 +00:00
David Brazdil
b6a5c92b50 Merge "Create hidden API lists" 2018-01-25 07:55:35 +00:00
Treehugger Robot
185a89caf1 Merge "Add ServiceState APIs for carrier aggregation." 2018-01-25 07:47:55 +00:00
Eric Schwarzenbach
a9d9b021be Update CellInfo API to accomodate new fields.
Adds CellConnectionStatus to top level CellInfo type. Adds cell bandwidth
to the CellIdentityLte.

Bug: 72117223
Test: runtest frameworks-telephony

Change-Id: Id5f3b5a2bd4119c099f5e739d5579974e7adc897
2018-01-25 07:25:04 +00:00
Treehugger Robot
b1c6aa4567 Merge "Add slotId in INetworkService.aidl methods." 2018-01-25 07:13:17 +00:00
nharold
af3fb3efe4 Merge "Move Keepalive out of IpSecTransform.Builder" 2018-01-25 05:50:33 +00:00
Chalard Jean
a8452ed2a6 Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" 2018-01-25 05:37:21 +00:00
Andreas Gampe
c899ee547c PrintSpooler: Fix EqualsNaN in test
Fix NaN comparisons in WorkflowTest.

Bug: 72451126
Test: m javac-check RUN_ERROR_PRONE=true
Merged-In: I3eba48ac3f8dc343cd22cac0f9fbf4d4e6c76631
Change-Id: I19db273ee442c912c2c1052d53b5b2e0c5cd968b
2018-01-24 21:19:30 -08:00
Chalard Jean
cf8c3fe19c Fix a bug where a NetworkAgent gets repeatedly torn down
mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Change-Id: Id2bbf3808e80b19cd055c832c11cf72372710942
2018-01-25 04:51:44 +00:00
Hugo Benichi
f90773cf4f Tcp socket metrics: implement INetdEventListener callback
This patch implements the new INetdEventListener.onTcpSocketStatsEvent
callback added in INetdEventListener.

For the time being, tcp socket stats are tracked inside TcpMetrics only
for dumpsys printing and bug report integration as a first step.

Bug: 64147860
Test: manually tested, watching output of
      $ adb shell dumpsys connmetrics
Change-Id: I10ab24c6da4bb654d9198a4d8d00ccdc972cc0d5
2018-01-25 13:26:43 +09:00
Nathan Harold
c43e89f973 Move Keepalive out of IpSecTransform.Builder
The lifecycle of Keepalive offloading is, unfortunately
different from that of an IpSecTransform. Because starting
a keepalive is fundamentally asynchronous, and isn't valid
until after a transform exists, it will now be a separate
optional procedure that may succeed or fail. It remains
linked with a Transform by the need for a Transform to exist
in order to initiate a Keepalive.

Bug: 38350389
Test: compilation
Change-Id: Ia76fccee41f86d694dff436043293d0c0762c041
2018-01-24 19:32:04 -08:00
Treehugger Robot
f4dc715575 Merge "Add FLAG_ACTIVITY_NEW_TASK when starting UI-based tether provisioning." 2018-01-25 03:09:27 +00:00
Treehugger Robot
27bb333e14 Merge "Adds stripTrailingFs" 2018-01-25 02:44:26 +00:00
Holly Jiuyu Sun
321977a191 Fill in methods in EuiccCardController.
Add RESULT_UNKNOWN in EuiccCardManager.

Bug: 38206971
Test: test on phone
Change-Id: I972ba0ab5ff6bb8e6ef50c8684a19bb9cd48a721
2018-01-24 18:22:21 -08:00
Andreas Gampe
e54440cb5d Watchdog: Add statsd to interesting processes
Dump statsd stacks on watchdog abort.

Bug: 72461610
Test: m
Change-Id: I01e1fa4fb4ba6e2644f9bf4464cc010bb4e82215
2018-01-24 17:55:17 -08:00