Merge "Settings Switch animation jank while enabled One-handed mode" into sc-dev am: e796dc88bd

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14947950

Change-Id: Ic86a5baf33d7e029bb837e73a21deb9059b11321
This commit is contained in:
TreeHugger Robot
2021-06-15 01:54:46 +00:00
committed by Automerger Merge Worker

View File

@@ -71,6 +71,7 @@ public class OneHandedController implements RemoteCallable<OneHandedController>
"persist.debug.one_handed_offset_percentage"; "persist.debug.one_handed_offset_percentage";
private static final String ONE_HANDED_MODE_GESTURAL_OVERLAY = private static final String ONE_HANDED_MODE_GESTURAL_OVERLAY =
"com.android.internal.systemui.onehanded.gestural"; "com.android.internal.systemui.onehanded.gestural";
private static final int OVERLAY_ENABLED_DELAY_MS = 250;
static final String SUPPORT_ONE_HANDED_MODE = "ro.support_one_handed_mode"; static final String SUPPORT_ONE_HANDED_MODE = "ro.support_one_handed_mode";
@@ -493,9 +494,11 @@ public class OneHandedController implements RemoteCallable<OneHandedController>
setOneHandedEnabled(enabled); setOneHandedEnabled(enabled);
// Also checks swipe to notification settings since they all need gesture overlay. // Also checks swipe to notification settings since they all need gesture overlay.
setEnabledGesturalOverlay( // Enabled overlay package may affect the current animation(e.g:Settings switch),
// so we delay 250ms to enabled overlay after switch animation finish
mMainExecutor.executeDelayed(() -> setEnabledGesturalOverlay(
enabled || mOneHandedSettingsUtil.getSettingsSwipeToNotificationEnabled( enabled || mOneHandedSettingsUtil.getSettingsSwipeToNotificationEnabled(
mContext.getContentResolver(), mUserId)); mContext.getContentResolver(), mUserId)), OVERLAY_ENABLED_DELAY_MS);
} }
@VisibleForTesting @VisibleForTesting