Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fd8051a authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Don't let monkeys launch storage management activities.

Guard against monkeys in two places where intents to other activities are
launched.

Bug: 5415988
Change-Id: Ia3c5514c02423f7b249f655296bb02e279789dfd
parent c1da7b10
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.settings.applications;

import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.applications.ApplicationsState.AppEntry;

import android.app.Activity;
@@ -907,10 +908,12 @@ public class InstalledAppDetails extends Fragment
            mActivitiesButton.setEnabled(false);
        } else if(v == mClearDataButton) {
            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, -1);
                }
            } else {
                showDialogInner(DLG_CLEAR_DATA, 0);
            }
+5 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.widget.Toast;

import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;

public class Memory extends SettingsPreferenceFragment {
    private static final String TAG = "MemorySettings";
@@ -237,7 +238,10 @@ public class Memory extends SettingsPreferenceFragment {
            StorageVolumePreferenceCategory svpc = mStorageVolumePreferenceCategories[i];
            Intent intent = svpc.intentForClick(preference);
            if (intent != null) {
                // Don't go across app boundary if monkey is running
                if (!Utils.isMonkeyRunning()) {
                    startActivity(intent);
                }
                return true;
            }