RK3288[android 7.1]调试笔记 设置默认锁屏方式为None

RK3288[android 7.1]调试笔记 设置默认锁屏方式为None

修改路径为/frameworks/base/packages/SettingsProvider/res/values/defaults.xml 此文件中的def_lockscreen_disabled值由false变为true

wangxd@build-server-100:~/work/dsy/rk3288-Android-7.0/frameworks/base(m_android_7_0)$ git diff packages/SettingsProvider/res/values/defaults.xml
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
old mode 100644
new mode 100755
index f4cefc2..2c088e3
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
     true
@@ -80,7 +80,7 @@
     /system/media/audio/ui/Trusted.ogg
     /system/media/audio/ui/WirelessCharg
 
-    false
+    true
     false
     1
 

实际上系统的默认锁屏方式值的数据库是由frameworks\base\packages\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java创建的

    private void loadSecureSettings(SQLiteDatabase db) {
        SQLiteStatement stmt = null;
。。。。。。。。。。
            if (SystemProperties.getBoolean("ro.lockscreen.disable.default", false) == true) {
                loadSetting(stmt, Settings.System.LOCKSCREEN_DISABLED, "1");
            } else {
                loadBooleanSetting(stmt, Settings.System.LOCKSCREEN_DISABLED,
                        R.bool.def_lockscreen_disabled);//这里就是加载def_lockscreen_disabled这个布偶值,为true就设置默认锁屏方式为None,为false采用Android系统原生的默认锁屏方式是Swipe 滑动方式解锁
            }
。。。。。。。            

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int currentVersion) {
        Log.w(TAG, "Upgrading settings database from version " + oldVersion + " to "
                + currentVersion);
。。。。。。。
 if (upgradeVersion == 75) {
            db.beginTransaction();
            SQLiteStatement stmt = null;
            Cursor c = null;
            try {
                c = db.query(TABLE_SECURE, new String[] {"_id", "value"},
                        "name='lockscreen.disabled'",
                        null, null, null, null);
                // only set default if it has not yet been set
                if (c == null || c.getCount() == 0) {
                    stmt = db.compileStatement("INSERT INTO system(name,value)"
                            + " VALUES(?,?);");
                    loadBooleanSetting(stmt, Settings.System.LOCKSCREEN_DISABLED,
                            R.bool.def_lockscreen_disabled);//这里获取设置锁屏方式的布局
                }
                db.setTransactionSuccessful();
            } finally {
                db.endTransaction();
                if (c != null) c.close();
                if (stmt != null) stmt.close();
            }
            upgradeVersion = 76;
        }

        /************* The following are Jelly Bean changes ************/


你可能感兴趣的:(RK32887.0,调试笔记)