Commit Graph

95249 Commits

Author SHA1 Message Date
Neil Fuller
05eeef4188 Merge "Remove dead code from SystemServer" 2019-11-25 13:53:15 +00:00
Treehugger Robot
5b57190f08 Merge "NetworkScoreManager: Add @SystemApi for wifi mainline module" 2019-11-25 06:39:04 +00:00
Bill Lin
63e6d6af01 Merge changes from topic "migrate_CtsStagedInstallTest_RollbackTest"
* changes:
  Add multi-user test for the general non-staged case
  Increase timeout in testNativeWatchdogTriggersRollback
  Fix flaky testEnableRollbackTimeoutFailsRollback test
  Wait for available rollbacks in RollbackTest.
  Include NewRollbacks in result of getAvailableRollbacks.
  Rename RollbackData to Rollback.
  Remove INSTALLED_USERS extra from ACTION_PACKAGE_ENABLE_ROLLBACK.
  Update to new RollbackUtils.sendCrashBroadcast API.
  Extend ROLLBACK_COMMITTED broadcast for the multi-user case
  Fix NullPointerException.
  Cleanup some obsolete TODOs and unused code.
  Test Native Watchdog triggers RollbackManager rollback
  Uninstall testapps before running SecondaryUserRollbackTest
  delete ENABLING rollback if we can't get session info for it.
  Add test for rollback of userdata with multiple rollbacks
  Load rollback data in RollbackManagerServiceImpl constructor.
  Use "commit" for rollbacks instead of "execute".
  Add TestApi to block the RollbackManagerHandlerThread.
  Use Slog in RollbackManager, not Log
  Make setRequestDowngrade @TestApi
  Migrate RollbackTest and StagedRollbackTest to cts utils
  Add .apex suffix to apex files during validation
  Add host side test for secondary user rollback
  Reduce ENABLE_ROLLBACK timeout to 0 for timeout test.
2019-11-25 02:56:10 +00:00
Roshan Pius
9518866c53 NetworkScoreManager: Add @SystemApi for wifi mainline module
Add formal API's for API's that the wifi mainline module uses:
a) NetworkScoreManager.requestNetworkScores - Request new network scores.
b) NetworkScoreManager.registerNetworkScoreCallback - @SystemApi wrapper
over the existing registerNetworkScoreCache.
c) NetworkKey.createFromScanResult - Create NetworkKey from ScanResult.

Also,
a) Converted the existing WifiNetworkScoreCache callback implementation to
support both the new @SystemApi (used by wifi) and the old @hide API
(used by settings).
b) Stopped invoking dump on all the callbacks from NetworkScoreService.
The dump of each callback should be invoked at their client site (i.e
wifi service should dump state of the callback it registers with the
service).
c) Added a helper method |dumpWithLatestScanResults| to help dump the
state of the WifiNetworkScoreCache from wifi service.

Bug: 144487252
Test: a) Device boots up and connects to wifi network.
b) Manually verified that network scores are being requested & updated
with the new interface.

Change-Id: Id5a66189150e7a088127519373a832f63bdd12ac
Merged-In: Id5a66189150e7a088127519373a832f63bdd12ac
(cherry-picked from c278f80c28)
2019-11-24 07:04:30 +00:00
Treehugger Robot
e4b84f3475 Merge "Deprecate FileUtils.closeQuietly" 2019-11-22 23:52:41 +00:00
Treehugger Robot
bad5a30d4f Merge "Resolve API dependencies on BluetoothPan" 2019-11-22 22:54:37 +00:00
Treehugger Robot
0600b03d46 Merge "Deprecate ListActivity and ExpandableListActivity" 2019-11-22 20:53:55 +00:00
Treehugger Robot
aec0ab99d4 Merge "Deprecate TimingLogger" 2019-11-22 20:22:40 +00:00
Treehugger Robot
b1f69203e7 Merge "Deprecate Looper.prepareMainLooper" 2019-11-22 19:59:44 +00:00
Ytai Ben-tsvi
887aa66d0a Merge changes from topic "hidl-memory-java"
* changes:
  Add HidlMemoryUtil
  Add parceling support for HIDL memory in Java
