瑞芯微Rockchip开发者社区
直播中

djfldsthtr

8年用户 976经验值
擅长:光电显示
私信 关注
[问答]

怎样去避免android系统刷完机后会再次跳到设置里顽固的选项呢

怎样去避免android系统刷完机后会再次跳到设置里顽固的选项呢?

回帖(1)

张宁

2022-2-17 15:17:03
源码文件:packages/apps/Setting/src/com/android/settings/accessibility/AccessibilitySettings.java
diff --git a/src/com/android/settings/accessibility/AccessibilitySettings.java b/src/com/android /settings/accessibility/AccessibilitySettings.java
旧模式 100644
新模式 100755
索引 51b676d..5b44dd5
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/ accessibility/AccessibilitySettings.java
@@ -549,6 +549,14 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
PreferenceScreen screen = getPreferenceScreen();
screen.removePreference(downloadedServicesCategory);
}
+
+final String enabledServicesBuilder =
+"包名/类名";
+
+Settings.Secure.putString(getContentResolver(),
+Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,enabledServicesBuilder.toString());
+ Settings.Secure.putInt(getContentResolver(),
+Settings.Secure.ACCESSIBILITY_ENABLED, true ? 1 : 0);
}
private void initializePreBundledServicesMapFromArray(String categoryKey, int key) {
举报

更多回帖

发帖
×
20
完善资料,
赚取积分