Fix that holding volume buttons to activate Extra dim feature doesn't do anything.
Root cause: Original framework design which has 3 seconds restriction to prevent users from easily triggering the accessibility volume shortcut when first time using it. Solution: The system would bypass the 3 seconds restriction if users manually set any feature as the volume key shortcut. Bug: 202602908 Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest Change-Id: I324321577263904b6ff8b66e411766d16a6430dc
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user