From aee533986902f48853d00e9fee7cf2e5c33749ab Mon Sep 17 00:00:00 2001 From: Cyrus Boadway Date: Wed, 5 May 2021 13:56:39 +0000 Subject: [PATCH 1/8] Enable Quickstep widget launch and return animations Turn on new widget animations by default. Bug: 169042867 Test: manual Change-Id: Ie35660c798731f5e3d341c8135adb8e2a7683eed --- src/com/android/launcher3/config/FeatureFlags.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 3b88a0b2af..a093e047d2 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -88,7 +88,7 @@ public final class FeatureFlags { "ENABLE_QUICKSTEP_LIVE_TILE", true, "Enable live tile in Quickstep overview"); public static final BooleanFlag ENABLE_QUICKSTEP_WIDGET_APP_START = getDebugFlag( - "ENABLE_QUICKSTEP_WIDGET_APP_START", false, + "ENABLE_QUICKSTEP_WIDGET_APP_START", true, "Enable Quickstep animation when launching activities from an app widget"); // Keep as DeviceFlag to allow remote disable in emergency. From 85961fa44bc253aee80e9a114b5bcfdc447e7356 Mon Sep 17 00:00:00 2001 From: zakcohen Date: Fri, 7 May 2021 14:10:44 -0700 Subject: [PATCH 2/8] Make foreground scrim darker on Recents View. Make the foreground scrim darker, not just scrimming to the target color. Waiting for real token for the scrim color. Moves the COLOR_TINT property from TaskView to RecentsView to make coordinating the animation simpler. Bug: 187320416 Test: Local Change-Id: I300f98f78e33476ee604d4dd61b485326356eb5b --- .../android/quickstep/views/RecentsView.java | 62 ++++++++++++++++++- .../quickstep/views/TaskThumbnailView.java | 3 +- .../com/android/quickstep/views/TaskView.java | 45 ++------------ 3 files changed, 68 insertions(+), 42 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 59588325fd..7bd0195391 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -63,7 +63,9 @@ import android.annotation.TargetApi; import android.app.ActivityManager.RunningTaskInfo; import android.content.Context; import android.content.res.Configuration; +import android.graphics.BlendMode; import android.graphics.Canvas; +import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Point; import android.graphics.PointF; @@ -98,6 +100,7 @@ import android.widget.OverScroller; import androidx.annotation.Nullable; import androidx.annotation.UiThread; +import androidx.core.graphics.ColorUtils; import com.android.launcher3.BaseActivity; import com.android.launcher3.BaseActivity.MultiWindowModeChangedListener; @@ -243,6 +246,24 @@ public abstract class RecentsView COLOR_TINT = + new FloatProperty("colorTint") { + @Override + public void setValue(RecentsView recentsView, float v) { + recentsView.setColorTint(v); + } + + @Override + public Float get(RecentsView recentsView) { + return recentsView.getColorTint(); + } + }; + /** * Even though {@link TaskView} has distinct offsetTranslationX/Y and resistance property, they * are currently both used to apply secondary translation. Should their use cases change to be @@ -404,6 +425,10 @@ public abstract class RecentsView COLOR_TINT = - new FloatProperty("colorTint") { - @Override - public void setValue(TaskView taskView, float v) { - taskView.setColorTint(v); - } - - @Override - public Float get(TaskView taskView) { - return taskView.getColorTint(); - } - }; - private final TaskOutlineProvider mOutlineProvider; private Task mTask; @@ -393,11 +379,6 @@ public class TaskView extends FrameLayout implements Reusable { private final float[] mIconCenterCoords = new float[2]; private final float[] mChipCenterCoords = new float[2]; - // Colored tint for the task view and all its supplementary views (like the task icon and well - // being banner. - private final int mTintingColor; - private float mTintAmount; - private boolean mIsClickableAsLiveTile = true; public TaskView(Context context) { @@ -419,8 +400,6 @@ public class TaskView extends FrameLayout implements Reusable { mOutlineProvider = new TaskOutlineProvider(getContext(), mCurrentFullscreenParams, mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx); setOutlineProvider(mOutlineProvider); - - mTintingColor = Themes.getColorBackgroundFloating(context); } /** @@ -864,7 +843,7 @@ public class TaskView extends FrameLayout implements Reusable { setTranslationZ(0); setAlpha(mStableAlpha); setIconScaleAndDim(1); - setColorTint(0); + setColorTint(0, 0); } public void setStableAlpha(float parentAlpha) { @@ -1472,25 +1451,13 @@ public class TaskView extends FrameLayout implements Reusable { getRecentsView().initiateSplitSelect(this, splitPositionOption); } - private void setColorTint(float amount) { - mTintAmount = amount; - mSnapshotView.setDimAlpha(mTintAmount); - mIconView.setIconColorTint(mTintingColor, mTintAmount); - mDigitalWellBeingToast.setBannerColorTint(mTintingColor, mTintAmount); - } - - private float getColorTint() { - return mTintAmount; - } - /** - * Show the task view with a color tint (animates value). + * Set a color tint on the snapshot and supporting views. */ - public void showColorTint(boolean enable) { - ObjectAnimator tintAnimator = ObjectAnimator.ofFloat( - this, COLOR_TINT, enable ? MAX_PAGE_SCRIM_ALPHA : 0); - tintAnimator.setAutoCancel(true); - tintAnimator.start(); + public void setColorTint(float amount, int tintColor) { + mSnapshotView.setDimAlpha(amount); + mIconView.setIconColorTint(tintColor, amount); + mDigitalWellBeingToast.setBannerColorTint(tintColor, amount); } /** From c86eb1abf49e5ced12f6b2ad3606d9b80e571234 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 7 May 2021 16:05:51 -0700 Subject: [PATCH 3/8] Ignoring invalid deep shortcuts during load Bug: 182728800 Test: Manual Change-Id: I880c2c8898f7a968024bf7b95e763f4293ee19a0 --- src/com/android/launcher3/model/LoaderCursor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java index 897b02ede2..7e3bceee1d 100644 --- a/src/com/android/launcher3/model/LoaderCursor.java +++ b/src/com/android/launcher3/model/LoaderCursor.java @@ -52,6 +52,7 @@ import com.android.launcher3.logging.FileLog; import com.android.launcher3.model.data.AppInfo; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; +import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.util.ContentWriter; import com.android.launcher3.util.GridOccupancy; import com.android.launcher3.util.IntArray; @@ -394,6 +395,11 @@ public class LoaderCursor extends CursorWrapper { * otherwise marks it for deletion. */ public void checkAndAddItem(ItemInfo info, BgDataModel dataModel) { + if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) { + // Ensure that it is a valid intent. An exception here will + // cause the item loading to get skipped + ShortcutKey.fromItemInfo(info); + } if (checkItemPlacement(info)) { dataModel.addItem(mContext, info, false); } else { From 35226124e3d83c56e47bff93e228b23fe12d32fc Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 7 May 2021 16:34:43 -0700 Subject: [PATCH 4/8] Removing some unused logs Fixes: 185820525 Fixes: 177316094 Fixes: 158017601 Fixes: 180915942 Change-Id: I8ce5bde08e1728d3209762c5f061245386408825 --- .../TwoButtonNavbarTouchController.java | 20 ------------ .../OrientationTouchTransformer.java | 31 +++---------------- .../android/quickstep/RecentTasksList.java | 16 ---------- .../RecentsAnimationDeviceState.java | 1 - .../quickstep/RotationTouchHelper.java | 9 ------ .../quickstep/TouchInteractionService.java | 28 ----------------- .../fallback/FallbackRecentsView.java | 4 --- .../android/quickstep/views/RecentsView.java | 17 ---------- .../quickstep/FallbackRecentsTest.java | 8 ++--- .../android/quickstep/TaplTestsQuickstep.java | 2 -- .../launcher3/InvariantDeviceProfile.java | 9 ------ src/com/android/launcher3/Launcher.java | 9 ------ .../launcher3/testing/TestProtocol.java | 6 +--- .../launcher3/ui/PortraitLandscapeRunner.java | 4 --- 14 files changed, 8 insertions(+), 156 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java index b0d0b1528c..e2747dfcbb 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java @@ -78,18 +78,9 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont return true; } if (AbstractFloatingView.getTopOpenView(mLauncher) != null) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, - "Didn't intercept touch due to top view: " - + AbstractFloatingView.getTopOpenView(mLauncher)); - } return false; } if ((ev.getEdgeFlags() & EDGE_NAV_BAR) == 0) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, - "Didn't intercept touch because event wasn't from nav bar"); - } return false; } if (!mIsTransposed && mLauncher.isInState(OVERVIEW)) { @@ -101,10 +92,6 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont @Override public boolean onControllerInterceptTouchEvent(MotionEvent ev) { boolean intercept = super.onControllerInterceptTouchEvent(ev); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, - "2 button touch controller intercept touch? " + intercept); - } return intercept; } @@ -123,10 +110,6 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont @Override protected void onReinitToState(LauncherState newToState) { super.onReinitToState(newToState); - - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, "onReinitToState: " + newToState); - } } @Override @@ -175,9 +158,6 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont @Override protected void onSwipeInteractionCompleted(LauncherState targetState) { super.onSwipeInteractionCompleted(targetState); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, "Reached state: " + targetState); - } if (!mIsTransposed) { mContinuousTouchCount++; } diff --git a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java index 62b821c41d..35a851ab65 100644 --- a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java +++ b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java @@ -35,7 +35,6 @@ import android.view.Surface; import com.android.launcher3.R; import com.android.launcher3.ResourceUtils; -import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.util.DisplayController.Info; import java.io.PrintWriter; @@ -92,7 +91,7 @@ class OrientationTouchTransformer { }; private static final String TAG = "OrientationTouchTransformer"; - private static final boolean DEBUG = true; + private static final boolean DEBUG = false; private static final int QUICKSTEP_ROTATION_UNINITIALIZED = -1; @@ -161,11 +160,9 @@ class OrientationTouchTransformer { resetSwipeRegions(info); } - void setNavigationMode(SysUINavigationMode.Mode newMode, Info info, - Resources newRes) { + void setNavigationMode(SysUINavigationMode.Mode newMode, Info info, Resources newRes) { if (DEBUG) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "setNavigationMode new: " + newMode - + " oldMode: " + mMode + " " + this); + Log.d(TAG, "setNavigationMode new: " + newMode + " oldMode: " + mMode + " " + this); } if (mMode == newMode) { return; @@ -258,18 +255,10 @@ class OrientationTouchTransformer { mCurrentDisplay = new CurrentDisplay(region.currentSize, region.rotation); OrientationRectF regionToKeep = mSwipeTouchRegions.get(mCurrentDisplay); - if (DEBUG) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "cached region: " + regionToKeep - + " mCurrentDisplay: " + mCurrentDisplay + " " + this); - } if (regionToKeep == null) { regionToKeep = createRegionForDisplay(region); } mSwipeTouchRegions.clear(); - if (DEBUG) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "adding region: " + regionToKeep - + " mCurrentDisplay: " + mCurrentDisplay + " " + this); - } mSwipeTouchRegions.put(mCurrentDisplay, regionToKeep); updateAssistantRegions(regionToKeep); } @@ -301,10 +290,6 @@ class OrientationTouchTransformer { mAssistantLeftRegion.setEmpty(); mAssistantRightRegion.setEmpty(); int navbarSize = getNavbarSize(ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE); - if (DEBUG) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "else case mode: " + mMode - + " getNavbarSize: " + navbarSize + " rotation: " + rotation + " " + this); - } switch (rotation) { case Surface.ROTATION_90: orientationRectF.left = orientationRectF.right @@ -355,8 +340,8 @@ class OrientationTouchTransformer { } boolean touchInValidSwipeRegions(float x, float y) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "touchInValidSwipeRegions " + x + "," + y + " in " + if (DEBUG) { + Log.d(TAG, "touchInValidSwipeRegions " + x + "," + y + " in " + mLastRectTouched + " this: " + this); } if (mLastRectTouched != null) { @@ -399,16 +384,10 @@ class OrientationTouchTransformer { } for (OrientationRectF rect : mSwipeTouchRegions.values()) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "transform:DOWN, rect=" + rect); - } if (rect == null) { continue; } if (rect.applyTransform(event, false)) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "setting mLastRectTouched"); - } mLastRectTouched = rect; mActiveTouchRotation = rect.mRotation; if (mEnableMultipleRegions diff --git a/quickstep/src/com/android/quickstep/RecentTasksList.java b/quickstep/src/com/android/quickstep/RecentTasksList.java index 2f1538bf5a..3302da0f77 100644 --- a/quickstep/src/com/android/quickstep/RecentTasksList.java +++ b/quickstep/src/com/android/quickstep/RecentTasksList.java @@ -93,10 +93,6 @@ public class RecentTasksList extends TaskStackChangeListener { * @return The change id of the current task list */ public synchronized int getTasks(boolean loadKeysOnly, Consumer> callback) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "getTasks: keysOnly=" + loadKeysOnly - + " callback=" + callback); - } final int requestLoadId = mChangeId; if (mResultsUi.isValidForRequest(requestLoadId, loadKeysOnly)) { // The list is up to date, send the callback on the next frame, @@ -105,9 +101,6 @@ public class RecentTasksList extends TaskStackChangeListener { // Copy synchronously as the changeId might change by next frame ArrayList result = copyOf(mResultsUi); mMainThreadExecutor.post(() -> { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "getTasks: no new tasks"); - } callback.accept(result); }); } @@ -118,24 +111,15 @@ public class RecentTasksList extends TaskStackChangeListener { // Kick off task loading in the background mLoadingTasksInBackground = true; UI_HELPER_EXECUTOR.execute(() -> { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "getTasks: loading in bg start"); - } if (!mResultsBg.isValidForRequest(requestLoadId, loadKeysOnly)) { mResultsBg = loadTasksInBackground(Integer.MAX_VALUE, requestLoadId, loadKeysOnly); } - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "getTasks: loading in bg end"); - } TaskLoadResult loadResult = mResultsBg; mMainThreadExecutor.execute(() -> { mLoadingTasksInBackground = false; mResultsUi = loadResult; if (callback != null) { ArrayList result = copyOf(mResultsUi); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "getTasks: callback w/ bg results"); - } callback.accept(result); } }); diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index e271203d18..110b3563ac 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -229,7 +229,6 @@ public class RecentsAnimationDeviceState implements * Cleans up all the registered listeners and receivers. */ public void destroy() { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "destroying RADS", new Throwable()); for (Runnable r : mOnDestroyActions) { r.run(); } diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java index 76298624d3..070d725890 100644 --- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java +++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java @@ -133,8 +133,6 @@ public class RotationTouchHelper implements private RotationTouchHelper(Context context) { mContext = context; - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "RotationTouchHelper ctor init? " + mNeedsInit - + " " + this); if (mNeedsInit) { init(); } @@ -142,11 +140,8 @@ public class RotationTouchHelper implements public void init() { if (!mNeedsInit) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "Did not need init? " + " " + this); return; } - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "RotationTouchHelper init() " + this, - new Throwable()); mDisplayController = DisplayController.INSTANCE.get(mContext); Resources resources = mContext.getResources(); mSysUiNavMode = SysUINavigationMode.INSTANCE.get(mContext); @@ -157,8 +152,6 @@ public class RotationTouchHelper implements // Register for navigation mode changes SysUINavigationMode.Mode newMode = mSysUiNavMode.addModeChangeListener(this); - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "AddedModeChangeListener: " + this + - " currentMode: " + newMode); onNavigationModeChanged(newMode); runOnDestroy(() -> mSysUiNavMode.removeModeChangeListener(this)); @@ -204,7 +197,6 @@ public class RotationTouchHelper implements * Cleans up all the registered listeners and receivers. */ public void destroy() { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "destroying " + this); for (Runnable r : mOnDestroyActions) { r.run(); } @@ -253,7 +245,6 @@ public class RotationTouchHelper implements @Override public void onNavigationModeChanged(SysUINavigationMode.Mode newMode) { - Log.d(TestProtocol.NO_SWIPE_TO_HOME, "nav mode changed: " + newMode); mDisplayController.removeChangeListener(this); mDisplayController.addChangeListener(this); onDisplayInfoChanged(mContext, mDisplayController.getInfo(), CHANGE_ALL); diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 5fe0fc72a2..027dd1cf8d 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -165,8 +165,6 @@ public class TouchInteractionService extends Service implements PluginListener tasks) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "applyLoadPlan: taskCount=" + tasks.size()); - for (Task t : tasks) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "\t" + t); - } - } if (mPendingAnimation != null) { mPendingAnimation.addEndListener(success -> applyLoadPlan(tasks)); return; @@ -1127,11 +1121,6 @@ public abstract class RecentsView MAIN_EXECUTOR.submit(() -> { RecentsActivity activity = RecentsActivity.ACTIVITY_TRACKER.getCreatedActivity(); if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "activity=" + activity); + Log.d(TestProtocol.FALLBACK_ACTIVITY_NO_SET, "activity=" + activity); } if (activity == null) { return false; @@ -212,10 +212,6 @@ public class FallbackRecentsTest { BaseOverview overview = mLauncher.getBackground().switchToOverview(); executeOnRecents(recents -> { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.GET_RECENTS_FAILED, "isLoading=" + - recents.getOverviewPanel().isLoadingTasks()); - } assertTrue("Don't have at least 3 tasks", getTaskCount(recents) >= 3); }); diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index a700e16d64..a5038a1fb0 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -189,12 +189,10 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @NavigationModeSwitch @PortraitLandscape public void testSwitchToOverview() throws Exception { - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "testSwitchToOverview"); assertNotNull("Workspace.switchToOverview() returned null", mLauncher.pressHome().switchToOverview()); assertTrue("Launcher internal state didn't switch to Overview", isInState(() -> LauncherState.OVERVIEW)); - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "testSwitchToOverview finished"); } @Test diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 7836fa384b..318dde1ecc 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -369,10 +369,6 @@ public class InvariantDeviceProfile { } private void onConfigChanged(Context context) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "IDP.onConfigChanged"); - } - // Re-init grid String gridName = getCurrentGridName(context); initGrid(context, gridName); @@ -527,11 +523,6 @@ public class InvariantDeviceProfile { float availableWidth = config.screenWidthDp * res.getDisplayMetrics().density; float availableHeight = config.screenHeightDp * res.getDisplayMetrics().density; - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, - "getDeviceProfile: orientation=" + config.orientation - + " size=" + availableWidth + "x" + availableHeight); - } DeviceProfile bestMatch = supportedProfiles.get(0); float minDiff = Float.MAX_VALUE; diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5896f5a4de..92d1b11ded 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -554,21 +554,12 @@ public class Launcher extends StatefulActivity implements Launche onIdpChanged(mDeviceProfile.inv); } - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "onConfigurationChanged: diff=" + diff); - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "newConfig=" + newConfig); - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "oldConfig=" + mOldConfig); - } - mOldConfig.setTo(newConfig); super.onConfigurationChanged(newConfig); } @Override public void onIdpChanged(InvariantDeviceProfile idp) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "onIdpChanged"); - } initDeviceProfile(idp); dispatchDeviceProfileChanged(); reapplyUi(); diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java index 3296ea51f6..4012e89a9a 100644 --- a/src/com/android/launcher3/testing/TestProtocol.java +++ b/src/com/android/launcher3/testing/TestProtocol.java @@ -109,10 +109,6 @@ public final class TestProtocol { public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation"; public static final String PERMANENT_DIAG_TAG = "TaplTarget"; - public static final String LAUNCHER_NOT_TRANSPOSED = "b/185820525"; - public static final String NO_SWIPE_TO_HOME = "b/158017601"; public static final String WORK_PROFILE_REMOVED = "b/159671700"; - public static final String TIS_NO_EVENTS = "b/180915942"; - public static final String GET_RECENTS_FAILED = "b/177472267"; - public static final String TWO_BUTTON_NORMAL_NOT_OVERVIEW = "b/177316094"; + public static final String FALLBACK_ACTIVITY_NO_SET = "b/181019015"; } diff --git a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java index 6c68daa8c1..8f2d5283ee 100644 --- a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java +++ b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java @@ -55,23 +55,19 @@ class PortraitLandscapeRunner implements TestRule { } private void evaluateInPortrait() throws Throwable { - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "evaluateInPortrait"); mTest.mDevice.setOrientationNatural(); mTest.mLauncher.setExpectedRotation(Surface.ROTATION_0); AbstractLauncherUiTest.checkDetectedLeaks(mTest.mLauncher); base.evaluate(); mTest.getDevice().pressHome(); - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "evaluateInPortrait finished"); } private void evaluateInLandscape() throws Throwable { - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "evaluateInLandscape"); mTest.mDevice.setOrientationLeft(); mTest.mLauncher.setExpectedRotation(Surface.ROTATION_90); AbstractLauncherUiTest.checkDetectedLeaks(mTest.mLauncher); base.evaluate(); mTest.getDevice().pressHome(); - Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "evaluateInLandscape finished"); } }; } From 1ac7b8352134c264ad8a385714c596608d4b1725 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sun, 9 May 2021 10:49:37 -0700 Subject: [PATCH 5/8] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I7dd72869281cae2bb6d5c40899856fec566a7670 --- quickstep/res/values-en-rAU/strings.xml | 12 ++++-------- quickstep/res/values-en-rCA/strings.xml | 12 ++++-------- quickstep/res/values-en-rGB/strings.xml | 12 ++++-------- quickstep/res/values-en-rIN/strings.xml | 12 ++++-------- quickstep/res/values-uz/strings.xml | 12 ++++-------- 5 files changed, 20 insertions(+), 40 deletions(-) diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml index 1040a0361b..5aae288631 100644 --- a/quickstep/res/values-en-rAU/strings.xml +++ b/quickstep/res/values-en-rAU/strings.xml @@ -74,14 +74,10 @@ "Try again" "Nice!" "Tutorial %1$d/%2$d" - - - - - - - - + "Ready!" + "Swipe up to go home" + "You’re ready to start using your phone" + "Navigation settings for accessibility" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml index 1040a0361b..5aae288631 100644 --- a/quickstep/res/values-en-rCA/strings.xml +++ b/quickstep/res/values-en-rCA/strings.xml @@ -74,14 +74,10 @@ "Try again" "Nice!" "Tutorial %1$d/%2$d" - - - - - - - - + "Ready!" + "Swipe up to go home" + "You’re ready to start using your phone" + "Navigation settings for accessibility" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml index 1040a0361b..5aae288631 100644 --- a/quickstep/res/values-en-rGB/strings.xml +++ b/quickstep/res/values-en-rGB/strings.xml @@ -74,14 +74,10 @@ "Try again" "Nice!" "Tutorial %1$d/%2$d" - - - - - - - - + "Ready!" + "Swipe up to go home" + "You’re ready to start using your phone" + "Navigation settings for accessibility" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml index 1040a0361b..5aae288631 100644 --- a/quickstep/res/values-en-rIN/strings.xml +++ b/quickstep/res/values-en-rIN/strings.xml @@ -74,14 +74,10 @@ "Try again" "Nice!" "Tutorial %1$d/%2$d" - - - - - - - - + "Ready!" + "Swipe up to go home" + "You’re ready to start using your phone" + "Navigation settings for accessibility" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml index 4ddcae846e..8ca3898234 100644 --- a/quickstep/res/values-uz/strings.xml +++ b/quickstep/res/values-uz/strings.xml @@ -74,14 +74,10 @@ "Qayta urinish" "Yaxshi!" "Darslik: %1$d/%2$d" - - - - - - - - + "Hammasi tayyor!" + "Boshiga qaytish uchun tepaga suring" + "Telefoningiz xizmatga tayyor" + "Maxsus imkoniyatlar uchun navigatsiya sozlamalari" "Ulashish" "Skrinshot" "Bu amal ilova yoki tashkilotingiz tomonidan taqiqlangan" From 14980fe0dddaf36521e2f3b8ffb0fd1ee3d0ec93 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sun, 9 May 2021 10:50:07 -0700 Subject: [PATCH 6/8] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I67cae1b3cc2fd0e16750dd31f762b9d480792595 --- go/quickstep/res/values-en-rAU/strings.xml | 8 ++++++++ go/quickstep/res/values-en-rCA/strings.xml | 8 ++++++++ go/quickstep/res/values-en-rGB/strings.xml | 8 ++++++++ go/quickstep/res/values-en-rIN/strings.xml | 8 ++++++++ go/quickstep/res/values-uz/strings.xml | 8 ++++++++ 5 files changed, 40 insertions(+) create mode 100644 go/quickstep/res/values-en-rAU/strings.xml create mode 100644 go/quickstep/res/values-en-rCA/strings.xml create mode 100644 go/quickstep/res/values-en-rGB/strings.xml create mode 100644 go/quickstep/res/values-en-rIN/strings.xml create mode 100644 go/quickstep/res/values-uz/strings.xml diff --git a/go/quickstep/res/values-en-rAU/strings.xml b/go/quickstep/res/values-en-rAU/strings.xml new file mode 100644 index 0000000000..3a609b6729 --- /dev/null +++ b/go/quickstep/res/values-en-rAU/strings.xml @@ -0,0 +1,8 @@ + + + "Share app" + "Listen" + "Translate" + "Lens" + diff --git a/go/quickstep/res/values-en-rCA/strings.xml b/go/quickstep/res/values-en-rCA/strings.xml new file mode 100644 index 0000000000..3a609b6729 --- /dev/null +++ b/go/quickstep/res/values-en-rCA/strings.xml @@ -0,0 +1,8 @@ + + + "Share app" + "Listen" + "Translate" + "Lens" + diff --git a/go/quickstep/res/values-en-rGB/strings.xml b/go/quickstep/res/values-en-rGB/strings.xml new file mode 100644 index 0000000000..3a609b6729 --- /dev/null +++ b/go/quickstep/res/values-en-rGB/strings.xml @@ -0,0 +1,8 @@ + + + "Share app" + "Listen" + "Translate" + "Lens" + diff --git a/go/quickstep/res/values-en-rIN/strings.xml b/go/quickstep/res/values-en-rIN/strings.xml new file mode 100644 index 0000000000..3a609b6729 --- /dev/null +++ b/go/quickstep/res/values-en-rIN/strings.xml @@ -0,0 +1,8 @@ + + + "Share app" + "Listen" + "Translate" + "Lens" + diff --git a/go/quickstep/res/values-uz/strings.xml b/go/quickstep/res/values-uz/strings.xml new file mode 100644 index 0000000000..4e375c7e71 --- /dev/null +++ b/go/quickstep/res/values-uz/strings.xml @@ -0,0 +1,8 @@ + + + "Ilovani ulashish" + "Tinglash" + "Tarjimon" + "Lens" + From 8fa997f2b037e16614b89b773f1fc08f4baa624b Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sun, 9 May 2021 10:50:52 -0700 Subject: [PATCH 7/8] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I0c77f5561818d4516e821e7f11d01178e8272df1 --- res/values-en-rAU/strings.xml | 3 +-- res/values-en-rCA/strings.xml | 3 +-- res/values-en-rGB/strings.xml | 3 +-- res/values-en-rIN/strings.xml | 3 +-- res/values-uz/strings.xml | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml index 8dd37bc059..5af3e7dcea 100644 --- a/res/values-en-rAU/strings.xml +++ b/res/values-en-rAU/strings.xml @@ -97,8 +97,7 @@ "Folder: %1$s, %2$d items" "Folder: %1$s, %2$d or more items" "Wallpapers" - - + "Wallpaper & style" "Home settings" "Disabled by your admin" "Allow Home screen rotation" diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml index 8dd37bc059..5af3e7dcea 100644 --- a/res/values-en-rCA/strings.xml +++ b/res/values-en-rCA/strings.xml @@ -97,8 +97,7 @@ "Folder: %1$s, %2$d items" "Folder: %1$s, %2$d or more items" "Wallpapers" - - + "Wallpaper & style" "Home settings" "Disabled by your admin" "Allow Home screen rotation" diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml index 8dd37bc059..5af3e7dcea 100644 --- a/res/values-en-rGB/strings.xml +++ b/res/values-en-rGB/strings.xml @@ -97,8 +97,7 @@ "Folder: %1$s, %2$d items" "Folder: %1$s, %2$d or more items" "Wallpapers" - - + "Wallpaper & style" "Home settings" "Disabled by your admin" "Allow Home screen rotation" diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml index 8dd37bc059..5af3e7dcea 100644 --- a/res/values-en-rIN/strings.xml +++ b/res/values-en-rIN/strings.xml @@ -97,8 +97,7 @@ "Folder: %1$s, %2$d items" "Folder: %1$s, %2$d or more items" "Wallpapers" - - + "Wallpaper & style" "Home settings" "Disabled by your admin" "Allow Home screen rotation" diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml index 52b06ac913..7f0ced4fb8 100644 --- a/res/values-uz/strings.xml +++ b/res/values-uz/strings.xml @@ -97,8 +97,7 @@ "Jild: %1$s, %2$d fayllar" "Jild: %1$s, %2$d va undan ortiq fayllar" "Fon rasmlari" - - + "Fon rasmi va stili" "Bosh ekran sozlamalari" "Administrator tomonidan o‘chirilgan" "Bosh ekranni burishga ruxsat" From f20a4bd9a93e7d827b8c3db858e4dc1fa9b9d56c Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Mon, 19 Apr 2021 21:37:08 -0700 Subject: [PATCH 8/8] Finish the recents animation when the phone goes to sleep Fixes: 169988381 Test: manual Change-Id: I62527ef46009a1417e67637c512b3a2fc005bcd6 --- .../launcher3/BaseQuickstepLauncher.java | 10 ++++++++++ src/com/android/launcher3/Launcher.java | 20 +++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java index 2aac877804..6966fb65dd 100644 --- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java @@ -23,6 +23,7 @@ import static com.android.launcher3.LauncherState.NO_OFFSET; import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY; import android.animation.AnimatorSet; @@ -189,6 +190,15 @@ public abstract class BaseQuickstepLauncher extends Launcher () -> ActivityManagerWrapper.getInstance().invalidateHomeTaskSnapshot(this)); } + @Override + protected void onScreenOff() { + super.onScreenOff(); + if (LIVE_TILE.get()) { + RecentsView recentsView = getOverviewPanel(); + recentsView.finishRecentsAnimation(true /* toRecents */, null); + } + } + @Override public void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) { diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5896f5a4de..e5190fd834 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1346,14 +1346,7 @@ public class Launcher extends StatefulActivity implements Launche private final BroadcastReceiver mScreenOffReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - // Reset AllApps to its initial state only if we are not in the middle of - // processing a multi-step drop - if (mPendingRequestArgs == null) { - if (!isInState(NORMAL)) { - onUiChangedWhileSleeping(); - } - mStateManager.goToState(NORMAL); - } + onScreenOff(); } }; @@ -1923,6 +1916,17 @@ public class Launcher extends StatefulActivity implements Launche } } + protected void onScreenOff() { + // Reset AllApps to its initial state only if we are not in the middle of + // processing a multi-step drop + if (mPendingRequestArgs == null) { + if (!isInState(NORMAL)) { + onUiChangedWhileSleeping(); + } + mStateManager.goToState(NORMAL); + } + } + @TargetApi(Build.VERSION_CODES.M) @Override protected boolean onErrorStartingShortcut(Intent intent, ItemInfo info) {