* commit 'c93ccee5e011e58341abe97d6c9d329cb11526ef': Disable back button on crypto screen
This commit is contained in:
@@ -116,7 +116,6 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
|
|||||||
/** If gone bad, should we show encryption failed (false) or corrupt (true)*/
|
/** If gone bad, should we show encryption failed (false) or corrupt (true)*/
|
||||||
private boolean mCorrupt;
|
private boolean mCorrupt;
|
||||||
/** A flag to indicate when the back event should be ignored */
|
/** A flag to indicate when the back event should be ignored */
|
||||||
private boolean mIgnoreBack = false;
|
|
||||||
/** When set, blocks unlocking. Set every COOL_DOWN_ATTEMPTS attempts, only cleared
|
/** When set, blocks unlocking. Set every COOL_DOWN_ATTEMPTS attempts, only cleared
|
||||||
by power cycling phone. */
|
by power cycling phone. */
|
||||||
private boolean mCooldown = false;
|
private boolean mCooldown = false;
|
||||||
@@ -390,15 +389,11 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ignore back events after the user has entered the decrypt screen and while the device is
|
* Ignore back events from this activity always - there's nowhere to go back
|
||||||
* encrypting.
|
* to
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// In the rare case that something pressed back even though we were disabled.
|
|
||||||
if (mIgnoreBack)
|
|
||||||
return;
|
|
||||||
super.onBackPressed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -516,6 +511,8 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
|
|||||||
|
|
||||||
passwordEntryInit();
|
passwordEntryInit();
|
||||||
|
|
||||||
|
findViewById(android.R.id.content).setSystemUiVisibility(View.STATUS_BAR_DISABLE_BACK);
|
||||||
|
|
||||||
if (mLockPatternView != null) {
|
if (mLockPatternView != null) {
|
||||||
mLockPatternView.setInStealthMode(!pattern_visible);
|
mLockPatternView.setInStealthMode(!pattern_visible);
|
||||||
}
|
}
|
||||||
@@ -694,7 +691,6 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
|
|||||||
* @param isEnabled true if back is enabled, false otherwise.
|
* @param isEnabled true if back is enabled, false otherwise.
|
||||||
*/
|
*/
|
||||||
private final void setBackFunctionality(boolean isEnabled) {
|
private final void setBackFunctionality(boolean isEnabled) {
|
||||||
mIgnoreBack = !isEnabled;
|
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
mStatusBar.disable(sWidgetsToDisable);
|
mStatusBar.disable(sWidgetsToDisable);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user