2019-11-22 17:54:06 +00:00
Chalard Jean
87ed7d7816 Merge changes I195d894e,I7069c111
* changes:
  [NS A10] Cleanup
  [NS A09] Always rematch all networks to requests
2019-11-22 14:08:09 +00:00
Aaron Huang
920a4a5b1b Merge "Expose IpConfiguration and ProxyInfo APIs" 2019-11-22 09:25:16 +00:00
Treehugger Robot
c8bd4aecb3 Merge "Make Notification.Builder.SetFlag public" 2019-11-22 00:39:10 +00:00
Ytai Ben-Tsvi
a736d1c1ee Add HidlMemoryUtil
Convenience utilities for working with HidlMemory.

Change-Id: I85a46d37de7b89fb48c57f69b1552ca59b802c19
Merged-In: I85a46d37de7b89fb48c57f69b1552ca59b802c19
Bug: 143566068
2019-11-21 15:28:09 -08:00
Ytai Ben-Tsvi
a907efc3bc Add parceling support for HIDL memory in Java
This change adds support for reading/writing a HidlMemory
instance into / out of a HwParcel and HwBlob, in a format that
is compatible with the hidl_memory C++ type.
This paves the way to be able to exchange shared memory blocks
between native and Java via HwBinder, which will be exposed
as adding Java support for the HIDL 'memory' type.

Change-Id: I6cbbf852218c8a631f9014e7caa7a97d17e11889
Bug: 143566068
Merged-In: I6cbbf852218c8a631f9014e7caa7a97d17e11889
2019-11-21 15:19:47 -08:00
cncn
9d0fd9c9d6 Make Notification.Builder.SetFlag public
Bug: 144846447
Test: Build Successfully
Change-Id: If25bede41eec1f7e7ca3ae8fc669df1964d7da05
2019-11-21 22:55:13 +00:00
Rahul Sabnis
a052447ad6 Resolve API dependencies on BluetoothPan
Bug: 143244283
Test: Manual
Change-Id: Ie419b2f83358d06d094dcf4921c4595fc0e72857
2019-11-21 13:16:02 -08:00
David Su
1124e240c0 Merge "NetworkKey: migrate from ScanResult.wifiSsid to SSID" 2019-11-21 18:44:46 +00:00
Neil Fuller
4b03c07cc7 Remove dead code from SystemServer
Remove dead code from SystemServer that obstensively protects devices
from negative (< 1970) system clock times, but does not.

In reality, SystemServer calls SystemClock.setCurrentTimeMillis(), which
calls through to the AlarmManager.setTime() binder call. When the code
runs the system server hasn't started any services yet, so this would
always fail.

AlarmManager has similar protections in place that do work: if the
device is earlier than a "build time", then the device's clock is forced
forward. That provides the protection that the code being removed from
SystemServer was trying to achieve.

Test: Added logging to SystemClock to prove AlarmManager is null /
manual debugging

Change-Id: I87dca1062829bc1a10202804fa7ee31e0a6f03a3
2019-11-21 17:30:03 +00:00
Treehugger Robot
a7948ddcb9 Merge "Explicitly take flags in createContextAsUser()" 2019-11-21 15:53:59 +00:00
Oli Lan
77a40731f8 Wait for available rollbacks in RollbackTest.
This changes RollbackTest to retry checks for available rollbacks for
a certain period of time, using a new RollbackUtils method
waitForAvailableRollbacks.

Currently many of the tests in RollbackTest are flaky due to race conditions
between checking for available rollbacks and the installer onFinished callback.
This CL should fix all of those issues.

The previous attempt to resolve this by adding NewRollbacks speculatively to
the results of getAvailableRollbacks was not successful. This CL reverts that
change so that getAvailableRollbacks once again only returns rollbacks that are
actually available.

