Skip to content

Commit ed90d22

Browse files
kdrag0nNurKeinNeid
authored andcommitted
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
1 parent 8eb7c3b commit ed90d22

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/com/android/settings/applications/AppStorageSettings.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,6 @@ void handleClearDataClick() {
209209
if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) {
210210
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
211211
getActivity(), mAppsControlDisallowedAdmin);
212-
} else if (mAppEntry.info.manageSpaceActivityName != null) {
213-
if (!Utils.isMonkeyRunning()) {
214-
Intent intent = new Intent(Intent.ACTION_DEFAULT);
215-
intent.setClassName(mAppEntry.info.packageName,
216-
mAppEntry.info.manageSpaceActivityName);
217-
startActivityForResult(intent, REQUEST_MANAGE_SPACE);
218-
}
219212
} else {
220213
showDialogInner(DLG_CLEAR_DATA, 0);
221214
}
@@ -299,11 +292,8 @@ private void initDataButtons() {
299292
if (appHasSpaceManagementUI) {
300293
intent.setClassName(mAppEntry.info.packageName, mAppEntry.info.manageSpaceActivityName);
301294
}
302-
final boolean isManageSpaceActivityAvailable =
303-
getPackageManager().resolveActivity(intent, 0) != null;
304295

305-
if ((!appHasSpaceManagementUI && appRestrictsClearingData)
306-
|| !isManageSpaceActivityAvailable) {
296+
if (!appHasSpaceManagementUI && appRestrictsClearingData) {
307297
mButtonsPref
308298
.setButton1Text(R.string.clear_user_data_text)
309299
.setButton1Icon(R.drawable.ic_settings_delete)

0 commit comments

Comments
 (0)