Added settings screens for Power Menu

This CL adds a new Preference in Gestures (Power Menu), moves Global
Actions to it (now renamed Cards & passes) and adds a new Preference for
Device controls.

Missing:
* Explanation video for Device controls
* Privacy settings

Test: robotests
Test: manual change settings
Bug: 152212779
Bug: 152329723
Change-Id: Ia8f69565307a5961c8435bc1f441abeb389acf8b
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8a642ac..be1222e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7534,8 +7534,8 @@
     <string name="keywords_profile_challenge">work challenge, work, profile</string>
     <string name="keywords_unification">work profile, managed profile, unify, unification, work, profile</string>
     <string name="keywords_gesture">gestures</string>
-    <!-- Search keywords for Global Actions Panel. [DO NOT TRANSLATE] -->
-    <string name="keywords_global_actions_panel" translatable="false">global actions</string>
+    <string name="keywords_cards_passes">cards, passes</string>
+    <string name="keywords_device_controls">device controls, controls</string>
     <string name="keywords_payment_settings">pay, tap, payments</string>
     <string name="keywords_backup">backup, back up</string>
     <string name="keywords_assist_gesture_launch">gesture</string>
@@ -10737,13 +10737,6 @@
     <!-- Summary text for ambient display tap [CHAR LIMIT=NONE]-->
     <string name="ambient_display_tap_screen_summary">To check time, notifications, and other info, tap your screen.</string>
 
-    <!-- Summary text for global actions panel [CHAR LIMIT=NONE] [DO NOT TRANSLATE]-->
-    <string name="global_actions_panel_summary" translatable="false">To show the global actions panel, press &amp; hold Power button</string>
-    <!-- Preference and settings suggestion title text for global actions panel [CHAR LIMIT=60] [DO NOT TRANSLATE]-->
-    <string name="global_actions_panel_title" translatable="false">Show global actions</string>
-    <!-- Short title text for global actions panel [CHAR LIMIT=40] [DO NOT TRANSLATE]-->
-    <string name="global_actions_panel_short_title" translatable="false">Global actions</string>
-
     <!-- Title text for swiping downwards on fingerprint sensor for notifications [CHAR LIMIT=80]-->
     <string name="fingerprint_swipe_for_notifications_title">Swipe fingerprint for notifications</string>
     <!-- Title text for fingerprint gesture preference screen [CHAR LIMIT=25] -->
@@ -11866,11 +11859,11 @@
     <!-- Developer settings: text for the bug report handler selection toast shown if an invalid bug report handler was chosen. [CHAR LIMIT=NONE] -->
     <string name="select_invalid_bug_report_handler_toast_text">This choice is no longer valid. Try again.</string>
 
-    <!-- Quick controls name sentence case [CHAR LIMIT=40] -->
-    <string name="quick_controls_sentence">Quick controls</string>
+    <!-- Device controls name sentence case [CHAR LIMIT=40] -->
+    <string name="device_controls_sentence">Device controls</string>
 
-    <!-- Quick controls name lower case [CHAR LIMIT=40] -->
-    <string name="quick_controls_lower">quick controls</string>
+    <!-- Device controls name lower case [CHAR LIMIT=40] -->
+    <string name="quick_controls_lower">device controls</string>
 
     <!-- Cards and passes name sentence case [CHAR LIMIT=40] -->
     <string name="cards_passes_sentence">Cards &amp; passes</string>
@@ -11887,11 +11880,11 @@
     <!-- Power menu setting option cards and passes [CHAR LIMIT=NONE] -->
     <string name="power_menu_cards_passes">Show cards &amp; passes</string>
 
-    <!-- Power menu setting option quick controls [CHAR LIMIT=NONE] -->
-    <string name="power_menu_quick_controls">Show quick controls</string>
+    <!-- Power menu setting option device controls [CHAR LIMIT=NONE] -->
+    <string name="power_menu_device_controls">Show device controls</string>
 
-    <!-- Power menu setting option cards, passes, quick controls [CHAR LIMIT=NONE] -->
-    <string name="power_menu_cards_passes_quick_controls">Show cards, passes, and quick controls</string>
+    <!-- Power menu setting option cards, passes, device controls [CHAR LIMIT=NONE] -->
+    <string name="power_menu_cards_passes_device_controls">Show cards, passes, and device controls</string>
 
     <!-- Power menu setting option none [CHAR LIMIT=NONE] -->
     <string name="power_menu_none">Don\u2019t show any content</string>
@@ -11905,11 +11898,17 @@
     <!-- Power menu setting privacy hide all [CHAR LIMIT=NONE] -->
     <string name="power_menu_privacy_hide">Hide cards and controls when locked</string>
 
