Prevents drawer menu from showing depending on intent.
When ChooseLockScreenGeneric is started via the set password intents, it should not allow the drawer menu to show. bug:26288300 Change-Id: I10d512e20fedab2be8c725c7d524db0c55666590
This commit is contained in:
@@ -59,6 +59,12 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
public Intent getIntent() {
|
||||
Intent modIntent = new Intent(super.getIntent());
|
||||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, getFragmentClass().getName());
|
||||
|
||||
String action = modIntent.getAction();
|
||||
if (DevicePolicyManager.ACTION_SET_NEW_PASSWORD.equals(action)
|
||||
|| DevicePolicyManager.ACTION_SET_NEW_PARENT_PROFILE_PASSWORD.equals(action)) {
|
||||
modIntent.putExtra(EXTRA_HIDE_DRAWER, true);
|
||||
}
|
||||
return modIntent;
|
||||
}
|
||||
|
||||
@@ -110,6 +116,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
private LockPatternUtils mLockPatternUtils;
|
||||
private FingerprintManager mFingerprintManager;
|
||||
private int mUserId;
|
||||
private boolean mHideDrawer = false;
|
||||
private RemovalCallback mRemovalCallback = new RemovalCallback() {
|
||||
|
||||
@Override
|
||||
@@ -154,6 +161,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
if (getActivity() instanceof ChooseLockGeneric.InternalActivity) {
|
||||
mPasswordConfirmed = !confirmCredentials;
|
||||
}
|
||||
mHideDrawer = getActivity().getIntent().getBooleanExtra(EXTRA_HIDE_DRAWER, false);
|
||||
|
||||
mHasChallenge = getActivity().getIntent().getBooleanExtra(
|
||||
ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false);
|
||||
@@ -263,6 +271,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
unlockMethodIntent);
|
||||
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT,
|
||||
mForFingerprint);
|
||||
intent.putExtra(EXTRA_HIDE_DRAWER, mHideDrawer);
|
||||
startActivityForResult(intent, ENABLE_ENCRYPTION_REQUEST);
|
||||
} else {
|
||||
if (mForChangeCredRequiredForBoot) {
|
||||
@@ -613,6 +622,9 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
mUserPassword, mUserId);
|
||||
}
|
||||
}
|
||||
if (intent != null) {
|
||||
intent.putExtra(EXTRA_HIDE_DRAWER, mHideDrawer);
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user