android 无障碍服务

android 打开指定app的无障碍服务

1.adb命令打开android.permission.WRITE_SECURE_SETTINGS权限

 adb shell pm grant app包名 android.permission.WRITE_SECURE_SETTINGS                         

2.app启动处添加如下代码

   Settings.Secure.putString(getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
                "app包名/AccessibilityService 全名");
        Settings.Secure.putInt(getContentResolver(),
                Settings.Secure.ACCESSIBILITY_ENABLED, 1);

 

 

 

 

 

你可能感兴趣的:(Android,android)