Bug: 136548146
Test: atest RollbackTest run on cuttlefish on acloud repeatedly
Change-Id: I0389ef2413e7642fe2f6ef1a33aef218dd1896ed
Merged-In: I27e2513b34f49af2f41cd627a5d2550541831e11
2019-11-21 17:51:11 +08:00
Oli Lan
dc4a36105b Include NewRollbacks in result of getAvailableRollbacks.
This CL adds NewRollbacks to the return value of getAvailableRollbacks,
as long as the PackageRollbackInfo is complete (i.e. there is one for
each child session in the install).

Including these should avoid the potential race condition between the
install finishing and getAvailableRollbacks being called which affected
some of the tests. This means that the draining of the handler that was
previously added to getAvailableRollbacks can now be removed.

In order to avoid a similar race condition when rollbacks are expired, this
change also cancels corresponding NewRollbacks when expireRollbackForPackage
is called.

Bug: 136241838
Bug: 136548146
Test: atest RollbackTest
Test: manual local test with delay added to onFinished in the service callback
Change-Id: Ie4581d218077dc16e53c337a5bb76609cc50a57e
Merged-In: I015ee5925e38118c40f4b9e145f78fb12c0e2890
2019-11-21 17:50:30 +08:00
Oli Lan
87a504d1fc Remove INSTALLED_USERS extra from ACTION_PACKAGE_ENABLE_ROLLBACK.
This changes RollbackManagerServiceImpl to use the list of installed users
that is passed in to snapshotAndRestoreUserData for the purpose of snapshotting.

With this change, it is no longer necessary for the list of installed users to be
added as an extra to the ENABLE_ROLLBACK intent, so that extra
(EXTRA_ENABLE_ROLLBACK_INSTALLED_USERS) is removed.

Bug: 139181444
Test: atest RollbackTest
Test: atest AppDataRollbackHelperTest
Exempt-From-Owner-Approval: Already approved in
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/9168506

Change-Id: Iff42f4e5b2d02d1124d64a5fedc659a41cddd5fc
Merged-In: Iffd63977a7498e3cba20d2039af623c921d38f57
2019-11-21 17:41:10 +08:00
Richard Uhler
fcf64e8dbe Use "commit" for rollbacks instead of "execute".
Fix a couple lingering references to "executing" rollbacks. We've long
since switched to the terminology "commit", to highlight that a staged
rollback that has been committed will not take effect until the device
reboots.

Fixes: 136044234
Test: atest RollbackTest
Change-Id: If548b0340101db13f4fdce7c2de3fe1e8283a260
Merged-In: Ic364778c253ff59af8206824a66df72569ab1307
2019-11-21 17:07:39 +08:00
Richard Uhler
0c48af84fe Add TestApi to block the RollbackManagerHandlerThread.
To eliminate flakiness when testing timeout conditions for
RollbackTest.testEnableRollbackTimeoutFailsRollback.

Test: atest RollbackTest.testEnableRollbackTimeoutFailsRollback in a loop
Bug: 134373106
Change-Id: I2d1de148a83231f3fd48cc05b7320fa5fdf091ce
Merged-In: I01f3e769711ffa51fa714ff4bc81e70887f427ad
2019-11-21 16:58:45 +08:00
Chalard Jean
c06d788ec9 Cut the dependency to APN constants
With Telephony moving to Mainline these constants are not accessible
any more, and should not be made public. As they are only used by
a deprecated method that can only be called by apps with a target
SDK < M and only for one of the features it used to handle, copying
the constants until this method is completely removed is the simplest
way to go.

Test: FrameworksNetTests
Bug: 144454341
Change-Id: Iea18c8d2f2c8a40f04db9383d3f74b917267ba25
2019-11-21 14:48:00 +09:00
shafik
895901357e Make setRequestDowngrade @TestApi
Test: build
Bug: 134653708
Exempt-From-Owner-Approval: Already approved in
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/8350817/

