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
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)
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
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
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)
* 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
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
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
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)
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)
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
am skip reason: Change-Id Iae9c273af822b18c2e6fce04848a86f8dea6410a with SHA-1 d0205a3469 is in history
Change-Id: Id7d778048e411acc447b4adf43d977e8eb98a8af
am skip reason: Change-Id I2da730feda4d7ebed1f158b073167bb3964b3e7d with SHA-1 9352cb24b1 is in history
Change-Id: I641d8967ec8af4b58696bf2c044f5a87a6836937
am skip reason: Change-Id I8ae4e331d09b4734c54cdc6887b273705dce88b1 with SHA-1 bf04ea6d3b is in history
Change-Id: Icf80644315482ee15830ff00e5454eb73e259777
am skip reason: Change-Id Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea with SHA-1 428a272285 is in history
Change-Id: I52b4194b76008c44e042870f1c9059b69af6eb11
am skip reason: Change-Id Iae9c273af822b18c2e6fce04848a86f8dea6410a with SHA-1 d0205a3469 is in history
Change-Id: I9b95f9715b7d15e3f430e6c46a2fd975b6b51f23
am skip reason: Change-Id I2da730feda4d7ebed1f158b073167bb3964b3e7d with SHA-1 9352cb24b1 is in history
Change-Id: Id83288231d705e604e5094d40d211c0c940c4dd4
am skip reason: Change-Id I8ae4e331d09b4734c54cdc6887b273705dce88b1 with SHA-1 bf04ea6d3b is in history
Change-Id: I8dd0a9c26382b390dd7417fe35820abce79fdb92
am skip reason: Change-Id Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea with SHA-1 428a272285 is in history
Change-Id: Ia06b75350be3d1a99972e9763653fb0b6422b131
am skip reason: Change-Id Iae9c273af822b18c2e6fce04848a86f8dea6410a with SHA-1 d0205a3469 is in history
Change-Id: Ifa87cac191ad07937dc70770ff74a9d025131a40
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