OSDN Git Service

Prevent sending early termination of appop use
authorFabian Kozynski <kozynski@google.com>
Wed, 18 Dec 2019 14:54:09 +0000 (09:54 -0500)
committerFabian Kozynski <kozynski@google.com>
Tue, 14 Jan 2020 19:36:26 +0000 (14:36 -0500)
commit1a459638398446938a20b32fa0fbc63ad4bd505f
treea0cefac98aa84c54d192c7bd1136d42aa299b34e
parentc64d1c4649626941682596d11f91a8f2b08fa9e8
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
packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java