summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Lin <danny@kdrag0n.dev>2020-11-04 00:51:36 -0800
committeralk3pInjection <webmaster@raspii.tech>2022-06-29 16:52:50 +0800
commit3008f5ade14bf5a079a565061e96900cce2dc74b (patch)
tree7c1ef43fce46c235cf1d05aafdbc26f6db3078d1
parentbc8221bbee7fc883ec631ad4447ecd2dc2350cf7 (diff)
Settings: Ignore custom app space management activities
Allowing apps to override the "Clear storage" function makes users powerless when it comes to clearing the data of a rogue app, short of reinstalling the entire app. I've never seen an app that uses this in a good way, so just remove it to allow clearing storage of any app. The most prominent example of this is the Google Search (Velvet) app, which does not allow the user to clear all data and leaves up to 100 MB of wasted space even after clearing storage in its custom space manager. It's also impossible to clear its data after disabling the app, which forces users to deal with wasted space for no reason. Change-Id: Ib80d4741750bcbb5c6e1dd844aa763ce4e24854c
-rw-r--r--src/com/android/settings/applications/AppStorageSettings.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java
index 91eeace0fd..720bddb73f 100644
--- a/src/com/android/settings/applications/AppStorageSettings.java
+++ b/src/com/android/settings/applications/AppStorageSettings.java
@@ -208,13 +208,6 @@ public class AppStorageSettings extends AppInfoWithHeader
if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
getActivity(), mAppsControlDisallowedAdmin);
- } else if (mAppEntry.info.manageSpaceActivityName != null) {
- if (!Utils.isMonkeyRunning()) {
- Intent intent = new Intent(Intent.ACTION_DEFAULT);
- intent.setClassName(mAppEntry.info.packageName,
- mAppEntry.info.manageSpaceActivityName);
- startActivityForResult(intent, REQUEST_MANAGE_SPACE);
- }
} else {
showDialogInner(DLG_CLEAR_DATA, 0);
}
@@ -298,11 +291,8 @@ public class AppStorageSettings extends AppInfoWithHeader
if (appHasSpaceManagementUI) {
intent.setClassName(mAppEntry.info.packageName, mAppEntry.info.manageSpaceActivityName);
}
- final boolean isManageSpaceActivityAvailable =
- getPackageManager().resolveActivity(intent, 0) != null;
- if ((!appHasSpaceManagementUI && appRestrictsClearingData)
- || !isManageSpaceActivityAvailable) {
+ if (!appHasSpaceManagementUI && appRestrictsClearingData) {
mButtonsPref
.setButton1Text(R.string.clear_user_data_text)
.setButton1Icon(R.drawable.ic_settings_delete)