Android 在“中设置屏幕锁定设置”;无”;

Android 在“中设置屏幕锁定设置”;无”;,android,Android,我需要在android系统中将屏幕锁定设置设置为“无”。 我正在部署一个应用程序,它将发送给预配置平板电脑上的用户。 此预配置由平板电脑供应商手动完成。 要预配置的设置是在安装应用程序时将屏幕锁定设置为“无”。我认为这是不可能的,用户必须自己完成 考虑到目前为止我使用的所有应用程序(具有类似的要求),请将我发送到“选择锁定屏幕”屏幕并要求我手动禁用它 我可能错了,tho 试试这个: try{ Class lockPatternUtilsCls = Class.forNam

我需要在android系统中将屏幕锁定设置设置为“无”。 我正在部署一个应用程序,它将发送给预配置平板电脑上的用户。 此预配置由平板电脑供应商手动完成。
要预配置的设置是在安装应用程序时将屏幕锁定设置为“无”。

我认为这是不可能的,用户必须自己完成

考虑到目前为止我使用的所有应用程序(具有类似的要求),请将我发送到“选择锁定屏幕”屏幕并要求我手动禁用它

我可能错了,tho

试试这个:

    try{
        Class lockPatternUtilsCls = Class.forName("com.android.internal.widget.LockPatternUtils");
        Constructor lockPatternUtilsConstructor =
                lockPatternUtilsCls.getConstructor(new Class[]{Context.class});
        Object lockPatternUtils = lockPatternUtilsConstructor.newInstance(getContext());

        Method setLockScreenDisabled = lockPatternUtils.getClass().getMethod("setLockScreenDisabled", boolean.class ,int.class);
        setLockScreenDisabled.invoke(lockPatternUtils, new Object[]{true,0});
    }
    catch(Exception e){
        Log.e(this.toString(),e.toString());
    }
如果要将锁更改为刷卡:

 setLockScreenDisabled.invoke(lockPatternUtils, new Object[]{false,0});
但您需要将应用程序更改为系统uid:

android:sharedUserId="android.uid.system"

你认为当权者是谁