Call reportFailedPasswordAttempt from Work Challenge

Entering the wrong credential in ConfirmDeviceCredentials should
also count as failed attempts for the password, after which the
DPC have set a restriction to wipe the work profile.

Fixed related issues, such as the CredentialChecker re-sending
the result after onResume causing additional attempts to be counted.

The new error message String is also displayed initially when there
are pending attempts to inform the user that they are not starting
from fresh.

Bug: 26677759
Change-Id: I70cfae4c05e705ad7fe93bc071426459b79e7d0c
This commit is contained in:
Clara Bayarri
2016-01-28 17:50:53 +00:00
parent 4d2186a9b3
commit 9d357ea072
5 changed files with 162 additions and 43 deletions

View File

@@ -47,7 +47,7 @@ public class CredentialCheckResultTracker extends Fragment {
mListener = listener;
if (mListener != null && mHasResult) {
mListener.onCredentialChecked(mResultMatched, mResultData, mResultTimeoutMs,
mResultEffectiveUserId);
mResultEffectiveUserId, false /* newResult */);
}
}
@@ -60,7 +60,7 @@ public class CredentialCheckResultTracker extends Fragment {
mHasResult = true;
if (mListener != null) {
mListener.onCredentialChecked(mResultMatched, mResultData, mResultTimeoutMs,
mResultEffectiveUserId);
mResultEffectiveUserId, true /* newResult */);
}
}
@@ -74,6 +74,6 @@ public class CredentialCheckResultTracker extends Fragment {
interface Listener {
public void onCredentialChecked(boolean matched, Intent intent, int timeoutMs,
int effectiveUserId);
int effectiveUserId, boolean newResult);
}
}