frameworks/base/services/core/java/com/android/server/locksettings/LockSettingsService.java
@@ -164,7 +164,7 @@ import javax.crypto.spec.GCMParameterSpec;
public class LockSettingsService extends ILockSettings.Stub {
private static final String TAG = "LockSettingsService";
private static final String PERMISSION = ACCESS_KEYGUARD_SECURE_STORAGE;
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = true;
private static final int PROFILE_KEY_IV_SIZE = 12;
private static final String SEPARATE_PROFILE_CHALLENGE_KEY = "lockscreen.profilechallenge";
@GuardedBy("mSpManager")
private void spBasedSetLockCredentialInternalLocked(byte[] credential, int credentialType,
byte[] savedCredential, int requestedQuality, int userId,
boolean allowUntrustedChange, boolean isLockTiedToParent) throws RemoteException {
...
VerifyCredentialResponse response = authResult.gkResponse;
AuthenticationToken auth = authResult.authToken;
+ if (auth == null) {
+ Slog.w(TAG, "initializeSyntheticPasswordLocked");
+ auth = initializeSyntheticPasswordLocked(null, credential, credentialType, requestedQuality, userId);
+ }
+
...
}
// 清除锁屏密码设置
import com.android.internal.widget.LockPatternUtils;
+ try {
+ boolean isLockScreen = getLockPatternUtils().isSecure(UserHandle.USER_SYSTEM); //判断是否设置锁屏
+ if (isLockScreen) {
+ return getLockPatternUtils().clearLock(null, UserHandle.USER_SYSTEM, true);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ public LockPatternUtils getLockPatternUtils() {
+ if (mLockPatternUtils == null) {
+ mLockPatternUtils = new LockPatternUtils(mContext);
+ }
+ return mLockPatternUtils;
+ }
android 10 系统源码 清除锁屏密码,必须进入系统桌面
最新推荐文章于 2024-08-12 03:59:30 发布