Settings page to manage FSI permission
Apps > Special App Access > Manage Full Screen Intents > App Specific page Follows new Settings Platform Architecture that the Settings team is migrating to for UDC. Bug: 243421660 Test: make SettingsGoogle -j40 adb install -r out/target/product/$TARGET_PRODUCT/system_ext/priv-app/SettingsGoogle/SettingsGoogle.apk Change-Id: Id2ca18480ddf788bee18b67a3689ef9593059a24
This commit is contained in:
@@ -1681,6 +1681,25 @@
|
||||
android:value="@string/menu_key_apps"/>
|
||||
</activity-alias>
|
||||
|
||||
<activity-alias android:name="com.google.android.settings.ManageFullScreenIntent"
|
||||
android:exported="true"
|
||||
android:targetActivity=".spa.SpaBridgeActivity">
|
||||
<meta-data android:name="com.android.settings.spa.DESTINATION"
|
||||
android:value="TogglePermissionAppList/UseFullScreenIntent"/>
|
||||
</activity-alias>
|
||||
|
||||
<activity-alias android:name="com.google.android.settings.AppManageFullScreenIntent"
|
||||
android:exported="true"
|
||||
android:targetActivity=".spa.SpaAppBridgeActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.settings.MANAGE_APP_USE_FULL_SCREEN_INTENT" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:scheme="package" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="com.android.settings.spa.DESTINATION"
|
||||
android:value="TogglePermissionAppInfoPage/UseFullScreenIntent"/>
|
||||
</activity-alias>
|
||||
|
||||
<activity android:name=".applications.InstalledAppOpenByDefaultActivity"
|
||||
android:label="@string/application_info_label"
|
||||
android:exported="true">
|
||||
|
||||
@@ -8880,6 +8880,15 @@
|
||||
<!-- Label for showing apps that can manage external storage[CHAR LIMIT=45] -->
|
||||
<string name="filter_manage_external_storage">Can access all files</string>
|
||||
|
||||
<!-- Manage full screen intent permission title [CHAR LIMIT=40] -->
|
||||
<string name="full_screen_intent_title">Manage full screen intents</string>
|
||||
|
||||
<!-- Label for setting that allows apps to send full screen intents. [CHAR LIMIT=NONE] -->
|
||||
<string name="permit_full_screen_intent">Allow apps to send full screen intents</string>
|
||||
|
||||
<!-- Description for setting that allows apps to send full screen intents. [CHAR LIMIT=NONE] -->
|
||||
<string name="footer_description_full_screen_intent">Allow this app to send full screen intent notifications that cover the entire screen.</string>
|
||||
|
||||
<!-- Media management apps settings title [CHAR LIMIT=40] -->
|
||||
<string name="media_management_apps_title">Media management apps</string>
|
||||
<!-- Label for a setting which controls whether an app can manage media files [CHAR LIMIT=45] -->
|
||||
|
||||
@@ -94,6 +94,11 @@
|
||||
android:fragment="com.android.settings.notification.NotificationAccessSettings"
|
||||
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.NotificationAccessController" />
|
||||
|
||||
<Preference
|
||||
android:key="use_full_screen_intent"
|
||||
android:title="@string/full_screen_intent_title"
|
||||
settings:controller="com.android.settings.spa.app.specialaccess.UseFullScreenIntentPreferenceController" />
|
||||
|
||||
<Preference
|
||||
android:key="picture_in_picture"
|
||||
android:title="@string/picture_in_picture_title"
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.android.settings.spa.app.specialaccess.ModifySystemSettingsAppListPro
|
||||
import com.android.settings.spa.app.specialaccess.PictureInPictureListProvider
|
||||
import com.android.settings.spa.app.specialaccess.SpecialAppAccessPageProvider
|
||||
import com.android.settings.spa.app.specialaccess.WifiControlAppListProvider
|
||||
import com.android.settings.spa.app.specialaccess.UseFullScreenIntentAppListProvider
|
||||
import com.android.settings.spa.development.UsageStatsPageProvider
|
||||
import com.android.settings.spa.home.HomePageProvider
|
||||
import com.android.settings.spa.notification.AppListNotificationsPageProvider
|
||||
@@ -51,6 +52,7 @@ open class SettingsSpaEnvironment(context: Context) : SpaEnvironment(context) {
|
||||
DisplayOverOtherAppsAppListProvider,
|
||||
MediaManagementAppsAppListProvider,
|
||||
ModifySystemSettingsAppListProvider,
|
||||
UseFullScreenIntentAppListProvider,
|
||||
PictureInPictureListProvider,
|
||||
InstallUnknownAppsListProvider,
|
||||
AlarmsAndRemindersAppListProvider,
|
||||
|
||||
@@ -60,6 +60,7 @@ object SpecialAppAccessPageProvider : SettingsPageProvider {
|
||||
DisplayOverOtherAppsAppListProvider,
|
||||
MediaManagementAppsAppListProvider,
|
||||
ModifySystemSettingsAppListProvider,
|
||||
UseFullScreenIntentAppListProvider,
|
||||
PictureInPictureListProvider,
|
||||
InstallUnknownAppsListProvider,
|
||||
AlarmsAndRemindersAppListProvider,
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2023 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.
|
||||
*/
|
||||
|
||||
package com.android.settings.spa.app.specialaccess
|
||||
|
||||
import android.Manifest
|
||||
import android.app.AppOpsManager
|
||||
import android.content.Context
|
||||
import com.android.settings.R
|
||||
import com.android.settingslib.spaprivileged.template.app.AppOpPermissionListModel
|
||||
import com.android.settingslib.spaprivileged.template.app.TogglePermissionAppListProvider
|
||||
|
||||
object UseFullScreenIntentAppListProvider : TogglePermissionAppListProvider {
|
||||
override val permissionType = "UseFullScreenIntent"
|
||||
override fun createModel(context: Context) = UseFullScreenIntentListModel(context)
|
||||
}
|
||||
|
||||
class UseFullScreenIntentListModel(context: Context) : AppOpPermissionListModel(context) {
|
||||
override val pageTitleResId = R.string.full_screen_intent_title
|
||||
override val switchTitleResId = R.string.permit_full_screen_intent
|
||||
override val footerResId = R.string.footer_description_full_screen_intent
|
||||
override val appOp = AppOpsManager.OP_USE_FULL_SCREEN_INTENT
|
||||
override val permission = Manifest.permission.USE_FULL_SCREEN_INTENT
|
||||
override val setModeByUid = true
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2023 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.
|
||||
*/
|
||||
|
||||
package com.android.settings.spa.app.specialaccess;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.spa.SpaActivity;
|
||||
|
||||
public class UseFullScreenIntentPreferenceController extends BasePreferenceController {
|
||||
public UseFullScreenIntentPreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (TextUtils.equals(preference.getKey(), mPreferenceKey)) {
|
||||
SpaActivity.startSpaActivity(
|
||||
mContext, UseFullScreenIntentAppListProvider.INSTANCE.getAppListRoute());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user