当前位置: 首页 > news >正文

Android14 和android12 在锁屏界面Keyguard输错5次密码后倒计时30秒时重启手机不显示倒计时

参考如下修改:Android9.0在锁屏界面Keyguard输错5次密码后倒计时30秒时重启手机不显示倒计时_android 锁屏密码输错5次-CSDN博客

android 14 修改如下:


androidap/SYSTEM/frameworks/base$ git status
Refresh index: 100% (47218/47218), done.
HEAD detached from e83cd3f473f9modified:   core/java/android/provider/Settings.javamodified:   packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.javamodified:   packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.javaandroidap/SYSTEM/frameworks/base$ git diff
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 6d1594e011dc..7ccaa8cea477 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4641,7 +4641,12 @@ public final class Settings {@Deprecated@Readablepublic static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
-
+        /**
+         * @deprecated Use {@link android.provider.Settings.Secure#COUNT_DOWNTIME_UNLOCK}
+         * @hide
+         */
+        @Readable
+        public static final String COUNT_DOWNTIME_UNLOCK = "count_downtime_unlock";/*** Scaling factor for fonts, float.*/
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index 12fccc59dc90..22b04826bc07 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -26,6 +26,12 @@ import android.os.CountDownTimer;import android.os.SystemClock;import android.util.PluralsMessageFormatter;import android.view.KeyEvent;
+import android.util.Log;
+import android.content.Context;
+import android.content.ContentResolver;
+import android.provider.Settings;
+import android.provider.Settings.Global;
+import android.provider.Settings.System;import com.android.internal.util.LatencyTracker;import com.android.internal.widget.LockPatternChecker;
@@ -54,7 +60,8 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeyprotected AsyncTask<?, ?, ?> mPendingLockCheck;protected boolean mResumed;protected boolean mLockedOut;
-
+    static final String LOG_TAG = "KeyguardAbsKeyInputViewController";
+    Context mContext;private final KeyDownListener mKeyDownListener = (keyCode, keyEvent) -> {// Fingerprint sensor sends a KeyEvent.KEYCODE_UNKNOWN.// We don't want to consider it valid user input because the UI
@@ -88,6 +95,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeymLatencyTracker = latencyTracker;mFalsingCollector = falsingCollector;mEmergencyButtonController = emergencyButtonController;
+        mContext=getContext();}abstract void resetState();
@@ -111,6 +119,26 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeymDismissing = false;mView.resetPasswordText(false /* animate */, false /* announce */);resetState();
+        long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+                KeyguardUpdateMonitor.getCurrentUser());
+
+
+        long deadline_new = SystemClock.elapsedRealtime();
+        long timeuses =0;
+
+
+        timeuses=(long) Math.abs(deadline - deadline_new);
+        Log.d(LOG_TAG, "== reset  deadline - deadline_new =" + timeuses);
+        if(timeuses > 30000){
+            if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.COUNT_DOWNTIME_UNLOCK, 0) == 1 && mCountdownTimer == null) {
+                long mDeadline = mLockPatternUtils.setLockoutAttemptDeadline(
+                        KeyguardUpdateMonitor.getCurrentUser(), 30000);
+
+            }
+        }else{
+
+            Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);
+        }}@Override
@@ -156,6 +184,11 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeyarguments,R.string.kg_too_many_failed_attempts_countdown),/* animate= */ false);
+                Log.d(LOG_TAG, "== handleAttemptLockout  secondsRemaining = "+secondsRemaining);
+                if(secondsRemaining == 30){
+                    Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,1);
+
+                }}@Override
@@ -163,6 +196,9 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeymMessageAreaController.setMessage("");mLockedOut = false;resetState();
+
+                Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);
+}}.start();}
@@ -281,8 +317,33 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey// if the user is currently locked out, enforce it.long deadline = mLockPatternUtils.getLockoutAttemptDeadline(KeyguardUpdateMonitor.getCurrentUser());
+
+
+        long deadline_new = SystemClock.elapsedRealtime();
+        long timeuses =0;
+
+
+        timeuses=(long) Math.abs(deadline - deadline_new);
+        Log.d(LOG_TAG, "== onResume  deadline - deadline_new =" + timeuses);
+
+
+        if(timeuses > 30000) {
+            if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.COUNT_DOWNTIME_UNLOCK, 0) == 1 && mCountdownTimer == null) {
+                long mDeadline = mLockPatternUtils.setLockoutAttemptDeadline(
+                        KeyguardUpdateMonitor.getCurrentUser(), 30000);
+
+            }
+        }
+        deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+                KeyguardUpdateMonitor.getCurrentUser());
+
+if (shouldLockout(deadline)) {
+handleAttemptLockout(deadline);
+        }else{
+
+            Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);}}diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
index 2239556e4fd3..b3ba37cb70d3 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
@@ -27,6 +27,13 @@ import android.util.PluralsMessageFormatter;import android.view.MotionEvent;import android.view.View;+import android.util.Log;
+import android.content.Context;
+import android.content.ContentResolver;
+import android.provider.Settings;
+import android.provider.Settings.Global;
+import android.provider.Settings.System;
+import com.android.internal.util.LatencyTracker;import com.android.internal.widget.LockPatternChecker;import com.android.internal.widget.LockPatternUtils;
@@ -66,6 +73,9 @@ public class KeyguardPatternViewControllerprivate CountDownTimer mCountdownTimer;private AsyncTask<?, ?, ?> mPendingLockCheck;+    static final String LOG_TAG = "KeyguardPatternViewController";
+    Context mContext;
+private EmergencyButtonCallback mEmergencyButtonCallback = new EmergencyButtonCallback() {@Overridepublic void onEmergencyButtonClickedWhenInCall() {
@@ -208,8 +218,10 @@ public class KeyguardPatternViewControllermEmergencyButtonController = emergencyButtonController;mLockPatternView = mView.findViewById(R.id.lockPatternView);mPostureController = postureController;
+        mContext=getContext();}+@Overridepublic void onInit() {super.onInit();
@@ -263,6 +275,26 @@ public class KeyguardPatternViewControllermLockPatternView.clearPattern();displayDefaultSecurityMessage();
+        long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+                KeyguardUpdateMonitor.getCurrentUser());
+
+
+        long deadline_new = SystemClock.elapsedRealtime();
+        long timeuses =0;
+
+
+        timeuses=(long) Math.abs(deadline - deadline_new);
+        Log.d(LOG_TAG, "== reset  deadline - deadline_new =" + timeuses);
+        if(timeuses > 30000){
+            if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.COUNT_DOWNTIME_UNLOCK, 0) == 1 && mCountdownTimer == null) {
+                long mDeadline = mLockPatternUtils.setLockoutAttemptDeadline(
+                        KeyguardUpdateMonitor.getCurrentUser(), 30000);
+
+            }
+        }else{
+
+            Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);
+        }}@Override
@@ -271,8 +303,34 @@ public class KeyguardPatternViewController// if the user is currently locked out, enforce it.long deadline = mLockPatternUtils.getLockoutAttemptDeadline(KeyguardUpdateMonitor.getCurrentUser());
+
+
+        long deadline_new = SystemClock.elapsedRealtime();
+        long timeuses =0;
+
+
+        timeuses=(long) Math.abs(deadline - deadline_new);
+        Log.d(LOG_TAG, "== onResume  deadline - deadline_new =" + timeuses);
+
+
+        if(timeuses > 30000) {
+            if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.COUNT_DOWNTIME_UNLOCK, 0) == 1 && mCountdownTimer == null) {
+                long mDeadline = mLockPatternUtils.setLockoutAttemptDeadline(
+                        KeyguardUpdateMonitor.getCurrentUser(), 30000);
+
+            }
+        }
+
+        deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+                KeyguardUpdateMonitor.getCurrentUser());
+
+if (deadline != 0) {
+handleAttemptLockout(deadline);
+        }else{
+
+            Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);}}@@ -384,12 +442,19 @@ public class KeyguardPatternViewControllerR.string.kg_too_many_failed_attempts_countdown),/* animate= */ false);
+                Log.d(LOG_TAG, "== handleAttemptLockout  secondsRemaining = "+secondsRemaining);
+                if(secondsRemaining == 30){
+                    Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,1);
+
+                }}@Overridepublic void onFinish() {mLockPatternView.setEnabled(true);displayDefaultSecurityMessage();
+                Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);
+}}.start();

