From ff39fd3e14329db22ef34da32b9116fbe39af6f1 Mon Sep 17 00:00:00 2001 From: vadimt Date: Thu, 22 Oct 2020 11:14:10 -0700 Subject: [PATCH 01/13] Removing workaround for battery defender The bug is supposed to be fixed. Bug: 151613234 Change-Id: I8e803ead29e08e68fa75f61b5ad0e1198c9228ec --- .../launcher3/ui/AbstractLauncherUiTest.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index e118481570..d3fc89e6be 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -234,25 +234,11 @@ public abstract class AbstractLauncherUiTest { return mDevice; } - private boolean hasSystemUiObject(String resId) { - return mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, resId)); - } - @Before public void setUp() throws Exception { - Log.d(TAG, "Before disabling battery defender"); - mDevice.executeShellCommand("setprop vendor.battery.defender.disable 1"); - Log.d(TAG, "Before enabling stay awake"); - mDevice.executeShellCommand("settings put global stay_on_while_plugged_in 3"); - for (int i = 0; i < 10 && hasSystemUiObject("keyguard_status_view"); ++i) { - Log.d(TAG, "Before unlocking the phone"); - mDevice.executeShellCommand("input keyevent 82"); - mDevice.waitForIdle(); - } - Assert.assertTrue("Keyguard still visible", + Assert.assertTrue("Keyguard is visible", mDevice.wait( Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000)); - Log.d(TAG, "Keyguard is not visible"); final String launcherPackageName = mDevice.getLauncherPackageName(); try { From 54aae4f95d59025433c6dd4f92edabafc5cdb7f0 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 26 Oct 2020 16:00:49 -0700 Subject: [PATCH 02/13] Finishing recents task before starting share screenshot flow Bug: 170338559 Change-Id: Ieccdc492c7d1a60b47b90c6683e60e8a143ca80d --- .../android/quickstep/TaskOverlayFactory.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java index 3a47024592..6677724982 100644 --- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java +++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java @@ -31,6 +31,7 @@ import android.os.Build; import android.view.View; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import com.android.launcher3.BaseActivity; @@ -157,9 +158,8 @@ public class TaskOverlayFactory implements ResourceBasedOverride { getActionsView().setCallbacks(new OverlayUICallbacks() { @Override public void onShare() { - endLiveTileMode(isAllowedByPolicy); if (isAllowedByPolicy) { - mImageApi.startShareActivity(); + endLiveTileMode(mImageApi::startShareActivity); } else { showBlockedByPolicyMessage(); } @@ -168,8 +168,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride { @SuppressLint("NewApi") @Override public void onScreenshot() { - endLiveTileMode(isAllowedByPolicy); - saveScreenshot(task); + endLiveTileMode(() -> saveScreenshot(task)); } }); } @@ -178,17 +177,15 @@ public class TaskOverlayFactory implements ResourceBasedOverride { /** * End rendering live tile in Overview. * - * @param showScreenshot if it's true, we take a screenshot and switch to it. + * @param callback callback to run, after switching to screenshot */ - public void endLiveTileMode(boolean showScreenshot) { + public void endLiveTileMode(@NonNull Runnable callback) { if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView(); - if (showScreenshot) { - recentsView.switchToScreenshot( - () -> recentsView.finishRecentsAnimation(true /* toRecents */, null)); - } else { - recentsView.finishRecentsAnimation(true /* toRecents */, null); - } + recentsView.switchToScreenshot( + () -> recentsView.finishRecentsAnimation(true /* toRecents */, callback)); + } else { + callback.run(); } } From 4a97458253e958b2e4488610be81cb45a1369d9e Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Mon, 26 Oct 2020 17:00:36 -0700 Subject: [PATCH 03/13] Changes COMPILE_SDK to S. Change-Id: I5d4d84027904a7d7861e897ace1f7ce9fc04f4a4 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 7a51375653..7f4c60911e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,4 @@ PROTOBUF_CLASS_PATH=com.google.protobuf:protobuf-gradle-plugin:0.8.8 PROTOBUF_DEPENDENCY=com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7 BUILD_TOOLS_VERSION=28.0.3 -COMPILE_SDK=android-R +COMPILE_SDK=android-S From 9fc27da5f8d7834e8ed35d399406ec36bb05caa1 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Fri, 23 Oct 2020 00:14:56 -0700 Subject: [PATCH 04/13] Settings/Play/Suggest layout polish Bug: 170792963 Bug: 170750779 Change-Id: I69b09f5360e165c3b1b33e259cdd0f390ce6fa60 --- res/layout/search_result_play_item.xml | 9 +++++++-- res/layout/search_result_suggest.xml | 4 ++-- .../android/launcher3/views/SearchSettingsRowView.java | 1 - 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/res/layout/search_result_play_item.xml b/res/layout/search_result_play_item.xml index cdb793c19d..d70c56a1de 100644 --- a/res/layout/search_result_play_item.xml +++ b/res/layout/search_result_play_item.xml @@ -16,7 +16,7 @@ + android:paddingTop="4dp" + android:paddingBottom="4dp" + android:paddingStart="8dp" + android:paddingEnd="8dp"> diff --git a/res/layout/search_result_suggest.xml b/res/layout/search_result_suggest.xml index a3227cb9fa..1d8c8039e6 100644 --- a/res/layout/search_result_suggest.xml +++ b/res/layout/search_result_suggest.xml @@ -21,12 +21,12 @@ android:gravity="start|center_vertical" android:textAlignment="viewStart" android:textColor="?android:attr/textColorPrimary" - android:textSize="16sp" + android:textSize="18sp" android:padding="@dimen/dynamic_grid_edge_margin" launcher:iconDisplay="hero_app" android:drawableTint="?android:attr/textColorPrimary" launcher:customIcon="@drawable/ic_allapps_search" - launcher:iconSizeOverride="24dp" + launcher:iconSizeOverride="48dp" launcher:matchTextInsetWithQuery="true" launcher:layoutHorizontal="true" android:drawablePadding="@dimen/dynamic_grid_icon_drawable_padding" diff --git a/src/com/android/launcher3/views/SearchSettingsRowView.java b/src/com/android/launcher3/views/SearchSettingsRowView.java index 30f686c86e..f0884f88aa 100644 --- a/src/com/android/launcher3/views/SearchSettingsRowView.java +++ b/src/com/android/launcher3/views/SearchSettingsRowView.java @@ -81,7 +81,6 @@ public class SearchSettingsRowView extends LinearLayout implements Bundle bundle = searchTarget.getExtras(); mIntent = bundle.getParcelable("intent"); showIfAvailable(mTitleView, bundle.getString("title")); - showIfAvailable(mDescriptionView, bundle.getString("description")); ArrayList breadcrumbs = bundle.getStringArrayList("breadcrumbs"); //TODO: implement RTL friendly breadcrumbs view showIfAvailable(mBreadcrumbsView, breadcrumbs != null From 55940ecfc70b87ddaf05f0cb181ecf7fc3aa6e8c Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Fri, 23 Oct 2020 22:37:51 -0700 Subject: [PATCH 05/13] Render and track live tile position when launching another app from Overview Fixes: 165394366 Fixes: 170338328 Test: Manual Change-Id: Idfcd423cbe062af33564eaa9e83ec21fbac0cdf9 --- .../android/quickstep/AbsSwipeUpHandler.java | 6 +-- .../com/android/quickstep/TaskViewUtils.java | 7 +++- .../quickstep/util/TaskViewSimulator.java | 31 +++++++-------- .../android/quickstep/views/RecentsView.java | 38 ++++++++++++++----- .../touch/LandscapePagedViewHandler.java | 8 ++-- .../touch/PagedOrientationHandler.java | 4 +- .../touch/PortraitPagedViewHandler.java | 4 +- 7 files changed, 58 insertions(+), 40 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index a1988a17fe..8286d87582 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -41,10 +41,8 @@ import static com.android.quickstep.GestureState.STATE_END_TARGET_ANIMATION_FINI import static com.android.quickstep.GestureState.STATE_END_TARGET_SET; import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHED; import static com.android.quickstep.MultiStateCallback.DEBUG_STATES; -import static com.android.quickstep.TaskUtils.taskIsATargetWithMode; import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -1485,13 +1483,11 @@ public abstract class AbsSwipeUpHandler, Q extends mRecentsAnimationTargets.apps, mRecentsAnimationTargets.apps.length + 1); apps[apps.length - 1] = appearedTaskTarget; - boolean launcherClosing = - taskIsATargetWithMode(apps, mActivity.getTaskId(), MODE_CLOSING); AnimatorSet anim = new AnimatorSet(); TaskViewUtils.composeRecentsLaunchAnimator( anim, taskView, apps, - mRecentsAnimationTargets.wallpapers, launcherClosing, + mRecentsAnimationTargets.wallpapers, true /* launcherClosing */, mActivity.getStateManager(), mRecentsView, mActivityInterface.getDepthController()); anim.addListener(new AnimatorListenerAdapter(){ diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 46c77681ae..ed761cf640 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -297,7 +297,6 @@ public final class TaskViewUtils { PendingAnimation pa = new PendingAnimation(RECENTS_LAUNCH_DURATION); createRecentsWindowAnimator(taskView, skipLauncherChanges, appTargets, wallpaperTargets, depthController, pa); - anim.play(pa.buildAnim()); Animator childStateAnimation = null; // Found a visible recents task that matches the opening app, lets launch the app from there @@ -330,7 +329,11 @@ public final class TaskViewUtils { } }; } - anim.play(launcherAnim); + pa.add(launcherAnim); + if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskIndex() != -1) { + pa.addOnFrameCallback(recentsView::redrawLiveTile); + } + anim.play(pa.buildAnim()); // Set the current animation first, before adding windowAnimEndListener. Setting current // animation adds some listeners which need to be called before windowAnimEndListener diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 08fe48d5ce..61ba411363 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -52,16 +52,16 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { public static final IntProperty SCROLL = new IntProperty("scroll") { - @Override - public void setValue(TaskViewSimulator simulator, int i) { - simulator.setScroll(i); - } + @Override + public void setValue(TaskViewSimulator simulator, int scroll) { + simulator.setScroll(scroll); + } - @Override - public Integer get(TaskViewSimulator simulator) { - return simulator.mScrollState.scroll; - } - }; + @Override + public Integer get(TaskViewSimulator simulator) { + return simulator.mScrollState.scroll; + } + }; private final Rect mTmpCropRect = new Rect(); private final RectF mTempRectF = new RectF(); @@ -72,7 +72,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { private final BaseActivityInterface mSizeStrategy; private final Rect mTaskRect = new Rect(); - private float mOffsetY; private boolean mDrawsBelowRecents; private final PointF mPivot = new PointF(); private DeviceProfile mDp; @@ -89,6 +88,8 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { // TaskView properties private final FullscreenDrawParams mCurrentFullscreenParams; private float mCurveScale = 1; + public final AnimatedFloat taskPrimaryTranslation = new AnimatedFloat(); + public final AnimatedFloat taskSecondaryTranslation = new AnimatedFloat(); // RecentsView properties public final AnimatedFloat recentsViewScale = new AnimatedFloat(); @@ -178,10 +179,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { } } - public void setOffsetY(float offsetY) { - mOffsetY = offsetY; - } - public void setDrawsBelowRecents(boolean drawsBelowRecents) { mDrawsBelowRecents = drawsBelowRecents; } @@ -298,7 +295,11 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { // Apply TaskView matrix: scale, translate, scroll mMatrix.postScale(mCurveScale, mCurveScale, taskWidth / 2, taskHeight / 2); - mMatrix.postTranslate(mTaskRect.left, mTaskRect.top + mOffsetY); + mMatrix.postTranslate(mTaskRect.left, mTaskRect.top); + mOrientationState.getOrientationHandler().set(mMatrix, MATRIX_POST_TRANSLATE, + taskPrimaryTranslation.value); + mOrientationState.getOrientationHandler().setSecondary(mMatrix, MATRIX_POST_TRANSLATE, + taskSecondaryTranslation.value); mOrientationState.getOrientationHandler().set( mMatrix, MATRIX_POST_TRANSLATE, mScrollState.scroll); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 826555c24b..264a182dc2 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -51,6 +51,7 @@ import android.animation.AnimatorSet; import android.animation.LayoutTransition; import android.animation.LayoutTransition.TransitionListener; import android.animation.ObjectAnimator; +import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.annotation.TargetApi; import android.app.ActivityManager.RunningTaskInfo; @@ -99,7 +100,6 @@ import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.PendingAnimation.EndState; -import com.android.launcher3.anim.PropertyListBuilder; import com.android.launcher3.anim.SpringProperty; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; @@ -114,6 +114,7 @@ import com.android.launcher3.util.OverScroller; import com.android.launcher3.util.ResourceBasedOverride.Overrides; import com.android.launcher3.util.Themes; import com.android.launcher3.util.ViewPool; +import com.android.quickstep.AnimatedFloat; import com.android.quickstep.BaseActivityInterface; import com.android.quickstep.GestureState; import com.android.quickstep.RecentsAnimationController; @@ -874,9 +875,10 @@ public abstract class RecentsView extends PagedView // Since we reuse the same mLiveTileTaskViewSimulator in the RecentsView, we need // to reset the params after it settles in Overview from swipe up so that we don't // render with obsolete param values. + mLiveTileTaskViewSimulator.taskPrimaryTranslation.value = 0; + mLiveTileTaskViewSimulator.taskSecondaryTranslation.value = 0; mLiveTileTaskViewSimulator.fullScreenProgress.value = 0; mLiveTileTaskViewSimulator.recentsViewScale.value = 1; - mLiveTileTaskViewSimulator.setOffsetY(0); // Reset the live tile rect DeviceProfile deviceProfile = mActivity.getDeviceProfile(); @@ -1545,7 +1547,10 @@ public abstract class RecentsView extends PagedView if (ENABLE_QUICKSTEP_LIVE_TILE.get() && getRunningTaskView() == taskView) { anim.addOnFrameCallback(() -> { - mLiveTileTaskViewSimulator.setOffsetY(taskView.getTranslationY()); + mLiveTileTaskViewSimulator.taskSecondaryTranslation.value = + mOrientationHandler.getSecondaryValue( + taskView.getTranslationX(), + taskView.getTranslationY()); redrawLiveTile(); }); } @@ -2090,22 +2095,35 @@ public abstract class RecentsView extends PagedView boolean launchingCenterTask = taskIndex == centerTaskIndex; float toScale = getMaxScaleForFullScreen(); + RecentsView recentsView = tv.getRecentsView(); if (launchingCenterTask) { - RecentsView recentsView = tv.getRecentsView(); anim.play(ObjectAnimator.ofFloat(recentsView, RECENTS_SCALE_PROPERTY, toScale)); anim.play(ObjectAnimator.ofFloat(recentsView, FULLSCREEN_PROGRESS, 1)); } else { // We are launching an adjacent task, so parallax the center and other adjacent task. float displacementX = tv.getWidth() * (toScale - tv.getCurveScale()); - anim.play(ObjectAnimator.ofFloat(getPageAt(centerTaskIndex), TRANSLATION_X, - mIsRtl ? -displacementX : displacementX)); + float primaryTranslation = mIsRtl ? -displacementX : displacementX; + anim.play(ObjectAnimator.ofFloat(getPageAt(centerTaskIndex), + mOrientationHandler.getPrimaryViewTranslate(), primaryTranslation)); + int runningTaskIndex = recentsView.getRunningTaskIndex(); + if (ENABLE_QUICKSTEP_LIVE_TILE.get() && runningTaskIndex != -1 + && runningTaskIndex != taskIndex) { + anim.play(ObjectAnimator.ofFloat( + recentsView.getLiveTileTaskViewSimulator().taskPrimaryTranslation, + AnimatedFloat.VALUE, + primaryTranslation)); + } int otherAdjacentTaskIndex = centerTaskIndex + (centerTaskIndex - taskIndex); if (otherAdjacentTaskIndex >= 0 && otherAdjacentTaskIndex < getPageCount()) { - anim.play(new PropertyListBuilder() - .translationX(mIsRtl ? -displacementX : displacementX) - .scale(1) - .build(getPageAt(otherAdjacentTaskIndex))); + PropertyValuesHolder[] properties = new PropertyValuesHolder[3]; + properties[0] = PropertyValuesHolder.ofFloat( + mOrientationHandler.getPrimaryViewTranslate(), primaryTranslation); + properties[1] = PropertyValuesHolder.ofFloat(View.SCALE_X, 1); + properties[2] = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1); + + anim.play(ObjectAnimator.ofPropertyValuesHolder(getPageAt(otherAdjacentTaskIndex), + properties)); } } return anim; diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java index 17f02be5b4..ad6710f8e2 100644 --- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java @@ -42,13 +42,13 @@ import com.android.launcher3.util.OverScroller; public class LandscapePagedViewHandler implements PagedOrientationHandler { @Override - public int getPrimaryValue(int x, int y) { - return y; + public T getPrimaryValue(T x, T y) { + return x; } @Override - public int getSecondaryValue(int x, int y) { - return x; + public T getSecondaryValue(T x, T y) { + return y; } @Override diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java index 114b75acec..a9c50cdffc 100644 --- a/src/com/android/launcher3/touch/PagedOrientationHandler.java +++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java @@ -84,8 +84,8 @@ public interface PagedOrientationHandler { boolean getRecentsRtlSetting(Resources resources); float getDegreesRotated(); int getRotation(); - int getPrimaryValue(int x, int y); - int getSecondaryValue(int x, int y); + T getPrimaryValue(T x, T y); + T getSecondaryValue(T x, T y); void delegateScrollTo(PagedView pagedView, int secondaryScroll, int primaryScroll); /** Uses {@params pagedView}.getScroll[X|Y]() method for the secondary amount*/ void delegateScrollTo(PagedView pagedView, int primaryScroll); diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index 5f5b2d1feb..587e35ad6c 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -40,12 +40,12 @@ import com.android.launcher3.util.OverScroller; public class PortraitPagedViewHandler implements PagedOrientationHandler { @Override - public int getPrimaryValue(int x, int y) { + public T getPrimaryValue(T x, T y) { return x; } @Override - public int getSecondaryValue(int x, int y) { + public T getSecondaryValue(T x, T y) { return y; } From b30adcb2322b82f7009019647967adf487e3ad8d Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Wed, 7 Oct 2020 15:57:44 +0800 Subject: [PATCH 06/13] Use event time of app side for latency metrics There are 2 reasons not to use MotionEvent#getEventTime: 1. There is an existing TouchEventReported metric for touch latency. 2. In instrumentation test, the event time is set when creating the motion event for injection. It may cause the results to be 5 times slower than the real case. That may lead to miss the cost from app to system. Bug: 166614700 Test: Enable statsd log: "adb shell cmd stats print-logs" Touch gesture navigation bar or launch app from launcher. adb logcat | grep statsd | grep "(48)" Change-Id: Ica5e7df685fe737bbc3ac60c3ec35bad15466726 --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 5 ----- quickstep/src/com/android/quickstep/GestureState.java | 11 +++++++++++ .../android/quickstep/RecentsAnimationCallbacks.java | 7 ------- .../com/android/quickstep/TaskAnimationManager.java | 2 +- .../android/quickstep/TouchInteractionService.java | 2 ++ src/com/android/launcher3/Launcher.java | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index cc109f608c..5d227beac0 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1479,11 +1479,6 @@ public abstract class AbsSwipeUpHandler, Q extends mGestureEndCallback = gestureEndCallback; } - @Override - public long getStartTouchTime() { - return mTouchTimeMs; - } - protected void linkRecentsViewScroll() { SurfaceTransactionApplier.create(mRecentsView, applier -> { mTransformParams.setSyncTransactionApplier(applier); diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java index f7889964d7..8d67ee697a 100644 --- a/quickstep/src/com/android/quickstep/GestureState.java +++ b/quickstep/src/com/android/quickstep/GestureState.java @@ -142,6 +142,9 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL private Set mPreviouslyAppearedTaskIds = new HashSet<>(); private int mLastStartedTaskId = -1; + /** The time when the swipe up gesture is triggered. */ + private long mSwipeUpStartTimeMs; + public GestureState(OverviewComponentObserver componentObserver, int gestureId) { mHomeIntent = componentObserver.getHomeIntent(); mOverviewIntent = componentObserver.getOverviewIntent(); @@ -343,6 +346,14 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL mStateCallback.setState(STATE_RECENTS_ANIMATION_ENDED); } + void setSwipeUpStartTimeMs(long uptimeMs) { + mSwipeUpStartTimeMs = uptimeMs; + } + + long getSwipeUpStartTimeMs() { + return mSwipeUpStartTimeMs; + } + public void dump(PrintWriter pw) { pw.println("GestureState:"); pw.println(" gestureID=" + mGestureId); diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java index f319b943c6..a21c7140de 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java @@ -160,12 +160,5 @@ public class RecentsAnimationCallbacks implements * Callback made when a task started from the recents is ready for an app transition. */ default void onTaskAppeared(RemoteAnimationTargetCompat appearedTaskTarget) {} - - /** - * The time in milliseconds of the touch event that starts the recents animation. - */ - default long getStartTouchTime() { - return 0; - } } } diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index 797797f3d4..6f2f86eac2 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -119,7 +119,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } } }); - final long eventTime = listener.getStartTouchTime(); + final long eventTime = gestureState.getSwipeUpStartTimeMs(); mCallbacks.addListener(gestureState); mCallbacks.addListener(listener); UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance() diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index eebb0de660..c95ff02546 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -45,6 +45,7 @@ import android.os.Build; import android.os.Bundle; import android.os.IBinder; import android.os.Looper; +import android.os.SystemClock; import android.util.Log; import android.view.Choreographer; import android.view.InputEvent; @@ -447,6 +448,7 @@ public class TouchInteractionService extends Service implements PluginListener implements Launche mTouchInProgress = true; break; case MotionEvent.ACTION_UP: - mLastTouchUpTime = ev.getEventTime(); + mLastTouchUpTime = SystemClock.uptimeMillis(); // Follow through case MotionEvent.ACTION_CANCEL: mTouchInProgress = false; From a34766a1764c682915961c0b670b02344264fc4d Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 27 Oct 2020 05:14:56 -0700 Subject: [PATCH 07/13] IME bounds after DOWN->UP Motion event sequence Bug: 170739594 Change-Id: I1aa8dd2ced7c017e57d3c14c02d5b78900a46caa --- .../AllAppsInsetTransitionController.java | 157 +++++++++++++----- .../AbstractStateChangeTouchController.java | 2 +- 2 files changed, 121 insertions(+), 38 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsInsetTransitionController.java b/src/com/android/launcher3/allapps/AllAppsInsetTransitionController.java index d7af5f1a7a..08d573f08b 100644 --- a/src/com/android/launcher3/allapps/AllAppsInsetTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsInsetTransitionController.java @@ -29,13 +29,15 @@ import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.core.os.BuildCompat; +import com.android.launcher3.util.UiThreadHelper; + /** * Handles IME over all apps to be synchronously transitioning along with the passed in * root inset. */ public class AllAppsInsetTransitionController { - private static final boolean DEBUG = false; + private static final boolean DEBUG = true; private static final String TAG = "AllAppsInsetTransitionController"; private static final Interpolator LINEAR = new LinearInterpolator(); @@ -53,6 +55,13 @@ public class AllAppsInsetTransitionController { private float mDown, mCurrent; private View mApps; + // Only purpose of these states is to keep track of fast fling transition + enum State { + RESET, DRAG_START_BOTTOM, FLING_END_TOP, + DRAG_START_TOP, FLING_END_BOTTOM + } + private State mState; + public AllAppsInsetTransitionController(float allAppsHeight, View appsView) { mAllAppsHeight = allAppsHeight; mApps = appsView; @@ -64,6 +73,11 @@ public class AllAppsInsetTransitionController { WindowInsets insets = mApps.getRootWindowInsets(); if (insets == null) return; + boolean imeVisible = insets.isVisible(WindowInsets.Type.ime()); + + if (DEBUG) { + Log.d(TAG, "\nhide imeVisible=" + imeVisible); + } if (insets.isVisible(WindowInsets.Type.ime())) { mApps.getWindowInsetsController().hide(WindowInsets.Type.ime()); } @@ -78,20 +92,23 @@ public class AllAppsInsetTransitionController { @RequiresApi(api = Build.VERSION_CODES.R) public void onDragStart(float progress) { if (!BuildCompat.isAtLeastR()) return; - onAnimationEnd(progress); + // Until getRootWindowInsets().isVisible(...) method returns correct value, + // only support InsetController based IME transition during swipe up and + // NOT swipe down + if (Float.compare(progress, 0f) == 0) return; + + setState(true, false, progress); mDown = progress * mAllAppsHeight; // Below two values are sometimes incorrect. Possibly a platform bug - mDownInsetBottom = mApps.getRootWindowInsets().getInsets(WindowInsets.Type.ime()).bottom; - mShownAtDown = mApps.getRootWindowInsets().isVisible(WindowInsets.Type.ime()); + // mDownInsetBottom = mApps.getRootWindowInsets().getInsets(WindowInsets.Type.ime()).bottom; + // mShownAtDown = mApps.getRootWindowInsets().isVisible(WindowInsets.Type.ime()); - // override this value based on what it should actually be. - mShownAtDown = Float.compare(progress, 1f) == 0 ? false : true; - mDownInsetBottom = mShownAtDown ? mShownInsetBottom : mHiddenInsetBottom; if (DEBUG) { - Log.d(TAG, "\nonDragStart mDownInsets=" + mDownInsetBottom - + " mShownAtDown =" + mShownAtDown); + Log.d(TAG, "\nonDragStart progress=" + progress + + " mDownInsets=" + mDownInsetBottom + + " mShownAtDown=" + mShownAtDown); } mApps.getWindowInsetsController().controlWindowInsetsAnimation( @@ -103,36 +120,62 @@ public class AllAppsInsetTransitionController { if (DEBUG) { Log.d(TAG, "Listener.onReady " + (mCurrentRequest == this)); } - if (mCurrentRequest == this) { - mAnimationController = controller; - } else { - controller.finish(mShownAtDown); + if (controller != null) { + if (mCurrentRequest == this && !handleFinishOnFling(controller)) { + mAnimationController = controller; + } else { + controller.finish(false /* just don't show */); + } } } @Override public void onFinished(WindowInsetsAnimationController controller) { // when screen lock happens, then this method get called - mAnimationController.finish(false); - mAnimationController = null; if (DEBUG) { - Log.d(TAG, "Listener.onFinished ctrl=" + controller); + Log.d(TAG, "Listener.onFinished ctrl=" + controller + + " mAnimationController=" + mAnimationController); + } + if (mAnimationController != null) { + mAnimationController.finish(true); + mAnimationController = null; } } @Override public void onCancelled(@Nullable WindowInsetsAnimationController controller) { + if (DEBUG) { + Log.d(TAG, "Listener.onCancelled ctrl=" + controller + + " mAnimationController=" + mAnimationController); + } + if (mState == State.DRAG_START_BOTTOM) { + mApps.getWindowInsetsController().show(WindowInsets.Type.ime()); + } mAnimationController = null; if (controller != null) { - controller.finish(mShownAtDown); - } - if (DEBUG) { - Log.d(TAG, "Listener.onCancelled ctrl=" + controller); + controller.finish(true); } + } }); } + /** + * If IME bounds after touch sequence finishes, call finish. + */ + private boolean handleFinishOnFling(WindowInsetsAnimationController controller) { + if (!BuildCompat.isAtLeastR()) return false; + + if (mState == State.FLING_END_TOP) { + controller.finish(true); + return true; + } else if (mState == State.FLING_END_BOTTOM) { + controller.finish(false); + return true; + } + return false; + } + /** * Handles the translation using the progress. * @@ -153,18 +196,17 @@ public class AllAppsInsetTransitionController { int inset = (int) (mDownInsetBottom + (mDown - mCurrent) - shift); - if (DEBUG) { - Log.d(TAG, "updateInset mCurrent=" + mCurrent + " mDown=" - + mDown + " hidden=" + mHiddenInsetBottom - + " shown=" + mShownInsetBottom - + " mDownInsets.bottom=" + mDownInsetBottom + " inset:" + inset - + " shift: " + shift); - } final int start = mShownAtDown ? mShownInsetBottom : mHiddenInsetBottom; final int end = mShownAtDown ? mHiddenInsetBottom : mShownInsetBottom; inset = Math.max(inset, mHiddenInsetBottom); inset = Math.min(inset, mShownInsetBottom); - Log.d(TAG, "updateInset inset:" + inset); + if (DEBUG || false) { + Log.d(TAG, "updateInset mCurrent=" + mCurrent + " mDown=" + + mDown + " hidden=" + mHiddenInsetBottom + + " shown=" + mShownInsetBottom + + " mDownInsets.bottom=" + mDownInsetBottom + " inset=" + inset + + " shift= " + shift); + } mAnimationController.setInsetsAndAlpha( Insets.of(0, 0, 0, inset), @@ -178,20 +220,61 @@ public class AllAppsInsetTransitionController { */ @RequiresApi(api = 30) public void onAnimationEnd(float progress) { + if (DEBUG) { + Log.d(TAG, "onAnimationEnd progress=" + progress + + " mAnimationController=" + mAnimationController); + } + if (mState == null) { + // only called when launcher restarting. + UiThreadHelper.hideKeyboardAsync(mApps.getContext(), mApps.getWindowToken()); + } + setState(false, true, progress); + if (mAnimationController == null) { + return; + } + + /* handle finish */ + if (mState == State.FLING_END_TOP) { + mAnimationController.finish(true /* show */); + } else { + if (Float.compare(progress, 1f) == 0 /* bottom */) { + mAnimationController.finish(false /* gone */); + } else { + mAnimationController.finish(mShownAtDown); + } + } + /* handle finish */ + if (DEBUG) { Log.d(TAG, "endTranslation progress=" + progress + " mAnimationController=" + mAnimationController); } - - if (mAnimationController == null) return; - - if (Float.compare(progress, 1f) == 0 /* bottom */) { - mAnimationController.finish(false /* gone */); - } - if (Float.compare(progress, 0f) == 0 /* top */) { - mAnimationController.finish(true /* show */); - } mAnimationController = null; mCurrentRequest = null; + setState(false, false, progress); + } + + private void setState(boolean start, boolean end, float progress) { + State state = State.RESET; + if (start && end) { + throw new IllegalStateException("drag start and end cannot happen in same call"); + } + if (start) { + if (Float.compare(progress, 1f) == 0) { + state = State.DRAG_START_BOTTOM; + } else if (Float.compare(progress, 0f) == 0) { + state = State.DRAG_START_TOP; + } + } else if (end) { + if (Float.compare(progress, 1f) == 0 && mState == State.DRAG_START_TOP) { + state = State.FLING_END_BOTTOM; + } else if (Float.compare(progress, 0f) == 0 && mState == State.DRAG_START_BOTTOM) { + state = State.FLING_END_TOP; + } + } + if (DEBUG) { + Log.d(TAG, "setState " + mState + " -> " + state); + } + mState = state; } } diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index 9fd53e2563..57c0ad92af 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -266,7 +266,7 @@ public abstract class AbstractStateChangeTouchController if (FeatureFlags.ENABLE_DEVICE_SEARCH.get() && BuildCompat.isAtLeastR() && (mToState == ALL_APPS || mToState == NORMAL)) { mLauncher.getAllAppsController().getInsetController().onDragStart( - mToState == ALL_APPS ? 0 : 1); + mFromState == NORMAL ? 1f : 0f); } } From f39f351a0db43c95083d98620670f2eaec52357a Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Wed, 28 Oct 2020 16:30:42 -0700 Subject: [PATCH 08/13] fix the issue widget id can be wrong after restore Bug: 171774227 Test: manual testing 1. randomly add/remove widgets to workspace 2. create a backup (Settings > System > Backup) 3. reset the device 4. restore from the backup 5. verify all of the widgets are restored properly Change-Id: Id65e474dd9349aca715d7e6b88f8d58bc63066ae --- .../launcher3/AppWidgetsRestoredReceiver.java | 12 ++++++++---- .../android/launcher3/LauncherSettings.java | 6 ++++++ .../android/launcher3/util/ContentWriter.java | 18 +++++++++++++++--- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java index a55c90d341..8bf027d4e5 100644 --- a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java +++ b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java @@ -86,13 +86,12 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver { long mainProfileId = UserCache.INSTANCE.get(context) .getSerialNumberForUser(myUserHandle()); String oldWidgetId = Integer.toString(oldWidgetIds[i]); - int result = new ContentWriter(context, new ContentWriter.CommitParams( - "appWidgetId=? and (restored & 1) = 1 and profileId=?", - new String[] { oldWidgetId, Long.toString(mainProfileId) })) + final String where = "appWidgetId=? and (restored & 1) = 1 and profileId=?"; + final String[] args = new String[] { oldWidgetId, Long.toString(mainProfileId) }; + int result = new ContentWriter(context, new ContentWriter.CommitParams(where, args)) .put(LauncherSettings.Favorites.APPWIDGET_ID, newWidgetIds[i]) .put(LauncherSettings.Favorites.RESTORED, state) .commit(); - if (result == 0) { Cursor cursor = cr.query(Favorites.CONTENT_URI, new String[] {Favorites.APPWIDGET_ID}, @@ -106,6 +105,11 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver { cursor.close(); } } + // attempt to update widget id in backup table as well + new ContentWriter(context, ContentWriter.CommitParams.backupCommitParams(where, args)) + .put(LauncherSettings.Favorites.APPWIDGET_ID, newWidgetIds[i]) + .put(LauncherSettings.Favorites.RESTORED, state) + .commit(); } LauncherAppState app = LauncherAppState.getInstanceNoCreate(); diff --git a/src/com/android/launcher3/LauncherSettings.java b/src/com/android/launcher3/LauncherSettings.java index d2758f53ad..fe423ed1be 100644 --- a/src/com/android/launcher3/LauncherSettings.java +++ b/src/com/android/launcher3/LauncherSettings.java @@ -120,6 +120,12 @@ public class LauncherSettings { public static final Uri CONTENT_URI = Uri.parse("content://" + LauncherProvider.AUTHORITY + "/" + TABLE_NAME); + /** + * The content:// style URL for "favorites_bakup" table + */ + public static final Uri BACKUP_CONTENT_URI = Uri.parse("content://" + + LauncherProvider.AUTHORITY + "/" + BACKUP_TABLE_NAME); + /** * The content:// style URL for "favorites_preview" table */ diff --git a/src/com/android/launcher3/util/ContentWriter.java b/src/com/android/launcher3/util/ContentWriter.java index 30c9ff9cb0..ee64e9865d 100644 --- a/src/com/android/launcher3/util/ContentWriter.java +++ b/src/com/android/launcher3/util/ContentWriter.java @@ -113,14 +113,26 @@ public class ContentWriter { public static final class CommitParams { - final Uri mUri = LauncherSettings.Favorites.CONTENT_URI; - String mWhere; - String[] mSelectionArgs; + final Uri mUri; + final String mWhere; + final String[] mSelectionArgs; public CommitParams(String where, String[] selectionArgs) { + this(LauncherSettings.Favorites.CONTENT_URI, where, selectionArgs); + } + + private CommitParams(Uri uri, String where, String[] selectionArgs) { + mUri = uri; mWhere = where; mSelectionArgs = selectionArgs; } + /** + * Creates commit params for backup table. + */ + public static CommitParams backupCommitParams(String where, String[] selectionArgs) { + return new CommitParams( + LauncherSettings.Favorites.BACKUP_CONTENT_URI, where, selectionArgs); + } } } From 991e8208cc610e46f84503a43537ace9d90e481c Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Wed, 28 Oct 2020 22:34:23 -0700 Subject: [PATCH 09/13] Quick fix from ag/12914139 Test: N/A Change-Id: I0b8274f8a912d091cfbbebafdee220b5e46ee74f --- .../android/launcher3/touch/LandscapePagedViewHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java index ad6710f8e2..1d7f747c02 100644 --- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java @@ -43,12 +43,12 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler { @Override public T getPrimaryValue(T x, T y) { - return x; + return y; } @Override public T getSecondaryValue(T x, T y) { - return y; + return x; } @Override From c0ef31e38f2b73ca2d585f4eb7cb86ef97108e09 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Sat, 31 Oct 2020 01:50:29 +0000 Subject: [PATCH 10/13] Revert "Removing workaround for battery defender" This reverts commit ff39fd3e14329db22ef34da32b9116fbe39af6f1. Reason for revert: The CL coincided with a start of flakes "phone is locked". Let's revert and see if it fixed that. https://flakes-clusters.corp.google.com/#/?androidAtpBranch=git_master&androidAtpModule=com.google.android.apps.nexuslauncher.out_of_proc_tests&d=30&cid=9fd6b65c-e48c-4bc3-b19b-f5c610a1999a&maxResults=20 Change-Id: I90f8abbb1794c19593ed8a235a82c0e53030c0a2 --- .../launcher3/ui/AbstractLauncherUiTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index d3fc89e6be..e118481570 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -234,11 +234,25 @@ public abstract class AbstractLauncherUiTest { return mDevice; } + private boolean hasSystemUiObject(String resId) { + return mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, resId)); + } + @Before public void setUp() throws Exception { - Assert.assertTrue("Keyguard is visible", + Log.d(TAG, "Before disabling battery defender"); + mDevice.executeShellCommand("setprop vendor.battery.defender.disable 1"); + Log.d(TAG, "Before enabling stay awake"); + mDevice.executeShellCommand("settings put global stay_on_while_plugged_in 3"); + for (int i = 0; i < 10 && hasSystemUiObject("keyguard_status_view"); ++i) { + Log.d(TAG, "Before unlocking the phone"); + mDevice.executeShellCommand("input keyevent 82"); + mDevice.waitForIdle(); + } + Assert.assertTrue("Keyguard still visible", mDevice.wait( Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000)); + Log.d(TAG, "Keyguard is not visible"); final String launcherPackageName = mDevice.getLauncherPackageName(); try { From 22a5a684641f5e634ff5c36e788dde39d33a1380 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Mon, 2 Nov 2020 17:04:58 -0800 Subject: [PATCH 11/13] Fix a couple notificaiton dot issues Fixes: 172010602 by adding drawDotIfNecessary() back to BubbleTextView Fixes: 167272638 by overriding drawDotIfNecessary() to do nothing in DeepShortcutTextView Change-Id: I0bfbbc6e27dedac73ae97c5a084412ce1aba11e4 --- src/com/android/launcher3/BubbleTextView.java | 1 + .../android/launcher3/shortcuts/DeepShortcutTextView.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 1015a322e8..5cd63721d3 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -446,6 +446,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, canvas.restoreToCount(count); } super.onDraw(canvas); + drawDotIfNecessary(canvas); } protected void drawFocusHighlight(Canvas canvas) { diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java b/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java index eb685921d9..ad3f8df04b 100644 --- a/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java +++ b/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java @@ -132,6 +132,12 @@ public class DeepShortcutTextView extends BubbleTextView { mLoadingStatePlaceholder.draw(canvas); } + @Override + protected void drawDotIfNecessary(Canvas canvas) { + // This view (with the text label to the side of the icon) is not designed for a dot to be + // drawn on top of it, so never draw one even if a notification for this shortcut exists. + } + private void showLoadingState(boolean loading) { if (loading == mShowLoadingState) { return; From a87f99a35ae37dc4520834a80976306e4c388e88 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 2 Nov 2020 20:45:06 -0800 Subject: [PATCH 12/13] [DO NOT MERGE] Add WW log for noti shade swipe down from home. Bug: 171973663 Change-Id: I1e8ff20c62d4f91a05cb1cfc0337e351f2bc8885 --- .../touchcontrollers/StatusBarTouchController.java | 3 +++ src/com/android/launcher3/logging/StatsLogManager.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java index 16bd9ed384..7a7cbb4d9b 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_DOWN; import static android.view.MotionEvent.ACTION_MOVE; import static android.view.MotionEvent.ACTION_UP; import static android.view.MotionEvent.ACTION_CANCEL; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN; import android.graphics.PointF; import android.util.SparseArray; @@ -136,6 +137,8 @@ public class StatusBarTouchController implements TouchController { mLauncher.getUserEventDispatcher().logActionOnContainer(action == ACTION_UP ? Touch.FLING : Touch.SWIPE, Direction.DOWN, ContainerType.WORKSPACE, mLauncher.getWorkspace().getCurrentPage()); + mLauncher.getStatsLogManager().logger() + .log(LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN); setWindowSlippery(false); return true; } diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index e754618a10..c4a4c98699 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -319,8 +319,10 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON(625), @UiEvent(doc = "User tapped on image content in Overview Select mode.") - LAUNCHER_SELECT_MODE_IMAGE(627); + LAUNCHER_SELECT_MODE_IMAGE(627), + @UiEvent(doc = "User swiped down on workspace (triggering noti shade to open).") + LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN(651); // ADD MORE private final int mId; From 64340cca97afb8c1515c7a740c96d83c1f3355b3 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 2 Nov 2020 20:45:06 -0800 Subject: [PATCH 13/13] [DO NOT MERGE] Add WW log for noti shade swipe down from home. Bug: 171973663 Change-Id: I1e8ff20c62d4f91a05cb1cfc0337e351f2bc8885 (cherry picked from commit a87f99a35ae37dc4520834a80976306e4c388e88) --- .../touchcontrollers/StatusBarTouchController.java | 3 +++ src/com/android/launcher3/logging/StatsLogManager.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java index 16bd9ed384..7a7cbb4d9b 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_DOWN; import static android.view.MotionEvent.ACTION_MOVE; import static android.view.MotionEvent.ACTION_UP; import static android.view.MotionEvent.ACTION_CANCEL; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN; import android.graphics.PointF; import android.util.SparseArray; @@ -136,6 +137,8 @@ public class StatusBarTouchController implements TouchController { mLauncher.getUserEventDispatcher().logActionOnContainer(action == ACTION_UP ? Touch.FLING : Touch.SWIPE, Direction.DOWN, ContainerType.WORKSPACE, mLauncher.getWorkspace().getCurrentPage()); + mLauncher.getStatsLogManager().logger() + .log(LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN); setWindowSlippery(false); return true; } diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index e754618a10..c4a4c98699 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -319,8 +319,10 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON(625), @UiEvent(doc = "User tapped on image content in Overview Select mode.") - LAUNCHER_SELECT_MODE_IMAGE(627); + LAUNCHER_SELECT_MODE_IMAGE(627), + @UiEvent(doc = "User swiped down on workspace (triggering noti shade to open).") + LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN(651); // ADD MORE private final int mId;