如何通过修改secure settings 汉化.db/secure启动某个accessibility 服务

涓婁紶鍙戝竷
禄 AccessibilitySettings.java
AccessibilitySettings.java ( 鏂囦欢娴忚? )
* Copyright (C) 2009 The Android Open Source Project
* Licensed under the Apache License, Version 2.0 (the &License&);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an &AS IS& BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
package com.android.settings.
import android.accessibilityservice.AccessibilityServiceI
import android.app.ActivityManagerN
import android.app.AlertD
import android.app.D
import android.content.ActivityNotFoundE
import ponentN
import android.content.C
import android.content.DialogI
import android.content.I
import android.content.SharedP
import android.content.pm.ResolveI
import android.content.pm.ServiceI
import android.content.res.C
import android.net.U
import android.os.B
import android.os.H
import android.os.RemoteE
import android.os.SystemP
import android.preference.CheckBoxP
import android.preference.ListP
import android.preference.P
import android.preference.PreferenceC
import android.preference.PreferenceS
import android.provider.S
import android.text.TextU
import android.text.TextUtils.SimpleStringS
import android.util.L
import android.view.KeyCharacterM
import android.view.KeyE
import android.view.V
import android.view.accessibility.AccessibilityM
import android.widget.TextV
import com.android.internal.content.PackageM
import com.android.internal.view.RotationP
import com.android.internal.view.RotationPolicy.RotationPolicyL
import com.android.settings.DialogC
import com.android.settings.R;
import com.android.settings.SettingsPreferenceF
import com.android.settings.U
import java.util.HashM
import java.util.HashS
import java.util.L
import java.util.M
import java.util.S
* Activity with the accessibility settings.
public class AccessibilitySettings extends SettingsPreferenceFragment implements DialogCreatable,
Preference.OnPreferenceChangeListener {
private static final String LOG_TAG = &AccessibilitySettings&;
private static final String DEFAULT_SCREENREADER_MARKET_LINK =
&market://search?q=pname:com.google.android.marvin.talkback&;
private static final float LARGE_FONT_SCALE = 1.3f;
private static final String SYSTEM_PROPERTY_MARKET_URL = &ro.screenreader.market&;
static final char ENABLED_ACCESSIBILITY_SERVICES_SEPARATOR = ':';
private static final String KEY_INSTALL_ACCESSIBILITY_SERVICE_OFFERED_ONCE =
&key_install_accessibility_service_offered_once&;
// Preference categories
private static final String SERVICES_CATEGORY = &services_category&;
private static final String SYSTEM_CATEGORY = &system_category&;
// Preferences
private static final String TOGGLE_LARGE_TEXT_PREFERENCE =
&toggle_large_text_preference&;
private static final String TOGGLE_POWER_BUTTON_ENDS_CALL_PREFERENCE =
&toggle_power_button_ends_call_preference&;
private static final String TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE =
&toggle_lock_screen_rotation_preference&;
private static final String TOGGLE_SPEAK_PASSWORD_PREFERENCE =
&toggle_speak_password_preference&;
private static final String SELECT_LONG_PRESS_TIMEOUT_PREFERENCE =
&select_long_press_timeout_preference&;
private static final String ENABLE_ACCESSIBILITY_GESTURE_PREFERENCE_SCREEN =
&enable_global_gesture_preference_screen&;
private static final String CAPTIONING_PREFERENCE_SCREEN =
&captioning_preference_screen&;
private static final String DISPLAY_MAGNIFICATION_PREFERENCE_SCREEN =
&screen_magnification_preference_screen&;
// Extras passed to sub-fragments.
static final String EXTRA_PREFERENCE_KEY = &preference_key&;
static final String EXTRA_CHECKED = &checked&;
static final String EXTRA_TITLE = &title&;
static final String EXTRA_SUMMARY = &summary&;
static final String EXTRA_SETTINGS_TITLE = &settings_title&;
static final String EXTRA_COMPONENT_NAME = &component_name&;
static final String EXTRA_SETTINGS_COMPONENT_NAME = &settings_component_name&;
// Timeout before we update the services if packages are added/removed
// since the AccessibilityManagerService has to do that processing first
// to generate the AccessibilityServiceInfo we need for proper
// presentation.
private static final long DELAY_UPDATE_SERVICES_MILLIS = 1000;
// Dialog IDs.
private static final int DIALOG_ID_NO_ACCESSIBILITY_SERVICES = 1;
// Auxiliary members.
final static SimpleStringSplitter sStringColonSplitter =
new SimpleStringSplitter(ENABLED_ACCESSIBILITY_SERVICES_SEPARATOR);
static final Set&ComponentName& sInstalledServices = new HashSet&ComponentName&();
private final Map&String, String& mLongPressTimeoutValuetoTitleMap =
new HashMap&String, String&();
private final Configuration mCurConfig = new Configuration();
private final Handler mHandler = new Handler();
private final Runnable mUpdateRunnable = new Runnable() {
public void run() {
loadInstalledServices();
updateServicesPreferences();
private final PackageMonitor mSettingsPackageMonitor = new PackageMonitor() {
public void onPackageAdded(String packageName, int uid) {
sendUpdate();
public void onPackageAppeared(String packageName, int reason) {
sendUpdate();
public void onPackageDisappeared(String packageName, int reason) {
sendUpdate();
public void onPackageRemoved(String packageName, int uid) {
sendUpdate();
private void sendUpdate() {
mHandler.postDelayed(mUpdateRunnable, DELAY_UPDATE_SERVICES_MILLIS);
private final SettingsContentObserver mSettingsContentObserver =
new SettingsContentObserver(mHandler) {
public void onChange(boolean selfChange, Uri uri) {
loadInstalledServices();
updateServicesPreferences();
private final RotationPolicyListener mRotationPolicyListener = new RotationPolicyListener() {
public void onChange() {
updateLockScreenRotationCheckbox();
// Preference controls.
private PreferenceCategory mServicesC
private PreferenceCategory mSystemsC
private CheckBoxPreference mToggleLargeTextP
private CheckBoxPreference mTogglePowerButtonEndsCallP
private CheckBoxPreference mToggleLockScreenRotationP
private CheckBoxPreference mToggleSpeakPasswordP
private ListPreference mSelectLongPressTimeoutP
private Preference mNoServicesMessageP
private PreferenceScreen mCaptioningPreferenceS
private PreferenceScreen mDisplayMagnificationPreferenceS
private PreferenceScreen mGlobalGesturePreferenceS
private int mLongPressTimeoutD
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.accessibility_settings);
initializeAllPreferences();
public void onResume() {
super.onResume();
loadInstalledServices();
updateAllPreferences();
offerInstallAccessibilitySerivceOnce();
mSettingsPackageMonitor.register(getActivity(), getActivity().getMainLooper(), false);
mSettingsContentObserver.register(getContentResolver());
if (RotationPolicy.isRotationSupported(getActivity())) {
RotationPolicy.registerRotationPolicyListener(getActivity(),
mRotationPolicyListener);
public void onPause() {
mSettingsPackageMonitor.unregister();
mSettingsContentObserver.unregister(getContentResolver());
if (RotationPolicy.isRotationSupported(getActivity())) {
RotationPolicy.unregisterRotationPolicyListener(getActivity(),
mRotationPolicyListener);
super.onPause();
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference == mSelectLongPressTimeoutPreference) {
String stringValue = (String) newV
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.LONG_PRESS_TIMEOUT, Integer.parseInt(stringValue));
mSelectLongPressTimeoutPreference.setSummary(
mLongPressTimeoutValuetoTitleMap.get(stringValue));
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (mToggleLargeTextPreference == preference) {
handleToggleLargeTextPreferenceClick();
} else if (mTogglePowerButtonEndsCallPreference == preference) {
handleTogglePowerButtonEndsCallPreferenceClick();
} else if (mToggleLockScreenRotationPreference == preference) {
handleLockScreenRotationPreferenceClick();
} else if (mToggleSpeakPasswordPreference == preference) {
handleToggleSpeakPasswordPreferenceClick();
} else if (mGl
锛堟枃浠惰秴闀匡紝鏈?畬鍏ㄦ樉绀猴紝璇蜂笅杞藉悗闃呰?鍓╀綑閮ㄥ垎锛}

我要回帖

更多关于 secure settings1.3.5 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信