From 81ff81227e26d08779f176ed40fc2bed1cb9a912 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Mon, 22 Nov 2021 16:00:09 -0800 Subject: [PATCH 1/3] Add ALLOW_SLIPPERY_TOUCHES to make StatusBarTouchController slippery LauncherActivity uses FLAG_SLIPPERY for certain interactions. For example, when home screen is shown, and the user pulls down from not the top of the screen, and notification shade is getting displayed, then the touch should be getting transferred to the NotificationShade using FLAG_SLIPPERY. The newly introduced permission is added to launcher in order for this flag to be applied to the window. Bug: 206188649 Bug: 157929241 Test: reviewed logs, ensure that NexusLauncherActivity has FLAG_SLIPPERY Test: re-ran the performance regression test Change-Id: I8d05fa3663687b5382a59b0d47cdac404844c3b7 --- quickstep/AndroidManifest.xml | 1 + .../StatusBarTouchController.java | 21 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/quickstep/AndroidManifest.xml b/quickstep/AndroidManifest.xml index b43d8d1a4b..f82080feea 100644 --- a/quickstep/AndroidManifest.xml +++ b/quickstep/AndroidManifest.xml @@ -40,6 +40,7 @@ + diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java index fe69c9b87d..1bc789bd6e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java @@ -19,6 +19,7 @@ import static android.view.MotionEvent.ACTION_CANCEL; import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_MOVE; import static android.view.MotionEvent.ACTION_UP; +import static android.view.WindowManager.LayoutParams.FLAG_SLIPPERY; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN; @@ -47,17 +48,6 @@ public class StatusBarTouchController implements TouchController { private static final String TAG = "StatusBarController"; - /** - * Window flag: Enable touches to slide out of a window into neighboring - * windows in mid-gesture instead of being captured for the duration of - * the gesture. - * - * This flag changes the behavior of touch focus for this window only. - * Touches can slide out of the window but they cannot necessarily slide - * back in (unless the other window with touch focus permits it). - */ - private static final int FLAG_SLIPPERY = 0x20000000; - private final Launcher mLauncher; private final SystemUiProxy mSystemUiProxy; private final float mTouchSlop; @@ -140,6 +130,15 @@ public class StatusBarTouchController implements TouchController { return true; } + /** + * FLAG_SLIPPERY enables touches to slide out of a window into neighboring + * windows in mid-gesture instead of being captured for the duration of + * the gesture. + * + * This flag changes the behavior of touch focus for this window only. + * Touches can slide out of the window but they cannot necessarily slide + * back in (unless the other window with touch focus permits it). + */ private void setWindowSlippery(boolean enable) { Window w = mLauncher.getWindow(); WindowManager.LayoutParams wlp = w.getAttributes(); From 506c4df440cbcb5ce360c76dce8dc228d9fbc0ab Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 22 Dec 2021 07:50:59 +0000 Subject: [PATCH 2/3] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I03c58e596fae530790fcdd93319ae1b0dbc7ad78 --- quickstep/res/values-nl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml index 5e4c374f91..a7084fb097 100644 --- a/quickstep/res/values-nl/strings.xml +++ b/quickstep/res/values-nl/strings.xml @@ -43,7 +43,7 @@ "Sleep apps weg van de onderste rij om app-suggesties te ontvangen" "App-suggesties toegevoegd aan lege ruimte" "App-suggesties staan aan" - "App-suggesties zijn uitgeschakeld" + "App-suggesties staan uit" "Voorspelde app: %1$s" "Swipe helemaal vanaf de rechter- of linkerrand." "Swipe vanaf de rechter- of linkerrand naar het midden van het scherm en laat los." From 84ed7e92b491b64e842861360b85bf1d337989da Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 22 Dec 2021 07:51:33 +0000 Subject: [PATCH 3/3] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I6896c90a1b5e637f20e004866db4407219d4e210 --- quickstep/res/values-nl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml index 5e4c374f91..a7084fb097 100644 --- a/quickstep/res/values-nl/strings.xml +++ b/quickstep/res/values-nl/strings.xml @@ -43,7 +43,7 @@ "Sleep apps weg van de onderste rij om app-suggesties te ontvangen" "App-suggesties toegevoegd aan lege ruimte" "App-suggesties staan aan" - "App-suggesties zijn uitgeschakeld" + "App-suggesties staan uit" "Voorspelde app: %1$s" "Swipe helemaal vanaf de rechter- of linkerrand." "Swipe vanaf de rechter- of linkerrand naar het midden van het scherm en laat los."