Change-Id: I732aca8011490fa5815199451566ac8b0b1a2204
Merged-In: Idf99e0810e2e9040f49f06a00722567ac15bbe18
2019-11-21 13:46:06 +08:00
Mohammad Samiul Islam
73f1771d27 Add .apex suffix to apex files during validation
Previously, the apex file being installed was moved into the staging
directory as same name provided during installation, due to which, when
the source apex file of installation did not have .apex suffix in its
file name, it failed validation in apexd. Now, if an apex file does not
have proper suffix, it will be concatenated during validation in
PackageInstallerSession.

Bug: 124837227
Test: atest CtsStagedInstallHostTestCases
Test: atest StagedInstallTest#testInstallStagedApexWithoutApexSuffix
Exempt-From-Owner-Approval: Already approved in
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/8528906

Change-Id: I0095c1f985839de8247d9e6aebae948e0e834e7e
Merged-In: Ice41f601dc42736ca0cdf2bad0817f0c00f50648
2019-11-21 13:46:06 +08:00
Daniel Colascione
54543bb423 Merge changes from topic "property-handle"
* changes:
  Add new SystemProperties.Handle interface
  Reimplement android.os.SystemProperties in terms of libc facilities
2019-11-21 04:38:03 +00:00
Meng Wang
de953fd5f2 Merge "Use TelephonyManager instead of ITelephony Binder" 2019-11-21 04:36:10 +00:00
Makoto Onuki
6b1e9d2f9f Explicitly take flags in createContextAsUser()
Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id2e3d5ffe5887a4916e0872a7e85d62cbb439744
(cherry picked from commit e5449f0b34)
Merged-in: Id2e3d5ffe5887a4916e0872a7e85d62cbb439744
2019-11-20 16:20:23 -08:00
Chen Xu
b6d1319d1a telephony annotations part 2
adding missing annotations

Bug: 140908357
Test: Build

Merged-In: I6de632ef7ef01a939971b7d1bacb227ec5ff4048
Change-Id: I6de632ef7ef01a939971b7d1bacb227ec5ff4048
(cherry picked from commit f85cf993d3)
2019-11-20 14:09:16 -08:00
Jordan Liu
0a1b47573e Merge "Remove unneeded @RequiresPermission annotation" 2019-11-20 22:04:20 +00:00
Treehugger Robot
63d5e4a0b9 Merge "Add Context.createContextAsUser()" 2019-11-20 21:53:01 +00:00
David Su
e51ae1566b NetworkKey: migrate from ScanResult.wifiSsid to SSID
wifiSsid is an @hide field, migrate to getter method.

Bug: 144311098
Test: atest NetworkKeyTest
Change-Id: Ic689e12b8de4af52fae26c25bc90c8eb093ad3fe
Merged-In: Ic689e12b8de4af52fae26c25bc90c8eb093ad3fe
2019-11-20 10:41:59 -08:00
Meng Wang
a73bed81ae Use TelephonyManager instead of ITelephony Binder
Bug: 140908357
Test: make
Change-Id: If3be915329cc27c560af3fd71a903984a626aca8
2019-11-20 10:05:33 -08:00
Aaron Huang
6763aec94c Expose IpConfiguration and ProxyInfo APIs
Moving IpConfiguration methods to system API
for mainline support.

Public copy constructors of ProxyInfo and add
buildPacProxy(Uri, int) to create a new proxy
properties.

Bug: 139268426
Bug: 135998869
Test: atest android.net.cts
      atest android.net.wifi.cts
      atest FrameworksNetTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I07bcd2a34a222ea2b3cf0d8b497f051011c41c2c
2019-11-20 20:07:05 +08:00
Chalard Jean
1a4548cdd4 [NS A09] Always rematch all networks to requests
This is a regression in performance but it is necessary for
the sake of refactoring ; when the refactoring is over, the
performance will be improved back.

