From 4bfcf04ae9228f912ac151009800a9f3cd205550 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 1 Jul 2019 14:39:40 -0700 Subject: [PATCH 1/6] [DO NOT MERGE] Disable swipe down to pull noti shade for Q Bug: 136293958 Change-Id: Iac169d91a784b5f2d05410a06cd358f85b533562 --- .../com/android/launcher3/uioverrides/RecentsUiFactory.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java index 6ecf1c11bd..a3c2e3cc81 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java @@ -164,12 +164,6 @@ public abstract class RecentsUiFactory { } } - if (FeatureFlags.PULL_DOWN_STATUS_BAR && Utilities.IS_DEBUG_DEVICE - && !launcher.getDeviceProfile().isMultiWindowMode - && !launcher.getDeviceProfile().isVerticalBarLayout()) { - list.add(new StatusBarTouchController(launcher)); - } - list.add(new LauncherTaskViewController(launcher)); return list.toArray(new TouchController[list.size()]); } From 826cdcd32fa91afe932c8c07be1a4e92a6f73301 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 2 Jul 2019 14:35:11 -0700 Subject: [PATCH 2/6] Fix bug where icon is no present during app close animation. * WindowTransformSwipeHandler closes all AbstractFloatingViews, including ListenerView, which results in FloatingIconView getting removed. * In IconLoadResult.onIconLoaded, we remove the check for isIconLoaded since its not needed. This was also causing a race condition since isIconLoaded is not set to true until after we tell onIconLoaded to run. * In BaseDragLayer, we have a delay before checking if the view is open and then closing the floating view if true. This caused issues since we reycle the view. Now we check if the view is open before running the delay to call close. Bug: 136044361 Change-Id: I7442a589a62c3cdf90b70d146e0ecf3e4300ddf7 --- .../android/quickstep/WindowTransformSwipeHandler.java | 3 ++- src/com/android/launcher3/views/BaseDragLayer.java | 10 ++++------ src/com/android/launcher3/views/FloatingIconView.java | 10 +++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index f1d1141bcd..ac7ba3fc3d 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -505,7 +505,8 @@ public class WindowTransformSwipeHandler initAnimFactory.run(); } } - AbstractFloatingView.closeAllOpenViews(activity, mWasLauncherAlreadyVisible); + AbstractFloatingView.closeAllOpenViewsExcept(activity, mWasLauncherAlreadyVisible, + AbstractFloatingView.TYPE_LISTENER); if (mWasLauncherAlreadyVisible) { mStateCallback.setState(STATE_LAUNCHER_DRAWN); diff --git a/src/com/android/launcher3/views/BaseDragLayer.java b/src/com/android/launcher3/views/BaseDragLayer.java index 53686cae48..1e70c7f812 100644 --- a/src/com/android/launcher3/views/BaseDragLayer.java +++ b/src/com/android/launcher3/views/BaseDragLayer.java @@ -224,12 +224,10 @@ public abstract class BaseDragLayer if (child instanceof AbstractFloatingView) { // Handles the case where the view is removed without being properly closed. // This can happen if something goes wrong during a state change/transition. - postDelayed(() -> { - AbstractFloatingView floatingView = (AbstractFloatingView) child; - if (floatingView.isOpen()) { - floatingView.close(false); - } - }, SINGLE_FRAME_MS); + AbstractFloatingView floatingView = (AbstractFloatingView) child; + if (floatingView.isOpen()) { + postDelayed(() -> floatingView.close(false), SINGLE_FRAME_MS); + } } } diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index b6c4fedac9..ab4b576bf9 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -574,17 +574,17 @@ public class FloatingIconView extends View implements if (cancellationSignal.isCanceled()) { return; } - if (mIconLoadResult.isIconLoaded) { - setIcon(originalView, mIconLoadResult.drawable, mIconLoadResult.badge, - mIconLoadResult.iconOffset); - } + + setIcon(originalView, mIconLoadResult.drawable, mIconLoadResult.badge, + mIconLoadResult.iconOffset); + // Delay swapping views until the icon is loaded to prevent a flash. setVisibility(VISIBLE); originalView.setVisibility(INVISIBLE); }; + mLoadIconSignal = cancellationSignal; } } - mLoadIconSignal = cancellationSignal; } private void setBackgroundDrawableBounds(float scale) { From ab6be31746aafae1cd75a755eab1592ccef5065a Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Sat, 6 Jul 2019 13:24:59 +0900 Subject: [PATCH 3/6] Fix issue where can't interact with Workspace while App => Home is running => Regression from recent CL ag/8074890 => Fix which scopes the change down to the RecentsView, but not all PagedViews Bug 136733573 Change-Id: I0abaa61b2b132d8086dc3b2cb3e3e9c1f181b5f5 --- .../src/com/android/quickstep/views/RecentsView.java | 5 +++++ src/com/android/launcher3/PagedView.java | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index a98df0fa1f..30a8a3a23f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -472,6 +472,11 @@ public abstract class RecentsView extends PagedView impl } } + @Override + protected boolean shouldBlockGestures(MotionEvent ev) { + return Utilities.shouldDisableGestures(ev); + } + @Override public boolean onTouchEvent(MotionEvent ev) { super.onTouchEvent(ev); diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 2eeb132bbf..f8e4c9dfc7 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -16,7 +16,6 @@ package com.android.launcher3; -import static com.android.launcher3.Utilities.shouldDisableGestures; import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled; import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType; import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS; @@ -847,7 +846,7 @@ public abstract class PagedView extends ViewGrou */ // Skip touch handling if there are no pages to swipe - if (getChildCount() <= 0 || shouldDisableGestures(ev)) return false; + if (getChildCount() <= 0 || shouldBlockGestures(ev)) return false; acquireVelocityTrackerAndAddMovement(ev); @@ -1092,10 +1091,14 @@ public abstract class PagedView extends ViewGrou mAllowOverScroll = enable; } + protected boolean shouldBlockGestures(MotionEvent ev) { + return false; + } + @Override public boolean onTouchEvent(MotionEvent ev) { // Skip touch handling if there are no pages to swipe - if (getChildCount() <= 0 || shouldDisableGestures(ev)) return false; + if (getChildCount() <= 0 || shouldBlockGestures(ev)) return false; acquireVelocityTrackerAndAddMovement(ev); From 98de773474fd0622d1c95f436e4553daca51f589 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 8 Jul 2019 20:30:53 +0000 Subject: [PATCH 4/6] Revert "Trigger heap dump when heap exceeds a limit" This reverts commit e069291ecdbcaa1fdd4fa7201f97992cfe3bc6e8. Reason for revert: Blocked on FW change Change-Id: Iabf6dee687e499544be5bf895563e57157b0f9e1 --- .../quickstep/QuickstepProcessInitializer.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java b/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java index 7bfa9a0f99..befeee0db9 100644 --- a/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java +++ b/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java @@ -15,7 +15,6 @@ */ package com.android.quickstep; -import android.app.ActivityManager; import android.content.Context; import android.content.pm.PackageManager; import android.os.UserManager; @@ -23,29 +22,17 @@ import android.util.Log; import com.android.launcher3.BuildConfig; import com.android.launcher3.MainProcessInitializer; -import com.android.launcher3.Utilities; import com.android.systemui.shared.system.ThreadedRendererCompat; @SuppressWarnings("unused") public class QuickstepProcessInitializer extends MainProcessInitializer { private static final String TAG = "QuickstepProcessInitializer"; - private static final int HEAP_LIMIT_MB = 250; public QuickstepProcessInitializer(Context context) { } @Override protected void init(Context context) { - if (Utilities.IS_DEBUG_DEVICE) { - try { - // Trigger a heap dump if the PSS reaches beyond the target heap limit - final ActivityManager am = context.getSystemService(ActivityManager.class); - am.setWatchHeapLimit(HEAP_LIMIT_MB * 1024 * 1024); - } catch (SecurityException e) { - // Do nothing - } - } - // Workaround for b/120550382, an external app can cause the launcher process to start for // a work profile user which we do not support. Disable the application immediately when we // detect this to be the case. From 4abfbd067073cc24622c80a3e3519cca37e8f206 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 9 Jul 2019 10:35:27 -0700 Subject: [PATCH 5/6] Reset the UI_STATE_OVERVIEW statusbar/navbar flag when RecentsView resets Bug: 135383592 TL;DR;; this reset is called when for instance OMS call happens Change-Id: I57bb6c1c8833aff00e3be572dd19744afbb81eb5 --- .../src/com/android/quickstep/views/RecentsView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index a8987a3d42..c465798fc5 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -784,6 +784,7 @@ public abstract class RecentsView extends PagedView impl unloadVisibleTaskData(); setCurrentPage(0); mDwbToastShown = false; + mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, 0); } public @Nullable TaskView getRunningTaskView() { From 940b0ac0157945a40d8b3b44d976da53aaeff81f Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 9 Jul 2019 11:33:50 -0700 Subject: [PATCH 6/6] Copy resume callbacks list prior to making callbacks - Starting a deferred activity can trigger a new callback to be added to the list while we are iterating it Bug: 136613192 Change-Id: I6690ab0695bb73f11bf343fb41e9fc86b4afec1b --- src/com/android/launcher3/Launcher.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d9af4da8e8..bc3aa7ef40 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -952,10 +952,14 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, mHandler.removeCallbacks(mHandleDeferredResume); Utilities.postAsyncCallback(mHandler, mHandleDeferredResume); - for (OnResumeCallback cb : mOnResumeCallbacks) { - cb.onLauncherResume(); + if (!mOnResumeCallbacks.isEmpty()) { + final ArrayList resumeCallbacks = new ArrayList<>(mOnResumeCallbacks); + mOnResumeCallbacks.clear(); + for (int i = resumeCallbacks.size() - 1; i >= 0; i--) { + resumeCallbacks.get(i).onLauncherResume(); + } + resumeCallbacks.clear(); } - mOnResumeCallbacks.clear(); if (mLauncherCallbacks != null) { mLauncherCallbacks.onResume();