android12 修改如下:

androidap/QSSI12/frameworks/base$ git status
Refresh index: 100% (40261/40261), done.
HEAD detached at d7cf647c5f4dmodified:   core/java/android/provider/Settings.javamodified:   packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.javamodified:   packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.javaandroidap/QSSI12/frameworks/base$ git diff
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index e7a8e8a1a80c..44d56b41f745 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4250,7 +4250,12 @@ public final class Settings {@Deprecated@Readablepublic static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
-
+        /**
+         * @deprecated Use {@link android.provider.Settings.Secure#COUNT_DOWNTIME_UNLOCK}
+         * @hide
+         */
+        @Readable
+        public static final String COUNT_DOWNTIME_UNLOCK = "count_downtime_unlock";/*** Scaling factor for fonts, float.*/diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index eb5e39e769fc..6614290b4418 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -26,6 +26,13 @@ import android.os.AsyncTask;import android.os.CountDownTimer;import android.os.SystemClock;import android.view.KeyEvent;
+import android.util.Log;
+
+import android.content.Context;
+import android.content.ContentResolver;
+import android.provider.Settings;
+import android.provider.Settings.Global;
+import android.provider.Settings.System;import com.android.internal.util.LatencyTracker;import com.android.internal.widget.LockPatternChecker;
@@ -50,7 +57,8 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeyprivate boolean mDismissing;protected AsyncTask<?, ?, ?> mPendingLockCheck;protected boolean mResumed;
-
+    static final String LOG_TAG = "KeyguardAbsKeyInputViewController";
+    Context mContext;private final KeyDownListener mKeyDownListener = (keyCode, keyEvent) -> {// Fingerprint sensor sends a KeyEvent.KEYCODE_UNKNOWN.// We don't want to consider it valid user input because the UI
@@ -84,6 +92,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeymEmergencyButtonController = emergencyButtonController;KeyguardMessageArea kma = KeyguardMessageArea.findSecurityMessageDisplay(mView);mMessageAreaController = messageAreaControllerFactory.create(kma);
+        mContext=getContext();}abstract void resetState();
@@ -91,6 +100,8 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey@Overridepublic void onInit() {super.onInit();mMessageAreaController.init();}@@ -107,13 +118,43 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey// start freshmDismissing = false;mView.resetPasswordText(false /* animate */, false /* announce */);// if the user is currently locked out, enforce it.long deadline = mLockPatternUtils.getLockoutAttemptDeadline(KeyguardUpdateMonitor.getCurrentUser());
+
+        Log.d(LOG_TAG, "== reset deadline =" + deadline);
+        long deadline_new = SystemClock.elapsedRealtime();
+        long timeuses =0;
+
+        Log.d(LOG_TAG, "== reset deadline_new =" + deadline_new);
+        timeuses=(long) Math.abs(deadline - deadline_new);
+        Log.d(LOG_TAG, "== reset  deadline - deadline_new =" + timeuses);
+
+        Log.d(LOG_TAG, "== reset() COUNT_DOWNTIME_UNLOCK ="+Settings.System.getInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0));
+        if(timeuses > 30000) {
+            if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.COUNT_DOWNTIME_UNLOCK, 0) == 1 && mCountdownTimer == null) {
+                long mDeadline = mLockPatternUtils.setLockoutAttemptDeadline(
+                        KeyguardUpdateMonitor.getCurrentUser(), 30000);
+                Log.d(LOG_TAG, "== reset(inside)  handleAttemptLockout(mDeadline)" + mDeadline);
+            }
+        }
+        deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+                KeyguardUpdateMonitor.getCurrentUser());
+
+if (shouldLockout(deadline)) {
+
+            Log.d(LOG_TAG, "== reset deadline shouldLockout(deadline)=" + deadline );
+handleAttemptLockout(deadline);} else {resetState();
+            Log.d(LOG_TAG, "== reset() else resetState() COUNT_DOWNTIME_UNLOCK ="+Settings.System.getInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0));
+
+            Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);}}@@ -146,8 +187,16 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeyprotected void handleAttemptLockout(long elapsedRealtimeDeadline) {mView.setPasswordEntryEnabled(false);long elapsedRealtime = SystemClock.elapsedRealtime();
-        long secondsInFuture = (long) Math.ceil(
-                (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0);
+        long secondsInFuture =0;
+        long timeuses =0;
+        Log.d(LOG_TAG, "== handleAttemptLockout elapsedRealtimeDeadline =" + elapsedRealtimeDeadline);
+        Log.d(LOG_TAG, "== handleAttemptLockout elapsedRealtime =" + elapsedRealtime);
+        timeuses=(long) Math.abs(elapsedRealtimeDeadline - elapsedRealtime);
+        Log.d(LOG_TAG, "== handleAttemptLockout elapsedRealtimeDeadline - elapsedRealtime =" + timeuses);
+        secondsInFuture = (long) Math.ceil(
+                    (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0);
+
+mCountdownTimer = new CountDownTimer(secondsInFuture * 1000, 1000) {@Override
@@ -156,12 +205,19 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeymMessageAreaController.setMessage(mView.getResources().getQuantityString(R.plurals.kg_too_many_failed_attempts_countdown,secondsRemaining, secondsRemaining));
-            }+                Log.d(LOG_TAG, "== handleAttemptLockout  secondsRemaining = "+secondsRemaining);
+                if(secondsRemaining == 30){
+                    Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,1);
+
+                  }
+            }@Overridepublic void onFinish() {mMessageAreaController.setMessage("");resetState();
+                Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);
+}}.start();}
@@ -182,6 +238,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeyif (timeoutMs > 0) {long deadline = mLockPatternUtils.setLockoutAttemptDeadline(userId, timeoutMs);
+handleAttemptLockout(deadline);}}
@@ -286,6 +343,8 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeymPendingLockCheck.cancel(false);mPendingLockCheck = null;}
-        reset();
+        if (Settings.System.getInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0) == 0 && mCountdownTimer == null ) {
+            reset();
+        }}}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
index 60d56503f73b..99ba0e56fe58 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
@@ -25,6 +25,13 @@ import android.os.CountDownTimer;import android.os.SystemClock;import android.view.MotionEvent;import android.view.View;
+import android.util.Log;
+
+import android.content.Context;
+import android.content.ContentResolver;
+import android.provider.Settings;
+import android.provider.Settings.Global;
+import android.provider.Settings.System;import com.android.internal.util.LatencyTracker;import com.android.internal.widget.LockPatternChecker;
@@ -65,7 +72,8 @@ public class KeyguardPatternViewControllerprivate LockPatternView mLockPatternView;private CountDownTimer mCountdownTimer;private AsyncTask<?, ?, ?> mPendingLockCheck;
-
+    static final String LOG_TAG = "KeyguardPatternViewController";
+    Context mContext;private EmergencyButtonCallback mEmergencyButtonCallback = new EmergencyButtonCallback() {@Overridepublic void onEmergencyButtonClickedWhenInCall() {
@@ -178,6 +186,7 @@ public class KeyguardPatternViewControllerif (timeoutMs > 0) {long deadline = mLockPatternUtils.setLockoutAttemptDeadline(userId, timeoutMs);
+handleAttemptLockout(deadline);}}
@@ -210,6 +219,7 @@ public class KeyguardPatternViewControllermMessageAreaController = mMessageAreaControllerFactory.create(kma);mLockPatternView = mView.findViewById(R.id.lockPatternView);mPostureController = postureController;
+        mContext=getContext();}@Override
@@ -270,10 +280,36 @@ public class KeyguardPatternViewController// if the user is currently locked out, enforce it.long deadline = mLockPatternUtils.getLockoutAttemptDeadline(KeyguardUpdateMonitor.getCurrentUser());
+
+        Log.d(LOG_TAG, "== reset deadline =" + deadline);
+        long deadline_new = SystemClock.elapsedRealtime();
+        long timeuses =0;
+
+        Log.d(LOG_TAG, "== reset deadline_new =" + deadline_new);
+        timeuses=(long) Math.abs(deadline - deadline_new);
+        Log.d(LOG_TAG, "== reset  deadline - deadline_new =" + timeuses);
+
+        Log.d(LOG_TAG, "== reset() COUNT_DOWNTIME_UNLOCK ="+Settings.System.getInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0));
+        if(timeuses > 30000) {
+            if (Settings.System.getInt(mContext.getContentResolver(), Settings.System.COUNT_DOWNTIME_UNLOCK, 0) == 1 && mCountdownTimer == null) {
+                long mDeadline = mLockPatternUtils.setLockoutAttemptDeadline(
+                        KeyguardUpdateMonitor.getCurrentUser(), 30000);
+                Log.d(LOG_TAG, "== reset(inside)  handleAttemptLockout(mDeadline)" + mDeadline);
+            }
+        }
+        deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+                KeyguardUpdateMonitor.getCurrentUser());
+if (deadline != 0) {
+
+            Log.d(LOG_TAG, "== reset deadline =" + deadline);
+handleAttemptLockout(deadline);} else {displayDefaultSecurityMessage();
+            Log.d(LOG_TAG, "== reset() else resetState() COUNT_DOWNTIME_UNLOCK ="+Settings.System.getInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0));
+
+            Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);}}@@ -301,6 +337,9 @@ public class KeyguardPatternViewControllermPendingLockCheck = null;}displayDefaultSecurityMessage();
+        if (Settings.System.getInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0) == 0 && mCountdownTimer == null ) {
+            reset();
+        }}@Override
@@ -362,8 +401,24 @@ public class KeyguardPatternViewControllermLockPatternView.clearPattern();mLockPatternView.setEnabled(false);final long elapsedRealtime = SystemClock.elapsedRealtime();
-        final long secondsInFuture = (long) Math.ceil(
-                (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0);
+   /*     final long secondsInFuture = (long) Math.ceil(
+                (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0);*/
+        long secondsInFuture =0;
+        long timeuses =0;
+        Log.d(LOG_TAG, "== handleAttemptLockout elapsedRealtimeDeadline =" + elapsedRealtimeDeadline);
+        Log.d(LOG_TAG, "== handleAttemptLockout elapsedRealtime =" + elapsedRealtime);
+        timeuses=(long) Math.abs(elapsedRealtimeDeadline - elapsedRealtime);
+        Log.d(LOG_TAG, "== handleAttemptLockout elapsedRealtimeDeadline - elapsedRealtime =" + timeuses);
+
+        if (timeuses > 30000){
+            secondsInFuture =(long) Math.ceil((30000.0) / 1000.0);
+
+        }else {
+            secondsInFuture = (long) Math.ceil(
+                    (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0);
+
+        }
+mCountdownTimer = new CountDownTimer(secondsInFuture * 1000, 1000) {@Override
@@ -372,12 +427,18 @@ public class KeyguardPatternViewControllermMessageAreaController.setMessage(mView.getResources().getQuantityString(R.plurals.kg_too_many_failed_attempts_countdown,secondsRemaining, secondsRemaining));
+                Log.d(LOG_TAG, "== handleAttemptLockout  secondsRemaining = "+secondsRemaining);
+                if(secondsRemaining == 30){
+                    Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,1);
+
+                }}@Overridepublic void onFinish() {mLockPatternView.setEnabled(true);displayDefaultSecurityMessage();
+                Settings.System.putInt(mContext.getContentResolver(),Settings.System.COUNT_DOWNTIME_UNLOCK,0);}}.start();

