Merge "Adding logging for showing DWB toast" into ub-launcher3-master

This commit is contained in:
TreeHugger Robot
2019-03-14 20:24:06 +00:00
committed by Android (Google) Code Review
3 changed files with 21 additions and 2 deletions
+1
View File
@@ -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.
@@ -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<T extends BaseActivity> extends PagedView impl
private final ViewPool<TaskView> mTaskViewPool;
private boolean mDwbToastShown;
/**
* TODO: Call reloadIdNeeded in onTaskStackChanged.
*/
@@ -427,6 +432,16 @@ public abstract class RecentsView<T extends BaseActivity> 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
@@ -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 {