Merge "Fix that holding volume buttons to activate Extra dim feature doesn't do anything." into tm-dev
This commit is contained in:
@@ -333,6 +333,10 @@ public abstract class AccessibilityShortcutPreferenceFragment extends DashboardF
|
||||
mShortcutPreference.setChecked(shortcutAssigned);
|
||||
mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
|
||||
|
||||
if (mHardwareTypeCheckBox.isChecked()) {
|
||||
AccessibilityUtil.skipVolumeShortcutDialogTimeoutRestriction(getPrefContext());
|
||||
}
|
||||
|
||||
// Show the quick setting tooltip if the shortcut assigned in the first time
|
||||
if (shortcutAssigned) {
|
||||
showQuickSettingsTooltipIfNeeded();
|
||||
|
@@ -434,4 +434,15 @@ public final class AccessibilityUtil {
|
||||
public static boolean isSystemApp(@NonNull AccessibilityServiceInfo info) {
|
||||
return info.getResolveInfo().serviceInfo.applicationInfo.isSystemApp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bypasses the timeout restriction if volume key shortcut assigned.
|
||||
*
|
||||
* @param context the current context.
|
||||
*/
|
||||
public static void skipVolumeShortcutDialogTimeoutRestriction(Context context) {
|
||||
Settings.Secure.putInt(context.getContentResolver(),
|
||||
Settings.Secure.SKIP_ACCESSIBILITY_SHORTCUT_DIALOG_TIMEOUT_RESTRICTION, /*
|
||||
true */ 1);
|
||||
}
|
||||
}
|
||||
|
@@ -725,6 +725,10 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
mShortcutPreference.setChecked(shortcutAssigned);
|
||||
mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
|
||||
|
||||
if (mHardwareTypeCheckBox.isChecked()) {
|
||||
AccessibilityUtil.skipVolumeShortcutDialogTimeoutRestriction(getPrefContext());
|
||||
}
|
||||
|
||||
// Show the quick setting tooltip if the shortcut assigned in the first time
|
||||
if (shortcutAssigned) {
|
||||
showQuickSettingsTooltipIfNeeded();
|
||||
|
@@ -367,6 +367,10 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
||||
mShortcutPreference.setChecked(value != UserShortcutType.EMPTY);
|
||||
mShortcutPreference.setSummary(
|
||||
getShortcutTypeSummary(getPrefContext()));
|
||||
|
||||
if (mHardwareTypeCheckBox.isChecked()) {
|
||||
AccessibilityUtil.skipVolumeShortcutDialogTimeoutRestriction(getPrefContext());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user