相关文章:

Android14 和android12 在锁屏界面Keyguard输错5次密码后倒计时30秒时重启手机不显示倒计时

参考如下修改&#xff1a;Android9.0在锁屏界面Keyguard输错5次密码后倒计时30秒时重启手机不显示倒计时_android 锁屏密码输错5次-CSDN博客 android 14 修改如下&#xff1a; androidap/SYSTEM/frameworks/base$ git status Refresh index: 100% (47218/47218), done. HEAD d…...

智能时代摩托车一键启动无钥匙进入感受科技前线

向智能化与高性能迈进,技术创新与绿色转型引领摩托车行业智能化出行。 摩托车一键启动无钥匙进入功能是一种先进的车辆控制系统&#xff0c;它允许驾驶员在不使用传统机械钥匙的情况下&#xff0c;通过智能感应技术自动解锁和启动摩托车。这种系统通常包括一个智能钥匙&#x…...

需要补充的技能

密码管理 文件管理 人际管理 Microsoft365 teams和onedrive,outlook,sharepoint等 被问到自己不懂的问题的时候怎么迅速反应快速回答&#xff1f; 被帅锅的时候怎么解决&#xff1f; 谈判技巧&#xff1f; 说话的语速&#xff1f; 遇到解决不了的问题如何处理&#xff1f; 考…...

