Add setting and permission for assist gesture

Bug: 37427306

Test: manual
Merged-In: I659fa43fb085575df4d62e7765d88c6fd615fb7d
Change-Id: I659fa43fb085575df4d62e7765d88c6fd615fb7d
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index e0abfb5..61ae2d2 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6802,6 +6802,13 @@
         public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
 
         /**
+         * Whether Assist Gesture Deferred Setup has been completed
+         *
+         * @hide
+         */
+        public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
+
+        /**
          * Control whether Night display is currently activated.
          * @hide
          */
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index ae7355f..004ecfc 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1810,6 +1810,10 @@
     <permission android:name="android.permission.MANAGE_USERS"
         android:protectionLevel="signature|privileged" />
 
+    <!-- @hide Allows an application to configure the assist gesture -->
+    <permission android:name="android.permission.CONFIGURE_ASSIST_GESTURE"
+        android:protectionLevel="signature" />
+
     <!-- @hide Allows an application to create, remove users and get the list of
          users on the device. Applications holding this permission can only create restricted,
          guest, managed, demo, and ephemeral users. For creating other kind of users,
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index e107056..11ea841 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -4085,6 +4085,11 @@
     // Open: Settings > Search > No Result View
     SETTINGS_SEARCH_NO_RESULT = 1011;
 
+    // OPEN: Assist Gesture before training
+    // CATEGORY: SETTINGS
+    // OS: O DR
+    SETTINGS_ASSIST_GESTURE_FIRST_TIME = 1012;
+
     // Add new aosp constants above this line.
     // END OF AOSP CONSTANTS
   }