Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f823d1b authored by Eran Messeri's avatar Eran Messeri
Browse files

Open correct Settings activity for multiple permission notifications

When the admin auto-grants location permissions for multiple apps, the
user would get multiple notifications - one for each grant.
However, prior to this change, tapping on different notifications would
lead to the same Settings activity for the app that was last notified
about.

This change fixes the issue, such that, when there are multiple
notifications, tapping on each notification would lead to the "Manage
app permissions" activity of the appropriate app.

The cause was the pending intents being considered equal for
all apps (since the only difference was the extras).
It was solved by using a different request code for each app.

Testing:
* Factory reset a device
* Install TestDPC (go/testdpc)
* Set TestDPC as Device Owner (adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver)
* Start TestDPC, navigate to "Manage app permissions"
* Grant location permission to Android Auto
* Grant location permission to Chrome
* Tap the notification for Android Auto, observe the right Settings activity.
* Tap the notification for Chrome, observe the right Settings activity.

Bug: 149563515
Test: Manual, see above.
Change-Id: I4785c8b077abdb103842e9970bb0c6b04c5c942f
parent 0a70d12d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment