Add fallback encryption-aware home screen.

When the home screen selected by the user isn't encryption aware, we
still need to put something on the ActivityStack.  For now, let's use
an empty activity that knows how to dismiss itself when the
credential-encrypted storage is unlocked; that's enough for the
system to re-resolve the home intent and find the real home screen.

Also follow method refactoring.

Bug: 22358539
Change-Id: Iebc4ad8d2dd62ada079cab03d5765f7631fd4beb
This commit is contained in:
Jeff Sharkey
2015-11-30 13:28:19 -07:00
parent aace27d3db
commit 9e9f7d1116
3 changed files with 61 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.support.v7.preference.Preference;
@@ -192,12 +193,13 @@ public class AppStorageSettings extends AppInfoWithHeader
}
private boolean isMoveInProgress() {
final IPackageManager pm = AppGlobals.getPackageManager();
try {
// TODO: define a cleaner API for this
return pm.isPackageFrozen(mPackageName);
} catch (RemoteException e) {
AppGlobals.getPackageManager().checkPackageStartable(mPackageName,
UserHandle.myUserId());
return false;
} catch (RemoteException | SecurityException e) {
return true;
}
}