wossoneri
3/20/2019 - 6:44 AM

设置Accessibility权限默认打开

Settings.Secure.putString(
    getContentResolver(),
    Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, 
    getPackageName() + "/" + AccessibilitySampleService.class.getCanonicalName());

Settings.Secure.putString(
    getContentResolver(),
    Settings.Secure.ACCESSIBILITY_ENABLED, ENABLE);

Settings.Secure.putString(
    getContentResolver(),
    ENABLED_NOTIFICATION_LISTENERS, 
    getPackageName() + "/" + MusicStateService.class.getCanonicalName());