A new user id parameter is added to the
IPackageManager#getAppOpPermissionPackages API. Update the new api
usage to the Settings application.
Bug: 229684723
Test: atest SettingsUnitTests
Test: m -j RunSettingsRoboTests \
ROBOTEST_FILTER="AlarmsAndRemindersDetailsTest|
AlarmsAndRemindersDetailPreferenceControllerTest"
Change-Id: I8c90f0a57426c669478367004571cca5dfb05cb6
Not showing apps that are targeting SDK < 31, because the change is not
enabled for them.
Now alarm manager service manages killing the process whenever the
permission gets revoked, so we don't need to do it here.
This also lets us kill the app on "Reset app preferences" if needed.
Adding the preference under "Advanced" in the app info page so it
appears for apps that have requested this permission.
Test: atest SettingsUnitTests:AppStateAlarmsAndRemindersBridgeTest
make -j64 RunSettingsRoboTests \
ROBOTEST_FILTER="AlarmsAndRemindersDetailsTest|
AlarmsAndRemindersDetailPreferenceControllerTest"
Manually:
- There should be no observable difference in behavior when
toggling the setting. ActivityManager logs should still indicate that
the app is killed when the permission is revoked.
- "Alarms & Reminders" should appear under "Advanced" when looking at
the app info detail of an app that appears under "Alarms & reminders"
special app access page.
Bug: 179541791
Bug: 190070171
Change-Id: I2d437cec10ee10e4326fb25b2820de9ef9c31c67
Calling AlarmManager to know the state of the permission, which is now
the source of truth, as the logic deciding the state of the permission
may change.
Also killing the app when the permission changes to denied, this avoids
the app maintaining stale state about this permission.
Test: make -j RunSettingsRoboTests
atest SettingsUnitTests:AppStateAlarmsAndRemindersBridgeTest
Manually: Toggle the state of an app to "Not allowed" and check the logs
for activity manager kill messages.
Bug: 181152252
Bug: 183136253
Change-Id: I438782eaef4caae50fd76685c675a3e45ee28d9f
Adding a settings screen to control the permission SCHEDULE_EXACT_ALARM.
Apps can start this by starting a newly introduced API intent
REQUEST_SCHEDULE_EXACT_ALARM.
Test: make -j RunSettingsRoboTests
Manually by UI inspection:
Settings -> Apps -> Special App access -> Alarms and Reminders
or by running:
adb shell am start -a android.settings.REQUEST_SCHEDULE_EXACT_ALARM
Bug: 171306433
Bug: 171305516
Change-Id: I1293d38fc50a22b2af46f80ab24f676ed632f964