15分钟学 Go 第 15 天:映射(Map)

第15天&#xff1a;映射&#xff08;Map&#xff09; 学习目标 在本节中&#xff0c;我们将深入理解Go语言中的字典类型&#xff08;映射&#xff09;&#xff0c;通过例子与图示来帮助你掌握其使用方法。我们将涵盖以下几个方面&#xff1a; 概念定义创建和使用映射访问和更…...

element-plus 官方表格排序问题

element-plus 官方API 默认表格排序存在问题&#xff0c;一个list 被多组排序 修改后&#xff1a; 注意点&#xff1a; 这里一定要使用 sortable"custom"&#xff0c;自定义 sort-change 方法 使用 sortable true 的情况排序会冲突&#xff0c;出现莫名奇妙的问题…...

AI语音模型在家宽业务中的应用

在运营商家宽业务支撑场景中&#xff0c;存在多个APP和系统需要与装维人员交互&#xff0c;传统的功能按钮点击型操作交互界面&#xff0c;越来越难以满足装维人员工作提效的迫切需求。家宽施工调度系统所需的AI语音能力主要包括ASR&#xff08;音转字&#xff09;和TTS&#x…...

零七生活API-文字转语音API使用示例

//官网地址&#xff1a;零七生活API - 提供免费接口调用平台function getAud(){axios({method: get,url: https://api.oick.cn/api/txt?text你好&spd5&apikeyyourApikey,responseType: blob, // 确保 axios 处理为二进制数据}).then((response) > {// 将 Blob 转换…...

