Set lockscreen to “None” programmatically?

后端 未结 7 508
挽巷
挽巷 2020-12-30 04:12

I have the requirement to disable the lock screen and set the lock screen type to \"None\". My device is rooted (can run with SU permission) + can run as a system applicatio

7条回答
  •  醉酒成梦
    2020-12-30 04:47

    After searching a little bit in the android source i stick now within a function called onPreferenceTreeClick from the class ChooseLockGeneric which seems to be called when the unlock method is chosen (in the preferences).

    In that method updateUnlockMethodAndFinish is called which sets the unlock method. So maybe calling updateUnlockMethodAndFinish(DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED,true); could be exactly what you want.

    I don't know whether this fit your needs and don't know whether this works (maybe there are any visibility problems or security mechanisms). I am just speculating.

    EDIT: This could help also: startFragment(this,"com.android.settings.ChooseLockGeneric$ChooseLockGenericFragment",SET_OR_CHANGE_LOCK_METHOD_REQUEST, null);

提交回复
热议问题