diff options
3 files changed, 22 insertions, 2 deletions
diff --git a/PermissionController/res/values/strings.xml b/PermissionController/res/values/strings.xml index b9895d611..24db04f2d 100644 --- a/PermissionController/res/values/strings.xml +++ b/PermissionController/res/values/strings.xml @@ -645,9 +645,15 @@ <!-- Label for the hibernation / auto revoke switch on T+ devices [CHAR LIMIT=40] --> <string name="unused_apps_label_v2">Pause app activity if unused</string> + <!-- Label of a switch preference that controls whether the system will pause app activity when the app has not been used for a while [CHAR LIMIT=40]--> + <string name="unused_apps_label_v3">Manage app if unused</string> + <!-- Hibernation switch preference summary which describes what the toggle does on T+ devices [CHAR LIMIT=NONE] --> <string name="unused_apps_summary">Remove permissions, delete temporary files, and stop notifications</string> + <!-- Summary of the switch preference that controls whether the system will pause app activity when the app has not been used for a while [CHAR LIMIT=NONE]--> + <string name="unused_apps_summary_v2">Remove permissions, delete temporary files, stop notifications, and archive the app</string> + <!-- Summary for stating that permissions will be removed [CHAR LIMIT=none] --> <string name="auto_revoke_summary">To protect your data, permissions for this app will be removed if the app is unused for a few months.</string> diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionGroupsFragment.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionGroupsFragment.java index 4bc14ed24..84d019bad 100644 --- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionGroupsFragment.java +++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionGroupsFragment.java @@ -64,6 +64,7 @@ import androidx.preference.PreferenceScreen; import androidx.preference.SwitchPreference; import com.android.modules.utils.build.SdkLevel; +import com.android.permission.flags.Flags; import com.android.permissioncontroller.PermissionControllerStatsLog; import com.android.permissioncontroller.R; import com.android.permissioncontroller.permission.model.livedatatypes.HibernationSettingState; @@ -431,8 +432,10 @@ public final class AppPermissionGroupsFragment extends SettingsWithLargeHeader i int switchTitleId; if (isHibernationEnabled()) { if (SdkLevel.isAtLeastT()) { - switchTitleId = R.string.unused_apps_label_v2; - autoRevokeSwitch.setSummary(R.string.unused_apps_summary); + switchTitleId = isArchivingEnabled() ? R.string.unused_apps_label_v3 + : R.string.unused_apps_label_v2; + autoRevokeSwitch.setSummary(isArchivingEnabled() ? R.string.unused_apps_summary_v2 + : R.string.unused_apps_summary); } else { switchTitleId = R.string.unused_apps_label; } @@ -456,6 +459,10 @@ public final class AppPermissionGroupsFragment extends SettingsWithLargeHeader i autoRevokeCategory.addPreference(autoRevokeSummary); } + private boolean isArchivingEnabled() { + return SdkLevel.isAtLeastV() && Flags.archiving(); + } + private void setAutoRevokeToggleState(HibernationSettingState state) { if (state == null || !mViewModel.getPackagePermGroupsLiveData().isInitialized() || getPreferenceScreen() == null || getListView() == null || getView() == null) { diff --git a/flags/flags.aconfig b/flags/flags.aconfig index 37aca2a56..49b086b2b 100644 --- a/flags/flags.aconfig +++ b/flags/flags.aconfig @@ -19,4 +19,11 @@ flag { namespace: "wear_security" description: "This flag is used to support Privacy dashboard for Wear" bug: "309721061" +} + +flag { + name: "archiving" + namespace: "permissions" + description: "Feature flag to enable the archiving feature." + bug: "278553670" }
\ No newline at end of file |