Merge "Fix OHM H/W key shortcut dosn't work appropriately" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ae942fcf7d
@@ -169,9 +169,22 @@ public final class OneHandedSettingsUtil {
|
|||||||
* @return true if user enabled one-handed shortcut in settings, false otherwise.
|
* @return true if user enabled one-handed shortcut in settings, false otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean getShortcutEnabled(ContentResolver resolver, int userId) {
|
public boolean getShortcutEnabled(ContentResolver resolver, int userId) {
|
||||||
final String targets = Settings.Secure.getStringForUser(resolver,
|
// Checks SOFTWARE_SHORTCUT_KEY
|
||||||
|
final String targetsSwKey = Settings.Secure.getStringForUser(resolver,
|
||||||
Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS, userId);
|
Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS, userId);
|
||||||
return TextUtils.isEmpty(targets) ? false : targets.contains(ONE_HANDED_MODE_TARGET_NAME);
|
if (!TextUtils.isEmpty(targetsSwKey) && targetsSwKey.contains(
|
||||||
|
ONE_HANDED_MODE_TARGET_NAME)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks HARDWARE_SHORTCUT_KEY
|
||||||
|
final String targetsHwKey = Settings.Secure.getStringForUser(resolver,
|
||||||
|
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, userId);
|
||||||
|
if (!TextUtils.isEmpty(targetsHwKey) && targetsHwKey.contains(
|
||||||
|
ONE_HANDED_MODE_TARGET_NAME)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user