diff options
author | Jeff Sharkey <jsharkey@google.com> | 2015-08-07 23:51:57 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-07 23:51:57 +0000 |
commit | cb0c07181a77ef134310c0e037345f33e7a46d9e (patch) | |
tree | 7df839482bab2c1d7158edb2aa2a4c334ab23ae1 | |
parent | 5b2c66e4da749ca59d09776ec7831e20d1211909 (diff) | |
parent | 67f0739ca3a81515975856b09d216debfd090ae9 (diff) | |
download | packages_apps_Settings-cb0c07181a77ef134310c0e037345f33e7a46d9e.zip packages_apps_Settings-cb0c07181a77ef134310c0e037345f33e7a46d9e.tar.gz packages_apps_Settings-cb0c07181a77ef134310c0e037345f33e7a46d9e.tar.bz2 |
am 67f0739c: Merge "Block moving when already in progress." into mnc-dev
* commit '67f0739ca3a81515975856b09d216debfd090ae9':
Block moving when already in progress.
-rw-r--r-- | src/com/android/settings/applications/AppStorageSettings.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java index a524c7d..29a4819 100644 --- a/src/com/android/settings/applications/AppStorageSettings.java +++ b/src/com/android/settings/applications/AppStorageSettings.java @@ -18,15 +18,18 @@ package com.android.settings.applications; import android.app.ActivityManager; import android.app.AlertDialog; +import android.app.AppGlobals; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageDataObserver; +import android.content.pm.IPackageManager; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.Message; +import android.os.RemoteException; import android.os.storage.StorageManager; import android.os.storage.VolumeInfo; import android.preference.Preference; @@ -183,11 +186,21 @@ public class AppStorageSettings extends AppInfoWithHeader } else { showDialogInner(DLG_CLEAR_DATA, 0); } - } else if (v == mChangeStorageButton && mDialogBuilder != null) { + } else if (v == mChangeStorageButton && mDialogBuilder != null && !isMoveInProgress()) { mDialogBuilder.show(); } } + private boolean isMoveInProgress() { + final IPackageManager pm = AppGlobals.getPackageManager(); + try { + // TODO: define a cleaner API for this + return pm.isPackageFrozen(mPackageName); + } catch (RemoteException e) { + return false; + } + } + @Override public void onClick(DialogInterface dialog, int which) { final Context context = getActivity(); |