diff options
-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(); |