Commit Graph

424299 Commits

Author SHA1 Message Date
Riddle Hsu
0a8a1e9d40 Fix potential double destroy of AssetManager
Assume there is a XmlBlock [X] created by a AssetManager [A]
([A] will have mNumRefs = 2). After [A].close is called
(mNumRefs = 1) and then both [X] and [A] are going to be GCed,
if [A].finalize is called first (nativeDestroy), the later
[X].finalize will invoke [A].xmlBlockGone that triggers the
second nativeDestroy of [A] and leads to crash.

By clearing the mObject in AssetManager.finalize, the
decRefsLocked from other paths won't call nativeDestroy again.

Bug: 136721562
Bug: 144028297
Test: atest AssetManagerTest
Test: Build and install CorePerfTests
      adb shell am instrument -w -r --no-hidden-api-checks -e class \
      android.app.ResourcesPerfTest#getLayoutAndTravese,android.graphics.perftests.RenderNodePerfTest \
      com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner

Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
Merged-In: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
2020-01-17 18:56:15 +00:00
TreeHugger Robot
1591d07994 Merge "Supplementary Services(SS) gray out when airplane mode on in Call Settings menu." into qt-qpr1-dev 2020-01-17 16:15:37 +00:00
Martijn Coenen
074d6fbd3f Merge "Fix IsolatedUidAllocator for non-primary users." into qt-qpr1-dev 2020-01-17 14:39:49 +00:00
Joanne Chung
77e6f5ff3e Change permissionLevel of ACCESS_SHORTCUTS and UNLIMITED_SHORTCUTS_API_CALLS
ACCESS_SHORTCUTS and UNLIMITED_SHORTCUTS_API_CALLS should be granted to
an app predictor rather than a text classifier.

Bug: 139523153
Test: atest CtsPermission2TestCases
Change-Id: I12360b5d5ba3c75bb2dfffd86bd6069b75fbdb53
(cherry picked from commit b6a7851271)
2020-01-17 06:54:31 +00:00
Ryan Mitchell
93320661ca Fix potential double destroy of AssetManager
Assume there is a XmlBlock [X] created by a AssetManager [A]
([A] will have mNumRefs = 2). After [A].close is called
(mNumRefs = 1) and then both [X] and [A] are going to be GCed,
if [A].finalize is called first (nativeDestroy), the later
[X].finalize will invoke [A].xmlBlockGone that triggers the
second nativeDestroy of [A] and leads to crash.

By clearing the mObject in AssetManager.finalize, the
decRefsLocked from other paths won't call nativeDestroy again.

Bug: 144028297
Test: atest android.security.cts.AssetManagerTest

Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
Merged-In: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
2020-01-16 20:48:57 +00:00
Philip P. Moltmann
05024a1523 DO NOT MERGE Fix AppOpsServiceTest
- Mock LocalService dependency
- Always assume calling app has appropriate permissions

Test: atest atest FrameworksMockingServicesTests:com.android.server.appop
Fixes: 132274015
Fixes: 147778434
Bug: 146463528
Bug: 146590200
Merged-In: Ie816e0c6c81ecf25d37f05187591ca0d1edf0bc2
Change-Id: Ie816e0c6c81ecf25d37f05187591ca0d1edf0bc2
2020-01-16 11:15:42 -08:00
Evan Laird
ad08b5b831 DO NOT MERGE: Use a copy of bt device profile list when updating
CachedBluetoothDevice#getProfiles() only returns a
Collections.unmodifiableList which isn't thread safe. Use a copy in
BluetoothControllerImpl so we can avoid a CME

Test: atest SystemUITests
Bug: 146828136
Change-Id: I451a746836c67b8b82f26f4f39b5363ac5e0ea79
2020-01-15 22:17:48 +00:00
Martijn Coenen
c6a61a6b0c Fix IsolatedUidAllocator for non-primary users.
The UID allocator stores complete UIDs, not app IDs. When removing a UID
from the range, we should therefore also use the UID, not the app ID.

Also added a test to cover this scenario, which passes with this change.

Bug: 146313311
Test: atest ActivityManagerTest
Change-Id: I1118ec73dcee5987e12f35aabce5cfa8cbe407a1
(cherry picked from commit c9a0df2d88)
2020-01-15 18:25:51 +00:00
TreeHugger Robot
c1b47d49c7 Merge changes from topic "SetModeNoEntanglement-qt-qpr1-dev" into qt-qpr1-dev
* changes:
  DO NOT MERGE Don't throw exception in AppOpsManager.checkOp
  DO NOT MERGE Remove unnecessary internal APIs.
  DO NOT MERGE SetMode: Don't call into PM with AppOps lock held
