diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto index 4129ae8ad9..85f982684d 100644 --- a/protos/launcher_log.proto +++ b/protos/launcher_log.proto @@ -122,6 +122,7 @@ enum TipType { SWIPE_UP_TEXT = 2; QUICK_SCRUB_TEXT = 3; PREDICTION_TEXT = 4; + DWB_TOAST = 5; } // Used to define the action component of the LauncherEvent. diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index 2583ffb0d9..aeb29536f2 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -22,13 +22,14 @@ import static com.android.launcher3.anim.Interpolators.ACCEL; import static com.android.launcher3.anim.Interpolators.ACCEL_2; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; +import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS; import static com.android.launcher3.uioverrides.TaskViewTouchController.SUCCESS_TRANSITION_PROGRESS; -import static com.android.quickstep.util.ClipAnimationHelper.TransformParams; import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; import static com.android.quickstep.TouchInteractionService.EDGE_NAV_BAR; +import static com.android.quickstep.util.ClipAnimationHelper.TransformParams; + import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.LayoutTransition; @@ -81,6 +82,7 @@ import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PropertyListBuilder; import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; import com.android.launcher3.util.OverScroller; @@ -100,6 +102,7 @@ import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.BackgroundExecutor; +import com.android.systemui.shared.system.LauncherEventUtil; import com.android.systemui.shared.system.PackageManagerWrapper; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; import com.android.systemui.shared.system.TaskStackChangeListener; @@ -167,6 +170,8 @@ public abstract class RecentsView extends PagedView impl private final ViewPool mTaskViewPool; + private boolean mDwbToastShown; + /** * TODO: Call reloadIdNeeded in onTaskStackChanged. */ @@ -427,6 +432,16 @@ public abstract class RecentsView extends PagedView impl public void setOverviewStateEnabled(boolean enabled) { mOverviewStateEnabled = enabled; updateTaskStackListenerState(); + if (!enabled) mDwbToastShown = false; + } + + public void onDigitalWellbeingToastShown() { + if (!mDwbToastShown) { + mDwbToastShown = true; + mActivity.getUserEventDispatcher().logActionTip( + LauncherEventUtil.VISIBLE, + LauncherLogProto.TipType.DWB_TOAST); + } } @Override diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java index 9eec584a27..98495db9ae 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java @@ -326,6 +326,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { (saturation, contentDescription) -> { setContentDescription(contentDescription); mSnapshotView.setSaturation(saturation); + if (mDigitalWellBeingToast.getVisibility() == VISIBLE) { + getRecentsView().onDigitalWellbeingToastShown(); + } }); }); } else {