Fix issue #5460725: Crespo does not fully boot after a wipe

Add a hack to relaunch whatever was supposed to be launched
(presumably home) when CryptKeeper discovers it shouldn't be
running.

Change-Id: I1406b8d6e8d484ed1c169fa4908a9e05e8c7c2ad
This commit is contained in:
Dianne Hackborn
2011-10-16 11:49:00 -07:00
parent f9eca2e0e0
commit 140f6c6cf7
2 changed files with 15 additions and 1 deletions

View File

@@ -221,7 +221,20 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
// Disable the crypt keeper.
PackageManager pm = getPackageManager();
ComponentName name = new ComponentName(this, CryptKeeper.class);
pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
// Typically CryptKeeper is launched as the home app. We didn't
// want to be running, so need to finish this activity and re-launch
// its intent now that we are not in the way of doing what is really
// supposed to happen.
// NOTE: This is really grungy. I think it would be better for the
// activity manager to explicitly launch the crypt keeper instead of
// home in the situation where we need to decrypt the device
finish();
Intent intent = getIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(null);
startActivity(intent);
return;
}