2020-01-14 19:43:27 +00:00
Philip P. Moltmann
892ded1e8a DO NOT MERGE Don't throw exception in AppOpsManager.checkOp
In Q we handled the case where the op does not match the package name by
returning the default state. NoteOp and StartOp returned errored.

Fix up these scenarios.

Test: - atest CtsAppOpsTestCases
      - backported new test to Q to verify the behavior is the same in Q
        and master
Bug: 132885449
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: I5b94e92af759580f2d2644ece49f159bd006b31c
2020-01-14 19:43:02 +00:00
Philip P. Moltmann
73e2690ede DO NOT MERGE Remove unnecessary internal APIs.
Test: Built
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: I5391ac4989d7d5712982f5608f9fc28cf7935b00
2020-01-14 19:42:44 +00:00
Fabian Kozynski
1a45963839 Prevent sending early termination of appop use
If a package starts a particular appop both as active and noted, once
one of them is finished (usually noted after 5s), a message will be sent
to callbacks indicating the end of the use. However, the app op may
still be active. This could result in the removal of indicators
prematurely from notifications.

This change prevents that from happening by checking if the app op is
still in use by that combination uid/package (either active or noted)
and not notifying listeners if that's the case.

Test: atest AppOpsControllerTest
Test: use app from bug report. Observe that notification does not lose
the microphone indicator
Bug: 144092031
Merged-In: I180e7c257e6171e7686ba7eda9bf02249358ed0

Change-Id: I94473c3ccf1318dac29f067dade91e540e20285e
2020-01-14 14:36:26 -05:00
Automerger Merge Worker
6d35c7c7c2 Merge "Fix ModuleInfoProviderTest by passing correct flag" into qt-dev am: 5d612f02b8
Change-Id: Ide396764d369792eb55000119d4383598e76964d
2020-01-14 16:17:07 +00:00
Mohammad Samiul Islam
5d612f02b8 Merge "Fix ModuleInfoProviderTest by passing correct flag" into qt-dev 2020-01-14 16:02:43 +00:00
Philip P. Moltmann
0bba8d5ff9 DO NOT MERGE SetMode: Don't call into PM with AppOps lock held
In the setmode paths do not call into package manager with the app-ops
lock held. Otherwise we might get dead-locks then someone calls into
app-ops manager with the package manager lock held.

Test: Booted and saw no errors from the changed code
Bug: 124731615
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: If074bed1bd246a81791a7d9fd656f42f1a755495
(cherry picked from commit ec142a52fe)
2020-01-14 09:47:32 +00:00
Jim Kaye
d763ea1f09 Merge "[DO NOT MERGE] Add a configuration to allow disabling auto-suspend" into qt-qpr1-dev 2020-01-13 18:08:48 +00:00
TreeHugger Robot
521c224374 Merge "Import translations. DO NOT MERGE" into qt-qpr1-dev 2020-01-13 04:32:33 +00:00
TreeHugger Robot
03674ebfdc Merge "Import translations. DO NOT MERGE" into qt-qpr1-dev 2020-01-13 04:29:13 +00:00
TreeHugger Robot
f45da6fd42 Merge "Import translations. DO NOT MERGE" into qt-qpr1-dev 2020-01-13 04:28:46 +00:00
Bill Yi
4452bafb93 Import translations. DO NOT MERGE
Change-Id: I77ed89b08ff7a8d1fabdbf3071da3b754ce7d06e
Auto-generated-cl: translation import
2020-01-12 16:29:37 -08:00
Bill Yi
27d20fbd19 Import translations. DO NOT MERGE
Change-Id: I193e7ea38b7b5257ac090d593f692dc80795b9ae
Auto-generated-cl: translation import
2020-01-12 11:49:34 -08:00
Bill Yi
17b3048145 Import translations. DO NOT MERGE
Change-Id: I090f0dab1bf477e98afb7146f5fcd4971976b847
Auto-generated-cl: translation import
2020-01-12 11:33:33 -08:00
TreeHugger Robot
7fffbe673f Merge "Import translations. DO NOT MERGE" into qt-qpr1-dev 2020-01-12 15:16:28 +00:00
TreeHugger Robot
071a365933 Merge "Import translations. DO NOT MERGE" into qt-qpr1-dev 2020-01-12 15:06:35 +00:00
TreeHugger Robot
95b34d7520 Merge "Import translations. DO NOT MERGE" into qt-qpr1-dev 2020-01-12 15:02:43 +00:00
Bill Yi
efd892e30d Import translations. DO NOT MERGE
Change-Id: Ie6d5b00e740371bb1e11dbce49edddebd466b25a
Auto-generated-cl: translation import
2020-01-12 01:58:55 -08:00
Bill Yi
db22c15b49 Import translations. DO NOT MERGE
Change-Id: I2a6a13d41fb703ccee7d24a5be0fbe2d26110bf0
Auto-generated-cl: translation import
2020-01-12 01:42:51 -08:00
Bill Yi
9295a3f5bb Import translations. DO NOT MERGE
Change-Id: I5408c7ab27f2e104998d9232519328992c11a985
Auto-generated-cl: translation import
2020-01-12 00:06:57 -08:00
Bill Yi
b1d8ad5183 Import translations. DO NOT MERGE
Change-Id: I5a8acd5969781950322e34833e274c3c38fef446
Auto-generated-cl: translation import
2020-01-11 00:53:46 -08:00
Mohammad Samiul Islam
3dd716a130 Fix ModuleInfoProviderTest by passing correct flag
Bug: 140941633
Bug: 147476459
Test: atest ModuleInfoProviderTest
Change-Id: Icf93ca7dcf4fc2d7625fe7f9175c59200ae600b6
Merged-In: Icf93ca7dcf4fc2d7625fe7f9175c59200ae600b6
2020-01-10 17:26:27 +00:00
Christophe Koessler
611bad9556 Refactor CountryDetectorService
Clean-up the test to use Mockito instead of the deprecated
AndroidTestCase, also getting rid of 1.5s of Thread.sleep.
No logic change.

