Add restrict and unrestrict dialog

Add a fake unrestrict tip so we could reuse the BatteryTipDialogFragment
to build the unrestrict dialog.

After this cl, restrict dialog has two types:
1. dialog to only restrict one app
2. dialog to restrict more than one app

Will add dialog to restrict more than 5 apps when strings are finalized.

Bug: 72385333
Bug: 72227981
Test: RunSettingsRoboTests
Change-Id: Ib0328f0386efad525b331fd713dd15d060a1a649
This commit is contained in:
jackqdyulei
2018-01-25 18:00:01 -08:00
parent ab0cde6bad
commit 99a2de41ef
16 changed files with 517 additions and 106 deletions

View File

@@ -4860,10 +4860,23 @@
<!-- Summary for restricted app preference, showing the impact of the apps [CHAR LIMIT=NONE] -->
<string name="battery_tip_restrict_handled_summary">App changes are in progress</string>
<!-- Title for dialog to restrict the app [CHAR LIMIT=NONE] -->
<plurals name="battery_tip_restrict_app_dialog_title">
<item quantity="one">Restrict app?</item>
<item quantity="other">Restrict %1$d apps?</item>
</plurals>
<!-- Message for battery tip dialog to show the restrict app list [CHAR LIMIT=NONE] -->
<string name="battery_tip_restrict_app_dialog_message">To save battery, you can stop this app from running in the background when its not being used.</string>
<!-- OK button for battery tip dialog to show the restrict app list [CHAR LIMIT=NONE] -->
<string name="battery_tip_restrict_app_dialog_ok">Restrict</string>
<!-- Title for dialog to remove restriction for the app [CHAR LIMIT=NONE] -->
<string name="battery_tip_unrestrict_app_dialog_title">Remove restriction for <xliff:g id="app">%1$s</xliff:g>?</string>
<!-- Message for dialog to show the impact if remove restriction for app [CHAR LIMIT=NONE] -->
<string name="battery_tip_unrestrict_app_dialog_message">This app will be able to use battery in the background. This may cause your battery to be used up faster.</string>
<!-- OK button for dialog to remove restriction for app [CHAR LIMIT=NONE] -->
<string name="battery_tip_unrestrict_app_dialog_ok">Remove</string>
<!-- CANCEL button for dialog to remove restriction for app [CHAR LIMIT=NONE] -->
<string name="battery_tip_unrestrict_app_dialog_cancel">Not now</string>
<!-- Title for the smart battery manager preference [CHAR LIMIT=NONE] -->
<string name="smart_battery_manager_title">Smart battery manager</string>