Adding alarms and reminders activity

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
This commit is contained in:
Suprabh Shukla
2021-02-17 18:00:35 -08:00
parent beefb25b48
commit c8b9240535
14 changed files with 534 additions and 3 deletions

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2021 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/alarms_and_reminders_title">
<com.android.settings.widget.FilterTouchesRestrictedSwitchPreference
android:key="alarms_and_reminders_switch"
android:title="@string/alarms_and_reminders_switch_title" />
<com.android.settingslib.widget.FooterPreference
android:key="alarms_and_reminders_description"
android:title="@string/alarms_and_reminders_footer_title"
android:selectable="false" />
</PreferenceScreen>

View File

@@ -112,6 +112,16 @@
android:value="com.android.settings.Settings$ManageExternalSourcesActivity" />
</Preference>
<Preference
android:key="alarms_and_reminders"
android:title="@string/alarms_and_reminders_title"
android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
settings:keywords="@string/keywords_alarms_and_reminders">
<extra
android:name="classname"
android:value="com.android.settings.Settings$AlarmsAndRemindersActivity" />
</Preference>
<Preference
android:key="special_app_usage_access"
android:title="@string/usage_access"