Bug: 141626568
Test: atest CountryDetectorServiceTest
Merged-in: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
Change-Id: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
(cherry picked from commit 50361687ba)
2020-01-10 00:12:11 +00:00
Christopher Tate
d2a71cc4b8 Revoke 'always' web handler status when not autoverifying
If an app has previously used autoVerify to make claims about its status
re handling web navigation intents, but is updated such that it no
longer makes those claims, step down its "official handler" status as
though it had never invoked autoVerify in the first place.

Bug: 146204120
Test: manual: as described in bug; observe policy before/after via
      'adb shell dumpsys package d'
Test: atest CtsOsHostTestCases
Change-Id: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
Merged-In: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
2020-01-09 13:56:51 -08:00
Automerger Merge Worker
b43b52a2e1 [automerger skipped] Merge "Fix security problem on PermissionMonitor#hasPermission" into oc-dev am: 5e0b069876 am: 81db8d8a83 am: 5b6d8d7724 -s ours am: d0715a9f07 -s ours am: c64d1c4649 -s ours
am skip reason: Change-Id Iae9c273af822b18c2e6fce04848a86f8dea6410a with SHA-1 d0205a3469 is in history

Change-Id: Id7d778048e411acc447b4adf43d977e8eb98a8af
2020-01-09 17:41:35 +00:00
Automerger Merge Worker
fd5aea2b96 [automerger skipped] Merge "Fix security problem on PermissionMonitor#hasPermission" into pi-dev am: 361f1e97f6 -s ours am: 92b897e4a8 -s ours
am skip reason: Change-Id I2da730feda4d7ebed1f158b073167bb3964b3e7d with SHA-1 9352cb24b1 is in history

Change-Id: I641d8967ec8af4b58696bf2c044f5a87a6836937
2020-01-09 17:40:58 +00:00
Automerger Merge Worker
f3be812561 [automerger skipped] Merge changes I8ae4e331,Id4e37c3e,If0fd4834 into oc-dev am: e422bc0c8f am: 43d5e3bb62 am: 929c2c5e1b am: 0cf089521a -s ours am: 9ecc8ab3c8 -s ours
am skip reason: Change-Id I8ae4e331d09b4734c54cdc6887b273705dce88b1 with SHA-1 bf04ea6d3b is in history

Change-Id: Icf80644315482ee15830ff00e5454eb73e259777
2020-01-09 17:40:04 +00:00
Automerger Merge Worker
8eb0e4fd6b [automerger skipped] Use KNOWN_PACKAGES when shared lib consumers am: 08315953bc am: e580843476 am: d46ef183b1 am: d6f29b2711 -s ours am: e1ca007272 -s ours
am skip reason: Change-Id Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea with SHA-1 428a272285 is in history

Change-Id: I52b4194b76008c44e042870f1c9059b69af6eb11
2020-01-09 17:39:55 +00:00
Automerger Merge Worker
fe3b9f87c9 [automerger skipped] Handles null outInfo in deleteSystemPackageLI am: 6afabce549 am: ae901aceda am: 3e28284fb8 am: 9f31fb9eaf -s ours am: f8f4f28079
Change-Id: Idf3455832bb8dfea247487f8efea1a954f3f65a6
2020-01-09 17:39:45 +00:00
Automerger Merge Worker
c64d1c4649 [automerger skipped] Merge "Fix security problem on PermissionMonitor#hasPermission" into oc-dev am: 5e0b069876 am: 81db8d8a83 am: 5b6d8d7724 -s ours am: d0715a9f07 -s ours
am skip reason: Change-Id Iae9c273af822b18c2e6fce04848a86f8dea6410a with SHA-1 d0205a3469 is in history