-    <!-- Quick controls toggle name [CHAR LIMIT=NONE] -->
-    <string name="quick_controls_setting_toggle">Show quick controls</string>
+    <!-- Device controls toggle name [CHAR LIMIT=60] -->
+    <string name="device_controls_setting_toggle">Show device controls</string>
 
-    <!-- Quick controls toggle subtitle [CHAR LIMIT=NONE] -->
-    <string name="quick_controls_setting_subtitle">To access controls for connected devices, hold the Power button</string>
+    <!-- Cards and passes toggle name [CHAR LIMIT=60] -->
+    <string name="cards_passes_setting_toggle">Show cards &amp; passes</string>
+
+    <!-- Device controls toggle subtitle [CHAR LIMIT=NONE] -->
+    <string name="device_controls_setting_subtitle">To access controls for connected devices, hold the Power button</string>
+
+    <!-- Cards and passes toggle subtitle [CHAR LIMIT=NONE] -->
+    <string name="cards_passes_setting_subtitle">To access things like your payment methods and boarding passes, press and hold the Power button.</string>
 
     <!-- Title for RTT setting. [CHAR LIMIT=NONE] -->
     <string name="rtt_settings_title"></string>
diff --git a/res/xml/device_controls_settings.xml b/res/xml/device_controls_settings.xml
new file mode 100644
index 0000000..998b982
--- /dev/null
+++ b/res/xml/device_controls_settings.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2020 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"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:title="@string/device_controls_sentence">
+
+    <com.android.settings.widget.VideoPreference
+        android:key="device_controls_video"/>
+
+    <SwitchPreference
+        android:key="gesture_device_controls_switch"
+        android:title="@string/device_controls_setting_toggle"
+        android:summary="@string/device_controls_setting_subtitle"
+        app:keywords="@string/keywords_device_controls"
+        app:controller="com.android.settings.gestures.DeviceControlsPreferenceController"
+        app:allowDividerAbove="true" />
+
+</PreferenceScreen>
diff --git a/res/xml/gestures.xml b/res/xml/gestures.xml
index a523ec6..ed191ce 100644
--- a/res/xml/gestures.xml
+++ b/res/xml/gestures.xml
@@ -81,9 +81,8 @@
         settings:controller="com.android.settings.gestures.PreventRingingParentPreferenceController" />
 
     <Preference
-        android:key="gesture_global_actions_panel_summary"
-        android:title="@string/global_actions_panel_short_title"
-        android:fragment="com.android.settings.gestures.GlobalActionsPanelSettings"
-        settings:controller="com.android.settings.gestures.GlobalActionsPanelPreferenceController" />
-
+        android:key="gesture_power_menu_summary"
+        android:title="@string/power_menu_setting_name"
+        android:fragment="com.android.settings.gestures.PowerMenuSettings"
+        settings:controller="com.android.settings.gestures.PowerMenuPreferenceController" />
 </PreferenceScreen>
diff --git a/res/xml/global_actions_panel_settings.xml b/res/xml/global_actions_panel_settings.xml
index 3b7bef3..980c756 100644
--- a/res/xml/global_actions_panel_settings.xml
+++ b/res/xml/global_actions_panel_settings.xml
@@ -18,7 +18,7 @@
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:title="@string/global_actions_panel_title">
+    android:title="@string/cards_passes_sentence">
 
     <com.android.settings.widget.VideoPreference
         android:key="global_actions_panel_video"
@@ -26,9 +26,9 @@
 
     <SwitchPreference
         android:key="gesture_global_actions_panel_switch"
-        android:title="@string/global_actions_panel_title"
-        android:summary="@string/global_actions_panel_summary"
-        app:keywords="@string/keywords_global_actions_panel"
+        android:title="@string/cards_passes_setting_toggle"
+        android:summary="@string/cards_passes_setting_subtitle"
+        app:keywords="@string/keywords_cards_passes"
         app:controller="com.android.settings.gestures.GlobalActionsPanelPreferenceController"
         app:allowDividerAbove="true" />
 
diff --git a/res/xml/power_menu_settings.xml b/res/xml/power_menu_settings.xml
new file mode 100644
index 0000000..453a7e6
--- /dev/null
+++ b/res/xml/power_menu_settings.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2020 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"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
+    android:title="@string/power_menu_setting_name">
+
+    <Preference
+        android:key="gesture_global_actions_panel_summary"
+        android:title="@string/cards_passes_sentence"
+        android:fragment="com.android.settings.gestures.GlobalActionsPanelSettings"
+        settings:controller="com.android.settings.gestures.GlobalActionsPanelPreferenceController" />
+
+    <Preference
+        android:key="gesture_device_controls_summary"
+        android:title="@string/device_controls_sentence"
+        android:fragment="com.android.settings.gestures.DeviceControlsSettings"
+        settings:controller="com.android.settings.gestures.DeviceControlsPreferenceController" />
+</PreferenceScreen>