Hint user that fingerprint cannot unlock FBE keys

Show a hint text to user noting that pattern/PIN/password is
required when decrypting the credential based storage when file
based encryption is turned on.

The hint text is the same as that of the device unlock screen after
device reboot.

Bug: 27964055
Change-Id: I0d5a493bab69eae5ce4742bd07d4851387863cac
This commit is contained in:
Daniel U
2016-04-07 19:18:26 +01:00
parent 77359ad761
commit 6655e1b6f5
7 changed files with 61 additions and 5 deletions

View File

@@ -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();