Disable Screen Lock(Power) Button in Android

后端 未结 2 1578
悲哀的现实
悲哀的现实 2020-12-31 23:33

I want that when my application is running the power button (which upon pressing locks the screen & screen goes BLACK), should be disabled. So that the user cannot lock

2条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 23:45

    I have reached this using root access.

    sqlite3 /data/data/com.android.providers.settings/databases/settings.db
    insert into secure (name, value) values ('lockscreen.disabled', 1);
    

    or depending on version

    sqlite3 /data/system/locksettings.db
    insert into locksettings (name, value) values ('lockscreen.disabled', 1);
    

提交回复
热议问题