diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto index 0560d680f6..3c7f308f5d 100644 --- a/protos/launcher_log.proto +++ b/protos/launcher_log.proto @@ -120,6 +120,8 @@ enum ControlType { BACK_GESTURE = 19; UNDO = 20; DISMISS_PREDICTION = 21; + HYBRID_HOTSEAT_ACCEPTED = 22; + HYBRID_HOTSEAT_CANCELED = 23; } enum TipType { @@ -129,6 +131,7 @@ enum TipType { QUICK_SCRUB_TEXT = 3; PREDICTION_TEXT = 4; DWB_TOAST = 5; + HYBRID_HOTSEAT = 6; } // Used to define the action component of the LauncherEvent. diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java index 4c879452ef..00e72b1e47 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java @@ -15,6 +15,9 @@ */ package com.android.launcher3.hybridhotseat; +import static com.android.launcher3.logging.LoggerUtils.newLauncherEvent; +import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.HYBRID_HOTSEAT_CANCELED; + import android.animation.PropertyValuesHolder; import android.content.Context; import android.content.res.Configuration; @@ -32,6 +35,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.WorkspaceItemInfo; import com.android.launcher3.anim.Interpolators; +import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.uioverrides.PredictedAppIcon; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.launcher3.views.AbstractSlideInView; @@ -95,6 +99,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable handleClose(true); mHotseatEduController.migrate(); mHotseatEduController.finishOnboarding(); + logUserAction(true); Toast.makeText(mLauncher, R.string.hotseat_items_migrated, Toast.LENGTH_LONG).show(); } @@ -102,6 +107,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable if (mHotseatEduController == null) return; Toast.makeText(getContext(), R.string.hotseat_no_migration, Toast.LENGTH_LONG).show(); mHotseatEduController.finishOnboarding(); + logUserAction(false); handleClose(true); } @@ -133,7 +139,28 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable mLauncher.getDeviceProfile().hotseatBarSizePx + insets.bottom; } + private void logUserAction(boolean migrated) { + LauncherLogProto.Action action = new LauncherLogProto.Action(); + LauncherLogProto.Target target = new LauncherLogProto.Target(); + action.type = LauncherLogProto.Action.Type.TOUCH; + action.touch = LauncherLogProto.Action.Touch.TAP; + target.containerType = LauncherLogProto.ContainerType.TIP; + target.tipType = LauncherLogProto.TipType.HYBRID_HOTSEAT; + target.controlType = migrated ? LauncherLogProto.ControlType.HYBRID_HOTSEAT_ACCEPTED + : HYBRID_HOTSEAT_CANCELED; + LauncherLogProto.LauncherEvent event = newLauncherEvent(action, target); + UserEventDispatcher.newInstance(getContext()).dispatchUserEvent(event, null); + } + private void logOnBoardingSeen() { + LauncherLogProto.Action action = new LauncherLogProto.Action(); + LauncherLogProto.Target target = new LauncherLogProto.Target(); + action.type = LauncherLogProto.Action.Type.TIP; + target.containerType = LauncherLogProto.ContainerType.TIP; + target.tipType = LauncherLogProto.TipType.HYBRID_HOTSEAT; + LauncherLogProto.LauncherEvent event = newLauncherEvent(action, target); + UserEventDispatcher.newInstance(getContext()).dispatchUserEvent(event, null); + } private void animateOpen() { if (mIsOpen || mOpenCloseAnimator.isRunning()) { return; @@ -165,6 +192,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable return; } mLauncher.getDragLayer().addView(this); + logOnBoardingSeen(); animateOpen(); for (int i = 0; i < mLauncher.getDeviceProfile().inv.numHotseatIcons; i++) { WorkspaceItemInfo info = predictions.get(i); diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/PredictedAppIcon.java index b2e1798453..4bbb48ce83 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/PredictedAppIcon.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/PredictedAppIcon.java @@ -86,6 +86,7 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView { mIsDrawingDot = true; int count = canvas.save(); canvas.translate(-getWidth() * RING_EFFECT_RATIO, -getHeight() * RING_EFFECT_RATIO); + canvas.scale(1 + 2 * RING_EFFECT_RATIO, 1 + 2 * RING_EFFECT_RATIO); super.drawDotIfNecessary(canvas); canvas.restoreToCount(count); mIsDrawingDot = false; diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml index 5f81e1f5e5..45a62ab151 100644 --- a/quickstep/res/values/strings.xml +++ b/quickstep/res/values/strings.xml @@ -67,13 +67,13 @@ Close - Get suggested apps on the home screen + Easily access your most-used apps - Tap to set up + Pixel suggests your favorite apps based on your routines. Tap to learn more. Suggested apps replace the bottom row of apps - To pin a favorite app, drag it over a suggested app. To hide a suggested app, touch & hold it. + Your current apps will move to the last screen. To pin or block a suggested app, drag it off the bottom row. Bottom row of apps moved to last screen diff --git a/robolectric_tests/src/com/android/launcher3/logging/FileLogTest.java b/robolectric_tests/src/com/android/launcher3/logging/FileLogTest.java index 48b5a459b7..95a41465eb 100644 --- a/robolectric_tests/src/com/android/launcher3/logging/FileLogTest.java +++ b/robolectric_tests/src/com/android/launcher3/logging/FileLogTest.java @@ -49,8 +49,9 @@ public class FileLogTest { @After public void tearDown() { // Clear existing logs - new File(mTempDir, "log-0").delete(); - new File(mTempDir, "log-1").delete(); + for (int i = 0; i < FileLog.LOG_DAYS; i++) { + new File(mTempDir, "log-" + i).delete(); + } mTempDir.delete(); mTestActive = false; @@ -89,8 +90,9 @@ public class FileLogTest { Calendar threeDaysAgo = Calendar.getInstance(); threeDaysAgo.add(Calendar.HOUR, -72); - new File(mTempDir, "log-0").setLastModified(threeDaysAgo.getTimeInMillis()); - new File(mTempDir, "log-1").setLastModified(threeDaysAgo.getTimeInMillis()); + for (int i = 0; i < FileLog.LOG_DAYS; i++) { + new File(mTempDir, "log-" + i).setLastModified(threeDaysAgo.getTimeInMillis()); + } FileLog.print("Testing", "abracadabra", new Exception("cat! cat!")); writer = new StringWriter(); diff --git a/src/com/android/launcher3/logging/FileLog.java b/src/com/android/launcher3/logging/FileLog.java index 2c972a0a04..67f07b1def 100644 --- a/src/com/android/launcher3/logging/FileLog.java +++ b/src/com/android/launcher3/logging/FileLog.java @@ -42,7 +42,7 @@ public final class FileLog { private static Handler sHandler = null; private static File sLogsDirectory = null; - private static final int LOG_DAYS = 2; + public static final int LOG_DAYS = 4; public static void setDir(File logsDir) { if (ENABLED) {