Use new setting key to maintain the list of user assigned shortcut targets.
* Framework changes to keep ACCESSIBILITY_BUTTON_TARGET_COMPONENT contains only a single target, use ACCESSIBILITY_BUTTON_TARGETS to maintain the targets list. Bug: 151295675 Test: manual test Change-Id: I2218402fd122acc9a86c64127e9cfcf77a6e241e
This commit is contained in:
@@ -193,7 +193,7 @@ public class AccessibilitySettings extends DashboardFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Observe changes from accessibility selection menu
|
// Observe changes from accessibility selection menu
|
||||||
shortcutFeatureKeys.add(Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT);
|
shortcutFeatureKeys.add(Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
|
||||||
shortcutFeatureKeys.add(Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE);
|
shortcutFeatureKeys.add(Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE);
|
||||||
mSettingsContentObserver = new SettingsContentObserver(mHandler, shortcutFeatureKeys) {
|
mSettingsContentObserver = new SettingsContentObserver(mHandler, shortcutFeatureKeys) {
|
||||||
@Override
|
@Override
|
||||||
|
@@ -342,7 +342,7 @@ final class AccessibilityUtil {
|
|||||||
static String convertKeyFromSettings(@UserShortcutType int shortcutType) {
|
static String convertKeyFromSettings(@UserShortcutType int shortcutType) {
|
||||||
switch (shortcutType) {
|
switch (shortcutType) {
|
||||||
case UserShortcutType.SOFTWARE:
|
case UserShortcutType.SOFTWARE:
|
||||||
return Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT;
|
return Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS;
|
||||||
case UserShortcutType.HARDWARE:
|
case UserShortcutType.HARDWARE:
|
||||||
return Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE;
|
return Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE;
|
||||||
case UserShortcutType.TRIPLETAP:
|
case UserShortcutType.TRIPLETAP:
|
||||||
|
@@ -120,7 +120,7 @@ public final class MagnificationPreferenceFragment extends DashboardFragment {
|
|||||||
final AccessibilityManager am = (AccessibilityManager) context.getSystemService(
|
final AccessibilityManager am = (AccessibilityManager) context.getSystemService(
|
||||||
Context.ACCESSIBILITY_SERVICE);
|
Context.ACCESSIBILITY_SERVICE);
|
||||||
final String assignedId = Settings.Secure.getString(context.getContentResolver(),
|
final String assignedId = Settings.Secure.getString(context.getContentResolver(),
|
||||||
Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT);
|
Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
|
||||||
if (!TextUtils.isEmpty(assignedId) && !MAGNIFICATION_COMPONENT_ID.equals(assignedId)) {
|
if (!TextUtils.isEmpty(assignedId) && !MAGNIFICATION_COMPONENT_ID.equals(assignedId)) {
|
||||||
final ComponentName assignedComponentName = ComponentName.unflattenFromString(
|
final ComponentName assignedComponentName = ComponentName.unflattenFromString(
|
||||||
assignedId);
|
assignedId);
|
||||||
|
@@ -52,7 +52,7 @@ public final class AccessibilityUtilTest {
|
|||||||
private static final ComponentName DUMMY_COMPONENT_NAME2 = new ComponentName(DUMMY_PACKAGE_NAME,
|
private static final ComponentName DUMMY_COMPONENT_NAME2 = new ComponentName(DUMMY_PACKAGE_NAME,
|
||||||
DUMMY_CLASS_NAME2);
|
DUMMY_CLASS_NAME2);
|
||||||
private static final String SOFTWARE_SHORTCUT_KEY =
|
private static final String SOFTWARE_SHORTCUT_KEY =
|
||||||
Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT;
|
Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS;
|
||||||
private static final String HARDWARE_SHORTCUT_KEY =
|
private static final String HARDWARE_SHORTCUT_KEY =
|
||||||
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE;
|
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE;
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ public class ToggleScreenMagnificationPreferenceFragmentTest {
|
|||||||
private static final ComponentName DUMMY_COMPONENT_NAME = new ComponentName(DUMMY_PACKAGE_NAME,
|
private static final ComponentName DUMMY_COMPONENT_NAME = new ComponentName(DUMMY_PACKAGE_NAME,
|
||||||
DUMMY_CLASS_NAME);
|
DUMMY_CLASS_NAME);
|
||||||
private static final String SOFTWARE_SHORTCUT_KEY =
|
private static final String SOFTWARE_SHORTCUT_KEY =
|
||||||
Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT;
|
Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS;
|
||||||
private static final String HARDWARE_SHORTCUT_KEY =
|
private static final String HARDWARE_SHORTCUT_KEY =
|
||||||
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE;
|
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE;
|
||||||
private static final String TRIPLETAP_SHORTCUT_KEY =
|
private static final String TRIPLETAP_SHORTCUT_KEY =
|
||||||
|
Reference in New Issue
Block a user