rpc的客户端为什么称为stub

1.client为什么是stub Stub 在分布式系统中是一种 代理对象&#xff08;Proxy Object&#xff09;&#xff0c;它本质上是一个在本地系统中扮演远程服务角色的代理。 在早期的 RPC 术语中&#xff0c;客户端端叫做 Stub&#xff0c;而服务器端的处理部分叫做 Skeleton。这种对…...

RHCE--nginx实现多IP访问多网站

方法一&#xff1a;nmtui 1.目录挂载 2.下载nginx 3.关闭防火墙 4.在一个网卡创建多个虚拟地址 1. 2. 3. 方法二&#xff1a;nmcil 1.手动配置 2.如图所示重新连接后创建ip成功 3.创建目录以及写入 结果...

TikTok运营对IP有什么要求?

TikTok在进行直播带货时&#xff0c;网络环境的配置尤为关键&#xff0c;网络质量直接影响到直播效果&#xff0c;因此选择稳定的IP地址很重要。那么&#xff0c;TikTok直播时该选择什么样的IP地址呢&#xff1f;接下来&#xff0c;我们来深入分析一下。 TikTok对IP地址的要求 …...

大白话讲解:多模态大模型综述,通俗易懂!

多模态大型语言模型&#xff08;Multimodal Large Language Models&#xff0c; MLLM&#xff09;的出现是建立在大型语言模型&#xff08;Large Language Models&#xff0c; LLM&#xff09;和大型视觉模型&#xff08;Large Vision Models&#xff0c; LVM&#xff09;领域不…...

