[conflict] [DO NOT MERGE] Do not dismiss keyguard after SIM PUK unlock am: a30148b8a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19667859 Change-Id: Ie85c312ad47c5be276010f0a96d64e058be2fbda Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -30,6 +30,7 @@ import android.view.KeyEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
|
||||||
import com.android.internal.util.LatencyTracker;
|
import com.android.internal.util.LatencyTracker;
|
||||||
import com.android.internal.widget.LockPatternChecker;
|
import com.android.internal.widget.LockPatternChecker;
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
import com.android.internal.widget.LockPatternUtils;
|
||||||
@@ -97,6 +98,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
|
|||||||
|
|
||||||
protected abstract int getPasswordTextViewId();
|
protected abstract int getPasswordTextViewId();
|
||||||
protected abstract void resetState();
|
protected abstract void resetState();
|
||||||
|
protected abstract SecurityMode getSecurityMode();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onFinishInflate() {
|
protected void onFinishInflate() {
|
||||||
@@ -204,7 +206,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
|
|||||||
mCallback.reportUnlockAttempt(userId, true, 0);
|
mCallback.reportUnlockAttempt(userId, true, 0);
|
||||||
if (dismissKeyguard) {
|
if (dismissKeyguard) {
|
||||||
mDismissing = true;
|
mDismissing = true;
|
||||||
mCallback.dismiss(true, userId);
|
mCallback.dismiss(true, userId, getSecurityMode());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isValidPassword) {
|
if (isValidPassword) {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
|
|||||||
// the user proved presence via some other way to the trust agent.
|
// the user proved presence via some other way to the trust agent.
|
||||||
Log.i(TAG, "TrustAgent dismissed Keyguard.");
|
Log.i(TAG, "TrustAgent dismissed Keyguard.");
|
||||||
}
|
}
|
||||||
dismiss(false /* authenticated */, userId);
|
dismiss(false /* authenticated */, userId, SecurityMode.Invalid);
|
||||||
} else {
|
} else {
|
||||||
mViewMediatorCallback.playTrustedSound();
|
mViewMediatorCallback.playTrustedSound();
|
||||||
}
|
}
|
||||||
@@ -188,12 +188,13 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
|
|||||||
* @return True if the keyguard is done.
|
* @return True if the keyguard is done.
|
||||||
*/
|
*/
|
||||||
public boolean dismiss(int targetUserId) {
|
public boolean dismiss(int targetUserId) {
|
||||||
return dismiss(false, targetUserId);
|
return dismiss(false, targetUserId, getCurrentSecurityMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean handleBackKey() {
|
public boolean handleBackKey() {
|
||||||
if (mSecurityContainer.getCurrentSecuritySelection() != SecurityMode.None) {
|
if (mSecurityContainer.getCurrentSecuritySelection() != SecurityMode.None) {
|
||||||
mSecurityContainer.dismiss(false, KeyguardUpdateMonitor.getCurrentUser());
|
mSecurityContainer.dismiss(false, KeyguardUpdateMonitor.getCurrentUser(),
|
||||||
|
getCurrentSecurityMode());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -204,8 +205,10 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dismiss(boolean authenticated, int targetUserId) {
|
public boolean dismiss(boolean authenticated, int targetUserId,
|
||||||
return mSecurityContainer.showNextSecurityScreenOrFinish(authenticated, targetUserId);
|
SecurityMode expectedSecurityMode) {
|
||||||
|
return mSecurityContainer.showNextSecurityScreenOrFinish(authenticated, targetUserId,
|
||||||
|
expectedSecurityMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
|
|
||||||
|
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
|
||||||
import com.android.settingslib.animation.AppearAnimationUtils;
|
import com.android.settingslib.animation.AppearAnimationUtils;
|
||||||
import com.android.settingslib.animation.DisappearAnimationUtils;
|
import com.android.settingslib.animation.DisappearAnimationUtils;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
@@ -182,4 +183,9 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
|
|||||||
public boolean hasOverlappingRendering() {
|
public boolean hasOverlappingRendering() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SecurityMode getSecurityMode() {
|
||||||
|
return SecurityMode.PIN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import android.widget.TextView;
|
|||||||
import android.widget.TextView.OnEditorActionListener;
|
import android.widget.TextView.OnEditorActionListener;
|
||||||
|
|
||||||
import com.android.internal.widget.TextViewInputDisabler;
|
import com.android.internal.widget.TextViewInputDisabler;
|
||||||
|
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -393,4 +394,9 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
|
|||||||
}
|
}
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SecurityMode getSecurityMode() {
|
||||||
|
return SecurityMode.Password;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.android.internal.util.LatencyTracker;
|
|||||||
import com.android.internal.widget.LockPatternChecker;
|
import com.android.internal.widget.LockPatternChecker;
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
import com.android.internal.widget.LockPatternUtils;
|
||||||
import com.android.internal.widget.LockPatternView;
|
import com.android.internal.widget.LockPatternView;
|
||||||
|
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
|
||||||
import com.android.settingslib.animation.AppearAnimationCreator;
|
import com.android.settingslib.animation.AppearAnimationCreator;
|
||||||
import com.android.settingslib.animation.AppearAnimationUtils;
|
import com.android.settingslib.animation.AppearAnimationUtils;
|
||||||
import com.android.settingslib.animation.DisappearAnimationUtils;
|
import com.android.settingslib.animation.DisappearAnimationUtils;
|
||||||
@@ -349,7 +350,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
|
|||||||
mCallback.reportUnlockAttempt(userId, true, 0);
|
mCallback.reportUnlockAttempt(userId, true, 0);
|
||||||
if (dismissKeyguard) {
|
if (dismissKeyguard) {
|
||||||
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
|
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
|
||||||
mCallback.dismiss(true, userId);
|
mCallback.dismiss(true, userId, SecurityMode.Pattern);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
|
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
|
||||||
|
|||||||
@@ -15,14 +15,17 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.keyguard;
|
package com.android.keyguard;
|
||||||
|
|
||||||
|
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
|
||||||
|
|
||||||
public interface KeyguardSecurityCallback {
|
public interface KeyguardSecurityCallback {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dismiss the given security screen.
|
* Dismiss the given security screen.
|
||||||
* @param securityVerified true if the user correctly entered credentials for the given screen.
|
* @param securityVerified true if the user correctly entered credentials for the given screen.
|
||||||
* @param targetUserId a user that needs to be the foreground user at the dismissal completion.
|
* @param targetUserId a user that needs to be the foreground user at the dismissal completion.
|
||||||
|
* @param expectedSecurityMode The security mode that is invoking this dismiss.
|
||||||
*/
|
*/
|
||||||
void dismiss(boolean securityVerified, int targetUserId);
|
void dismiss(boolean securityVerified, int targetUserId, SecurityMode expectedSecurityMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manually report user activity to keep the device awake.
|
* Manually report user activity to keep the device awake.
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
|
|||||||
|
|
||||||
// Used to notify the container when something interesting happens.
|
// Used to notify the container when something interesting happens.
|
||||||
public interface SecurityCallback {
|
public interface SecurityCallback {
|
||||||
public boolean dismiss(boolean authenticated, int targetUserId);
|
public boolean dismiss(boolean authenticated, int targetUserId,
|
||||||
|
SecurityMode expectedSecurityMode);
|
||||||
public void userActivity();
|
public void userActivity();
|
||||||
public void onSecurityModeChanged(SecurityMode securityMode, boolean needsInput);
|
public void onSecurityModeChanged(SecurityMode securityMode, boolean needsInput);
|
||||||
|
|
||||||
@@ -480,10 +481,20 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
|
|||||||
* @param authenticated true if the user entered the correct authentication
|
* @param authenticated true if the user entered the correct authentication
|
||||||
* @param targetUserId a user that needs to be the foreground user at the finish (if called)
|
* @param targetUserId a user that needs to be the foreground user at the finish (if called)
|
||||||
* completion.
|
* completion.
|
||||||
|
* @param expectedSecurityMode SecurityMode that is invoking this request. SecurityMode.Invalid
|
||||||
|
* indicates that no check should be done
|
||||||
* @return true if keyguard is done
|
* @return true if keyguard is done
|
||||||
*/
|
*/
|
||||||
boolean showNextSecurityScreenOrFinish(boolean authenticated, int targetUserId) {
|
boolean showNextSecurityScreenOrFinish(boolean authenticated, int targetUserId,
|
||||||
|
SecurityMode expectedSecurityMode) {
|
||||||
if (DEBUG) Log.d(TAG, "showNextSecurityScreenOrFinish(" + authenticated + ")");
|
if (DEBUG) Log.d(TAG, "showNextSecurityScreenOrFinish(" + authenticated + ")");
|
||||||
|
if (expectedSecurityMode != SecurityMode.Invalid
|
||||||
|
&& expectedSecurityMode != getCurrentSecurityMode()) {
|
||||||
|
Log.w(TAG, "Attempted to invoke showNextSecurityScreenOrFinish with securityMode "
|
||||||
|
+ expectedSecurityMode + ", but current mode is " + getCurrentSecurityMode());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
boolean finish = false;
|
boolean finish = false;
|
||||||
boolean strongAuth = false;
|
boolean strongAuth = false;
|
||||||
int eventSubtype = -1;
|
int eventSubtype = -1;
|
||||||
@@ -603,8 +614,13 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
|
|||||||
mUpdateMonitor.cancelFaceAuth();
|
mUpdateMonitor.cancelFaceAuth();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismiss(boolean authenticated, int targetId) {
|
/**
|
||||||
mSecurityCallback.dismiss(authenticated, targetId);
|
* Potentially dismiss the current security screen, after validating that all device
|
||||||
|
* security has been unlocked. Otherwise show the next screen.
|
||||||
|
*/
|
||||||
|
public void dismiss(boolean authenticated, int targetId,
|
||||||
|
SecurityMode expectedSecurityMode) {
|
||||||
|
mSecurityCallback.dismiss(authenticated, targetId, expectedSecurityMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVerifyUnlockOnly() {
|
public boolean isVerifyUnlockOnly() {
|
||||||
@@ -654,7 +670,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
|
|||||||
@Override
|
@Override
|
||||||
public boolean isVerifyUnlockOnly() { return false; }
|
public boolean isVerifyUnlockOnly() { return false; }
|
||||||
@Override
|
@Override
|
||||||
public void dismiss(boolean securityVerified, int targetUserId) { }
|
public void dismiss(boolean securityVerified, int targetUserId,
|
||||||
|
SecurityMode expectedSecurityMode) { }
|
||||||
@Override
|
@Override
|
||||||
public void onUserInput() { }
|
public void onUserInput() { }
|
||||||
@Override
|
@Override
|
||||||
@@ -706,8 +723,9 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
|
|||||||
return mCurrentSecuritySelection;
|
return mCurrentSecuritySelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismiss(boolean authenticated, int targetUserId) {
|
public void dismiss(boolean authenticated, int targetUserId,
|
||||||
mCallback.dismiss(authenticated, targetUserId);
|
SecurityMode expectedSecurityMode) {
|
||||||
|
mCallback.dismiss(authenticated, targetUserId, expectedSecurityMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean needsInput() {
|
public boolean needsInput() {
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import com.android.internal.telephony.ITelephony;
|
|||||||
import com.android.internal.telephony.IccCardConstants;
|
import com.android.internal.telephony.IccCardConstants;
|
||||||
import com.android.internal.telephony.IccCardConstants.State;
|
import com.android.internal.telephony.IccCardConstants.State;
|
||||||
import com.android.internal.telephony.PhoneConstants;
|
import com.android.internal.telephony.PhoneConstants;
|
||||||
|
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -343,7 +344,8 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
|
|||||||
mRemainingAttempts = -1;
|
mRemainingAttempts = -1;
|
||||||
mShowDefaultMessage = true;
|
mShowDefaultMessage = true;
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser());
|
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser(),
|
||||||
|
SecurityMode.SimPin);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mShowDefaultMessage = false;
|
mShowDefaultMessage = false;
|
||||||
@@ -391,5 +393,10 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
|
|||||||
return getContext().getString(
|
return getContext().getString(
|
||||||
com.android.internal.R.string.keyguard_accessibility_sim_pin_unlock);
|
com.android.internal.R.string.keyguard_accessibility_sim_pin_unlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SecurityMode getSecurityMode() {
|
||||||
|
return SecurityMode.SimPin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import com.android.internal.telephony.ITelephony;
|
|||||||
import com.android.internal.telephony.IccCardConstants;
|
import com.android.internal.telephony.IccCardConstants;
|
||||||
import com.android.internal.telephony.IccCardConstants.State;
|
import com.android.internal.telephony.IccCardConstants.State;
|
||||||
import com.android.internal.telephony.PhoneConstants;
|
import com.android.internal.telephony.PhoneConstants;
|
||||||
|
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +80,8 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
|
|||||||
// mCallback can be null if onSimStateChanged callback is called when keyguard
|
// mCallback can be null if onSimStateChanged callback is called when keyguard
|
||||||
// isn't active.
|
// isn't active.
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser());
|
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser(),
|
||||||
|
SecurityMode.SimPuk);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -414,7 +416,8 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
|
|||||||
mRemainingAttempts = -1;
|
mRemainingAttempts = -1;
|
||||||
mShowDefaultMessage = true;
|
mShowDefaultMessage = true;
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser());
|
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser(),
|
||||||
|
SecurityMode.SimPuk);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mShowDefaultMessage = false;
|
mShowDefaultMessage = false;
|
||||||
@@ -469,6 +472,11 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
|
|||||||
return getContext().getString(
|
return getContext().getString(
|
||||||
com.android.internal.R.string.keyguard_accessibility_sim_puk_unlock);
|
com.android.internal.R.string.keyguard_accessibility_sim_puk_unlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SecurityMode getSecurityMode() {
|
||||||
|
return SecurityMode.SimPuk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user