您现在的位置是:首页 >技术杂谈 >Android 10 设置人脸解锁时,锁屏显示人脸解锁图标网站首页技术杂谈
Android 10 设置人脸解锁时,锁屏显示人脸解锁图标
简介Android 10 设置人脸解锁时,锁屏显示人脸解锁图标
Android 10设置人脸解锁时,锁屏解锁图标不会显示人脸图标,若想显示人脸图标,可参考以下两点进行修改:
1.此处引用人脸图标资源,请参考如下修改:
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index a8c81e8..f72bcd8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
@@ -319,11 +319,15 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
private int getIconForState(int state) {
int iconRes;
switch (state) {
+
+ case STATE_SCANNING_FACE:
+ // Error animation also starts and ands on the padlock.
+ iconRes = R.drawable.ic_face_unlock;
+ break;
case STATE_LOCKED:
// Scanning animation is a pulsing padlock. This means that the resting state is
// just a padlock.
- case STATE_SCANNING_FACE:
- // Error animation also starts and ands on the padlock.
+
case STATE_BIOMETRICS_ERROR:
iconRes = com.android.internal.R.drawable.ic_lock;
break;
2.人脸图标资源可从9.0移植或自行替换,将其放置frameworksasepackagesSystemUI
esdrawable路径下即可。
此方案只有图标,并无类似9.0的图标动画。
风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。