大数据-184 Elasticsearch - 原理剖析 - DocValues 机制原理 压缩与禁用

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; 目前已经更新到了&#xff1a; Hadoop&#xff08;已更完&#xff09;HDFS&#xff08;已更完&#xff09;MapReduce&#xff08;已更完&am…...

Java设计模式:工厂模式详解

引言 1. 工厂模式的定义 2. 工厂模式的类型 2.1 简单工厂模式 2.1.1 结构 2.1.2 示例代码 2.2 工厂方法模式 2.2.1 结构 2.2.2 示例代码 2.3 抽象工厂模式 2.3.1 结构 2.3.2 示例代码 3. 工厂模式的优点 4. 工厂模式的缺点 5. 实际应用场景 6. 总结 引言 工厂模…...

《Python游戏编程入门》注-第3章1

《Python游戏编程入门》的第三章是“I/O、数据和字体&#xff1a;Trivia游戏”&#xff0c;介绍了print()函数、input()函数、异常处理以及文件的输入输出&#xff0c;最后根据以上内容完成了Trivia游戏。 本章的“3.1 了解Trivia游戏”介绍了Trivia游戏的界面和玩法。“3.2 P…...

Java爬虫:获取数据的入门详解

在数字化时代&#xff0c;数据已成为最宝贵的资产之一。无论是市场研究、客户洞察还是产品开发&#xff0c;获取大量数据并从中提取有价值的信息变得至关重要。Java&#xff0c;作为一种成熟且功能强大的编程语言&#xff0c;为编写爬虫提供了强大的支持。Java爬虫可以帮助我们…...

