Merge "Hint user that fingerprint cannot unlock FBE keys" into nyc-dev
This commit is contained in:
@@ -66,6 +66,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
|
||||
PACKAGE + ".ConfirmCredentials.showWhenLocked";
|
||||
|
||||
private FingerprintUiHelper mFingerprintHelper;
|
||||
private boolean mIsStrongAuthRequired;
|
||||
private boolean mAllowFpAuthentication;
|
||||
protected Button mCancelButton;
|
||||
protected ImageView mFingerprintIcon;
|
||||
@@ -73,6 +74,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
|
||||
protected int mUserId;
|
||||
protected LockPatternUtils mLockPatternUtils;
|
||||
protected TextView mErrorTextView;
|
||||
protected TextView mStrongAuthRequiredTextView;
|
||||
protected final Handler mHandler = new Handler();
|
||||
|
||||
@Override
|
||||
@@ -85,7 +87,9 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
|
||||
mUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras());
|
||||
final UserManager userManager = UserManager.get(getActivity());
|
||||
mEffectiveUserId = userManager.getCredentialOwnerProfile(mUserId);
|
||||
mAllowFpAuthentication = mAllowFpAuthentication && !isFingerprintDisabledByAdmin();
|
||||
mIsStrongAuthRequired = isStrongAuthRequired();
|
||||
mAllowFpAuthentication = mAllowFpAuthentication && !isFingerprintDisabledByAdmin()
|
||||
&& !mIsStrongAuthRequired;
|
||||
mLockPatternUtils = new LockPatternUtils(getActivity());
|
||||
}
|
||||
|
||||
@@ -93,6 +97,11 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mCancelButton = (Button) view.findViewById(R.id.cancelButton);
|
||||
if (mStrongAuthRequiredTextView != null) {
|
||||
// INIVISIBLE instead of GONE because it also acts as a weighted spacer
|
||||
mStrongAuthRequiredTextView.setVisibility(
|
||||
mIsStrongAuthRequired ? View.VISIBLE : View.INVISIBLE);
|
||||
}
|
||||
mFingerprintIcon = (ImageView) view.findViewById(R.id.fingerprintIcon);
|
||||
mFingerprintHelper = new FingerprintUiHelper(
|
||||
mFingerprintIcon,
|
||||
@@ -123,6 +132,10 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
|
||||
return (disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0;
|
||||
}
|
||||
|
||||
private boolean isStrongAuthRequired() {
|
||||
return !(UserManager.get(getContext()).isUserUnlocked(mEffectiveUserId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
@@ -124,6 +124,18 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
|| DevicePolicyManager.PASSWORD_QUALITY_COMPLEX == storedQuality
|
||||
|| DevicePolicyManager.PASSWORD_QUALITY_MANAGED == storedQuality;
|
||||
|
||||
// Strong auth is required when the user is locked.
|
||||
// Currently a user does not get locked again until the device restarts. Show the
|
||||
// hint text as "device has just been restarted".
|
||||
mStrongAuthRequiredTextView = (TextView) view.findViewById(R.id.strongAuthRequiredText);
|
||||
if (mIsAlpha) {
|
||||
mStrongAuthRequiredTextView.setText(
|
||||
R.string.lockpassword_strong_auth_required_reason_restart_password);
|
||||
} else {
|
||||
mStrongAuthRequiredTextView.setText(
|
||||
R.string.lockpassword_strong_auth_required_reason_restart_pin);
|
||||
}
|
||||
|
||||
mImm = (InputMethodManager) getActivity().getSystemService(
|
||||
Context.INPUT_METHOD_SERVICE);
|
||||
|
||||
|
@@ -118,6 +118,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
mHeaderTextView = (TextView) view.findViewById(R.id.headerText);
|
||||
mLockPatternView = (LockPatternView) view.findViewById(R.id.lockPattern);
|
||||
mDetailsTextView = (TextView) view.findViewById(R.id.detailsText);
|
||||
mStrongAuthRequiredTextView = (TextView) view.findViewById(R.id.strongAuthRequiredText);
|
||||
mErrorTextView = (TextView) view.findViewById(R.id.errorText);
|
||||
mLeftSpacerLandscape = view.findViewById(R.id.leftSpacer);
|
||||
mRightSpacerLandscape = view.findViewById(R.id.rightSpacer);
|
||||
@@ -176,6 +177,12 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
FRAGMENT_TAG_CHECK_LOCK_RESULT).commit();
|
||||
}
|
||||
|
||||
// Strong auth is required when the user is locked.
|
||||
// Currently a user does not get locked again until the device restarts. Show the
|
||||
// hint text as "device has just been restarted".
|
||||
mStrongAuthRequiredTextView.setText(
|
||||
R.string.lockpassword_strong_auth_required_reason_restart_pattern);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user