Bug: 22718745 Intents to 'draw over other apps' should go direct to the package's
page instead of the top level one

Settings:
Added two activities to handle app-specific Intent when app invoke permission
management UI.

SettingsActivity:
Added two fragment classes to handle app-specific Intent when app invoke permission
management UI.

AndroidManifest.xml:
We handle both Intent to top level settings and app-specific management UI for
app ops protected permissions.

AppStateAppOpsBridge:
Added a new field to PermissionState to keep track of permission declared vs one
that is actually granted during install time.

AppState{Overlay/Usage/WriteSettings}Bridge:
Updated the fields affected by changes in PermissionState.

{DrawOverlay/UsageAccess/WriteSettings}Details:
Disabled the toggling of permission if the app did not declare for the asked
permission.

Change-Id: Ibf63e4d9a4fbf7899a93d2176abb1204c4f75557
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1fef233..ce5308a 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2541,6 +2541,18 @@
                 android:value="com.android.settings.applications.ManageApplications" />
         </activity>
 
+        <activity android:name="Settings$AppDrawOverlaySettingsActivity"
+                android:label="@string/draw_overlay_title"
+                android:taskAffinity="">
+            <intent-filter android:priority="1">
+                <action android:name="android.settings.action.MANAGE_OVERLAY_PERMISSION" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <data android:scheme="package" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.applications.DrawOverlayDetails" />
+        </activity>
+
         <activity android:name="Settings$WriteSettingsActivity"
                 android:label="@string/write_settings_title"
                 android:taskAffinity="">
@@ -2552,5 +2564,17 @@
                 android:value="com.android.settings.applications.ManageApplications" />
         </activity>
 
+        <activity android:name="Settings$AppWriteSettingsActivity"
+                android:label="@string/write_settings_title"
+                android:taskAffinity="">
+            <intent-filter android:priority="1">
+                <action android:name="android.settings.action.MANAGE_WRITE_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <data android:scheme="package" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.applications.WriteSettingsDetails" />
+        </activity>
+
     </application>
 </manifest>