GAMES104:17 游戏引擎的玩法系统:高级AI-学习笔记

文章目录 课前QA一&#xff0c;层次任务网络&#xff08;Hierarchical Tasks Network&#xff0c;HTN&#xff09;1.1 HTN Framework1.2 HTN Task Types1.2.1 Primitive Task基本任务1.2.2 Compound Task符合任务 1.3 Planning1.4 Replan1.5 总结 二&#xff0c;目标导向行为规…...

【Unity】Unity中获取网络时间进行每日和每月刷新

直接上代码 using System; using System.Collections; using System.Collections.Generic; using UnityEngine;public class DateChecker : MonoBehaviour {private DateTime lastCheckedDate; //上次刷新日数据的日期private DateTime lastMonthUtc; //上次刷新月数据的日期T…...

微信小程序上传组件封装uploadHelper2.0使用整理

一、uploadHelper2.0使用步骤说明 uploadHelper.js ---上传代码封装库 cos-wx-sdk-v5.min.js---腾讯云&#xff0c;对象存储封装库 第一步&#xff0c;下载组件代码&#xff0c;放置到自己的小程序项目中 第二步、 创建上传对象&#xff0c;执行选择图片/视频 var _this th…...

力扣每日打卡挑战 3184. 构成整天的下标对数目 I

给你一个整数数组 hours&#xff0c;表示以 小时 为单位的时间&#xff0c;返回一个整数&#xff0c;表示满足 i < j 且 hours[i] hours[j] 构成 整天 的下标对 i, j 的数目。 整天 定义为时间持续时间是 24 小时的 整数倍 。 例如&#xff0c;1 天是 24 小时&#xff0c…...

The First:Starknet如何让以太坊更快更安全?

随着区块链技术需求的持续增长&#xff0c;当前技术在可扩展性和隐私保护方面的局限性愈发凸显&#xff0c;以太坊网络便是其中的典型代表。为有效应对这些挑战&#xff0c;第二层扩展解决方案的重要性日益凸显。这些方案旨在将部分交易处理转移至以太坊主链之外&#xff0c;以…...

(二)TensorRT-LLM | 模型导出(v0.20.0rc3)

0. 概述 上一节 对安装和使用有个基本介绍。根据这个 issue 的描述&#xff0c;后续 TensorRT-LLM 团队可能更专注于更新和维护 pytorch backend。但 tensorrt backend 作为先前一直开发的工作&#xff0c;其中包含了大量可以学习的地方。本文主要看看它导出模型的部分&#x…...

关于nvm与node.js

1 安装nvm 安装过程中手动修改 nvm的安装路径&#xff0c; 以及修改 通过nvm安装node后正在使用的node的存放目录【这句话可能难以理解&#xff0c;但接着往下看你就了然了】 2 修改nvm中settings.txt文件配置 nvm安装成功后&#xff0c;通常在该文件中会出现以下配置&…...

理解 MCP 工作流:使用 Ollama 和 LangChain 构建本地 MCP 客户端

&#x1f31f; 什么是 MCP&#xff1f; 模型控制协议 (MCP) 是一种创新的协议&#xff0c;旨在无缝连接 AI 模型与应用程序。 MCP 是一个开源协议&#xff0c;它标准化了我们的 LLM 应用程序连接所需工具和数据源并与之协作的方式。 可以把它想象成你的 AI 模型 和想要使用它…...

从深圳崛起的“机器之眼”:赴港乐动机器人的万亿赛道赶考路

进入2025年以来&#xff0c;尽管围绕人形机器人、具身智能等机器人赛道的质疑声不断&#xff0c;但全球市场热度依然高涨&#xff0c;入局者持续增加。 以国内市场为例&#xff0c;天眼查专业版数据显示&#xff0c;截至5月底&#xff0c;我国现存在业、存续状态的机器人相关企…...

STM32标准库-DMA直接存储器存取

文章目录 一、DMA1.1简介1.2存储器映像1.3DMA框图1.4DMA基本结构1.5DMA请求1.6数据宽度与对齐1.7数据转运DMA1.8ADC扫描模式DMA 二、数据转运DMA2.1接线图2.2代码2.3相关API 一、DMA 1.1简介 DMA&#xff08;Direct Memory Access&#xff09;直接存储器存取 DMA可以提供外设…...

将对透视变换后的图像使用Otsu进行阈值化,来分离黑色和白色像素。这句话中的Otsu是什么意思?

Otsu 是一种自动阈值化方法&#xff0c;用于将图像分割为前景和背景。它通过最小化图像的类内方差或等价地最大化类间方差来选择最佳阈值。这种方法特别适用于图像的二值化处理&#xff0c;能够自动确定一个阈值&#xff0c;将图像中的像素分为黑色和白色两类。 Otsu 方法的原…...

Neo4j 集群管理:原理、技术与最佳实践深度解析

Neo4j 的集群技术是其企业级高可用性、可扩展性和容错能力的核心。通过深入分析官方文档,本文将系统阐述其集群管理的核心原理、关键技术、实用技巧和行业最佳实践。 Neo4j 的 Causal Clustering 架构提供了一个强大而灵活的基石,用于构建高可用、可扩展且一致的图数据库服务…...

从零实现STL哈希容器:unordered_map/unordered_set封装详解

本篇文章是对C学习的STL哈希容器自主实现部分的学习分享 希望也能为你带来些帮助~ 那咱们废话不多说&#xff0c;直接开始吧&#xff01; 一、源码结构分析 1. SGISTL30实现剖析 // hash_set核心结构 template <class Value, class HashFcn, ...> class hash_set {ty…...

Caliper 配置文件解析:config.yaml

Caliper 是一个区块链性能基准测试工具,用于评估不同区块链平台的性能。下面我将详细解释你提供的 fisco-bcos.json 文件结构,并说明它与 config.yaml 文件的关系。 fisco-bcos.json 文件解析 这个文件是针对 FISCO-BCOS 区块链网络的 Caliper 配置文件,主要包含以下几个部…...

ios苹果系统,js 滑动屏幕、锚定无效

现象&#xff1a;window.addEventListener监听touch无效&#xff0c;划不动屏幕&#xff0c;但是代码逻辑都有执行到。 scrollIntoView也无效。 原因&#xff1a;这是因为 iOS 的触摸事件处理机制和 touch-action: none 的设置有关。ios有太多得交互动作&#xff0c;从而会影响…...