Set screenlock setting interactively
Asked Answered
B

3

7

I want to set the screenlock mode to None in KitKat so I can run CTS.

I'm using the DragonBoard APQ8074 for development from Intrinsyc, and they just released their BSP for Android KitKat 4.4.2. Trouble is, it's unstable and the Security menu in Settings crashes. So I can't use adb shell to input keyevents 19, 20, 21, 22, 23 to navigate.

adb shell settings command seems like it should work for this, but it's not. I tried these commands against 4.2, 4.3 and 4.4, and they seem to assign the values, but they don't visually result in any changes.

shell@msm8974:/ $ settings get system lockscreen_disabled 
null
shell@msm8974:/ $ settings put system lockscreen_disabled true
shell@msm8974:/ $ settings get system lockscreen_disabled 
true

shell@msm8974:/ $ settings get system screen_brightness
102
shell@msm8974:/ $ settings put system screen_brightness 255
shell@msm8974:/ $ settings get system screen_brightness 
255

Now I dunno if lockscreen_disabled is what I want, here, but Settings.java doesn't seem to provide a call to any sort of unlock_mode, so I dunno what else to do. I don't want to write an app to do this, I just want to set screen lock mode to None so I can run CTS. If I need to modify source, then make & flash a new image, I'm willing to do that, but I don't know what to modify. Thanks for any guidance.

Busch answered 24/4, 2014 at 18:48 Comment(0)
B
10

Got it figured out.

1. Update settings.db using adb shell

shell@msm8974:/ $ su
shell@msm8974:/ # sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite3> update secure set value=1 where name='lockscreen.disabled';
sqlite3> .quit

2. Move or delete locksettings files

shell@msm8974:/ # mkdir /data/system/lock
shell@msm8974:/ # mv /data/system/locksettings* lock

adb reboot and good to go.

Busch answered 25/4, 2014 at 0:33 Comment(0)
Y
3

If there is no sqlite installed on the device use the following

1. Set Settings

adb shell settings put secure lockscreen.disabled 1

2. reboot to recovery

adb reboot recovery

3. remove locksettings db files

adb shell rm /data/system/locksettings.db
adb shell rm /data/system/locksettings.db-shm
adb shell rm /data/system/locksettings.db-wal
Yacano answered 29/8, 2016 at 17:18 Comment(1)
This is also generally just a nicer solution even if you do have sqlite because it lets the system handle everything. Also, if you are rooted you don't have to reboot to recoveryBehrens
C
0

You should use lockscreen.disabled as the variable name in the setting command, and secure as the name space:

shell@msm8974:/ $ settings put secure lockscreen.disabled 1
Capitalistic answered 21/7, 2015 at 2:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.