s418358827
2020-11-12 14:47
采纳率: 50%
浏览 273

如何屏蔽android 11的默认锁屏

想屏蔽掉android R的默认keyguard,但是修改了几个地方时候,默认锁屏在唤醒的时候还是会显示,希望大牛帮忙解决,感激不尽

+    <bool name="config_disableLockscreenByDefault">true</bool>

-    <bool name="config_dozeAlwaysOnEnabled">true</bool>
+    <bool name="config_dozeAlwaysOnEnabled">false</bool>

-    <bool name="def_lockscreen_disabled">false</bool>
+    <bool name="def_lockscreen_disabled">true</bool>

--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -244,7 +244,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable {
     /**
      * External apps (like the phone app) can tell us to disable the keygaurd.
      */
-    private boolean mExternallyEnabled = true;
+    private boolean mExternallyEnabled = false;
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • fengzhishang_meteor 2021-02-07 19:38
    已采纳
    或者在系统启动脚本里添加

    setprop ro.lockscreen.disable.default true

    locksettings set-disabled true

    点赞 打赏 评论
  • 猿氏悟语 2020-11-12 23:49

    是不要锁屏么

    点赞 打赏 评论
  • fengzhishang_meteor 2021-02-07 19:36
    adb shell
    su 
    sqlite3 data/system/locksettings.db
    select * from locksettings;
    update locksettings set value=1 where name='lockscreen.disable';
    .quit
    点赞 打赏 评论
  • s418358827 2021-06-28 17:45

    代码里修改这两个设置,已验证:

    <bool name="config_disableLockscreenByDefault">true</bool>

    <bool name="def_lockscreen_disabled">true</bool>

    点赞 打赏 评论

相关推荐 更多相似问题