am 9597406a: Restart encryption display after screen power cycle

* commit '9597406aa1b83867b03a47d1a5162969b924f2fc':
  Restart encryption display after screen power cycle
This commit is contained in:
Andy Stadler
2011-02-01 18:17:19 -08:00
committed by Android Git Automerger

View File

@@ -99,6 +99,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// If we are not encrypted or encrypting, get out quickly.
String state = SystemProperties.get("vold.decrypt");
if ("".equals(state) || DECRYPT_STATE.equals(state)) {
// Disable the crypt keeper.
@@ -108,17 +109,6 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
return;
}
// Check to see why we were started.
String progress = SystemProperties.get("vold.encrypt_progress");
if (!"".equals(progress)) {
setContentView(R.layout.crypt_keeper_progress);
encryptionProgressInit();
} else {
setContentView(R.layout.crypt_keeper_password_entry);
passwordEntryInit();
}
// Disable the status bar
StatusBarManager sbm = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE);
sbm.disable(StatusBarManager.DISABLE_EXPAND
@@ -136,6 +126,26 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
}
}
/**
* Note, we defer the state check and screen setup to onStart() because this will be
* re-run if the user clicks the power button (sleeping/waking the screen), and this is
* especially important if we were to lose the wakelock for any reason.
*/
@Override
public void onStart() {
super.onStart();
// Check to see why we were started.
String progress = SystemProperties.get("vold.encrypt_progress");
if (!"".equals(progress)) {
setContentView(R.layout.crypt_keeper_progress);
encryptionProgressInit();
} else {
setContentView(R.layout.crypt_keeper_password_entry);
passwordEntryInit();
}
}
@Override
public void onStop() {
super.onStop();