Test: ConnectivityServiceTest
Change-Id: I7069c11193dccb7dce6af65cfb731c0f4ad93629
2019-11-20 20:42:40 +09:00
Tyler Gunn
8e7a1f8528 Merge "Add prioritized enableCarMode API in UiModeManager" 2019-11-20 07:08:19 +00:00
Makoto Onuki
9432f7d43c Add Context.createContextAsUser()
Without it, apps (mainline modules) will need to use createPackageContext...,
which is a bit painful.

Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id640e03862462724df1a4a3101f0b08faafba22f
(cherry picked from commit b844001d6a)
Merged-in: Id640e03862462724df1a4a3101f0b08faafba22f
2019-11-19 20:51:04 -08:00
Treehugger Robot
9636d7e3af Merge "Do not use hidden telephony API PhoneConstants.PRESENTATION_*" 2019-11-20 04:26:47 +00:00
Treehugger Robot
7622ccb5f0 Merge "Move RLog out of telephony module" 2019-11-20 01:59:18 +00:00
Meng Wang
e88b4d2918 Move RLog out of telephony module
Bug: 144374158
Test: make
Change-Id: I7702677c8bb2529655ef03fc0a27c33743ae01b5
Merged-In: If983bc315218486be73567cd1919d1f60250f670
2019-11-19 16:16:08 -08:00
Treehugger Robot
35dd014a79 Merge "DO NOT MERGE Avoids deadlock when applying preferred activities" 2019-11-19 23:38:21 +00:00
Treehugger Robot
560c3ebe1e Merge "Deprecate implicit Handler constructors" 2019-11-19 23:28:12 +00:00
Tyler Gunn
f05f2c2cc2 Add prioritized enableCarMode API in UiModeManager
Per design doc (go/android-car-mode-design), added new system API to
enable car mode and specify a priority for the calling app.
Also modified UiModeManager to pass the package name of the caller to
UiModeManagerService.

Bug: 136109592
Test: Added new unit tests and CTS tests.
Test: Added Telecom test app functionality to verify.
Change-Id: I2848039c9ea18ba93e7694e04c4e5dc70759daa3
Merged-In: I2848039c9ea18ba93e7694e04c4e5dc70759daa3
2019-11-19 23:15:52 +00:00
Patrick Baumann
3fa8853331 DO NOT MERGE Avoids deadlock when applying preferred activities
Prior to this change, we were resolving the mime type of a given intent
while holding the package lock. With this change, we instead rely on the
preferred-activity declaration to define the mime type if it's
important, removing need for an activity manager service call and the
potential for deadlock.

Fixes: 143105100
Test: Manual; sideload to /system/etc/preferred-apps/ and reset app preferences
Change-Id: Ia87b7ecbd7987ef654fb0fc2bda942cd6a9c00a7
2019-11-19 21:43:48 +00:00
Daniel Colascione
6e2cff7fa1 Add new SystemProperties.Handle interface
This new interface allows Java code to look up property values without
paying for the name->prop_info mapping and, in the case of looking up
scalars, without doing any allocation.

Bug: 140788621
Test: added tests
Test: atest FrameworksCoreSystemPropertiesTests
Change-Id: I46d12f62499e9e124fe9add588376d724b364d5d
2019-11-19 13:28:56 -08:00
Daniel Colascione
5e8ba5f05a Reimplement android.os.SystemProperties in terms of libc facilities
A subsequent CL will implement a new prop_info based properties API on
top of this CL.

Test: boots
Test: atest FrameworksCoreSystemPropertiesTests
Bug: 140788621
Change-Id: Id8dd02fff7b1c0815a27ab1dfdde1700447a414c
2019-11-19 13:27:53 -08:00
Jordan Liu
31a4da61b5 Remove unneeded @RequiresPermission annotation
Fixes: 144360225
Test: no change to behavior
Change-Id: I7b3ab01c4d232013dcc19de32cc8e2cee9b8cb5a
2019-11-19 11:47:53 -08:00