Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set screenlock setting interactively

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.

like image 708
Jacob Stevens Avatar asked Apr 24 '14 18:04

Jacob Stevens


2 Answers

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.

like image 154
Jacob Stevens Avatar answered Nov 06 '22 07:11

Jacob Stevens


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
like image 39
Sebo Avatar answered Nov 06 '22 07:11

Sebo