Add dialog for recommended controls
The dialog can only be requested if the package of the controls provider is currently in the foreground. This is accomplished by querying Activity Manager about the UidImportance of that package. Added android.permission.PACKAGE_USAGE_STATS to SystemUI for this. Test: atest Test: manual Fixes: 149410221 Change-Id: Ifdf479d8dbc70502da95d362e3bfd60ad3c561fb
This commit is contained in:
@@ -180,6 +180,8 @@
|
||||
|
||||
<!-- Adding Controls to SystemUI -->
|
||||
<uses-permission android:name="android.permission.BIND_CONTROLS" />
|
||||
<!-- Check foreground controls applications -->
|
||||
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
|
||||
|
||||
<!-- Quick Settings tile: Night Mode / Dark Theme -->
|
||||
<uses-permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE" />
|
||||
@@ -686,6 +688,25 @@
|
||||
android:visibleToInstantApps="true">
|
||||
</activity>
|
||||
|
||||
<receiver android:name=".controls.management.ControlsRequestReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.controls.action.ADD_CONTROL" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- started from ControlsFavoritingActivity -->
|
||||
<activity
|
||||
android:name=".controls.management.ControlsRequestDialog"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.ControlsRequestDialog"
|
||||
android:finishOnCloseSystemDialogs="true"
|
||||
android:showForAllUsers="true"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
|
||||
android:excludeFromRecents="true"
|
||||
android:visibleToInstantApps="true"/>
|
||||
|
||||
<!-- Doze with notifications, run in main sysui process for every user -->
|
||||
<service
|
||||
android:name=".doze.DozeService"
|
||||
|
||||
Reference in New Issue
Block a user