Change-Id: I9b95f9715b7d15e3f430e6c46a2fd975b6b51f23
2020-01-09 16:50:47 +00:00
Automerger Merge Worker
92b897e4a8 [automerger skipped] Merge "Fix security problem on PermissionMonitor#hasPermission" into pi-dev am: 361f1e97f6 -s ours
am skip reason: Change-Id I2da730feda4d7ebed1f158b073167bb3964b3e7d with SHA-1 9352cb24b1 is in history

Change-Id: Id83288231d705e604e5094d40d211c0c940c4dd4
2020-01-09 16:50:08 +00:00
Automerger Merge Worker
9ecc8ab3c8 [automerger skipped] Merge changes I8ae4e331,Id4e37c3e,If0fd4834 into oc-dev am: e422bc0c8f am: 43d5e3bb62 am: 929c2c5e1b am: 0cf089521a -s ours
am skip reason: Change-Id I8ae4e331d09b4734c54cdc6887b273705dce88b1 with SHA-1 bf04ea6d3b is in history

Change-Id: I8dd0a9c26382b390dd7417fe35820abce79fdb92
2020-01-09 16:49:00 +00:00
Automerger Merge Worker
e1ca007272 [automerger skipped] Use KNOWN_PACKAGES when shared lib consumers am: 08315953bc am: e580843476 am: d46ef183b1 am: d6f29b2711 -s ours
am skip reason: Change-Id Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea with SHA-1 428a272285 is in history

Change-Id: Ia06b75350be3d1a99972e9763653fb0b6422b131
2020-01-09 16:48:50 +00:00
Automerger Merge Worker
f8f4f28079 [automerger skipped] Handles null outInfo in deleteSystemPackageLI am: 6afabce549 am: ae901aceda am: 3e28284fb8 am: 9f31fb9eaf -s ours
am skip reason: skipped by user patb

Change-Id: I1be1d1947f31c4c9e89f6de3768a578f58511668
2020-01-09 16:48:29 +00:00
Automerger Merge Worker
d0715a9f07 [automerger skipped] Merge "Fix security problem on PermissionMonitor#hasPermission" into oc-dev am: 5e0b069876 am: 81db8d8a83 am: 5b6d8d7724 -s ours
am skip reason: Change-Id Iae9c273af822b18c2e6fce04848a86f8dea6410a with SHA-1 d0205a3469 is in history

Change-Id: Ifa87cac191ad07937dc70770ff74a9d025131a40
2020-01-09 14:06:22 +00:00
Automerger Merge Worker
5b6d8d7724 Merge "Fix security problem on PermissionMonitor#hasPermission" into oc-dev am: 5e0b069876 am: 81db8d8a83
Change-Id: I5660cafce05a0e3c6edff03bd645d8df329c5d50
2020-01-09 13:53:42 +00:00
Automerger Merge Worker
81db8d8a83 Merge "Fix security problem on PermissionMonitor#hasPermission" into oc-dev am: 5e0b069876
Change-Id: I4c255820617a86afdfa239febdd46fff7d082381
2020-01-09 13:40:20 +00:00
TreeHugger Robot
5e0b069876 Merge "Fix security problem on PermissionMonitor#hasPermission" into oc-dev 2020-01-09 13:25:46 +00:00
Paul Hu
361f1e97f6 Merge "Fix security problem on PermissionMonitor#hasPermission" into pi-dev 2020-01-09 08:53:08 +00:00
Automerger Merge Worker
cd35d79a7c Merge "Fix PermissionMonitor issues" into qt-dev am: 97baed2635
Change-Id: Ia955c4304c2e623b291c111615c65f012b7c3028
2020-01-09 05:59:27 +00:00
Paul Hu
97baed2635 Merge "Fix PermissionMonitor issues" into qt-dev 2020-01-09 05:41:52 +00:00
Christopher Tate
ef5220e5b2 Revoke 'always' web handler status when not autoverifying
If an app has previously used autoVerify to make claims about its status
re handling web navigation intents, but is updated such that it no
longer makes those claims, step down its "official handler" status as
though it had never invoked autoVerify in the first place.

Bug: 146204120
Test: manual: as described in bug; observe policy before/after via
      'adb shell dumpsys package d'
Test: atest CtsOsHostTestCases
Change-Id: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
Merged-In: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
2020-01-08 18:50:59 -08:00