Loading quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduController.java +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ */ package com.android.launcher3.hybridhotseat; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent .LAUNCHER_HOTSEAT_EDU_ONLY_TIP; import android.content.Intent; import android.view.View; Loading Loading @@ -262,6 +265,7 @@ public class HotseatEduController { requiresMigration ? R.string.hotseat_tip_no_empty_slots : R.string.hotseat_auto_enrolled), mHotseat.getTop()); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_ONLY_TIP); finishOnboarding(); } } Loading quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java +7 −43 Original line number Diff line number Diff line Loading @@ -15,9 +15,10 @@ */ 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 static com.android.launcher3.logging.StatsLogManager.LauncherEvent .LAUNCHER_HOTSEAT_EDU_ACCEPT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_DENY; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_SEEN; import android.animation.PropertyValuesHolder; import android.content.Context; Loading @@ -35,10 +36,8 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.Insettable; import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.Workspace; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.uioverrides.PredictedAppIcon; import com.android.launcher3.userevent.nano.LauncherLogProto; Loading Loading @@ -113,15 +112,13 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable mHotseatEduController.moveHotseatItems(); mHotseatEduController.finishOnboarding(); //TODO: pass actual page index here. // Temporarily we're passing 1 for folder migration and 2 for page migration logUserAction(true, FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get() ? 1 : 2); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_ACCEPT); } private void onDismiss(View v) { mHotseatEduController.showDimissTip(); mHotseatEduController.finishOnboarding(); logUserAction(false, -1); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_DENY); handleClose(true); } Loading Loading @@ -165,39 +162,6 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable } } private void logUserAction(boolean migrated, int pageIndex) { LauncherLogProto.Action action = new LauncherLogProto.Action(); LauncherLogProto.Target target = new LauncherLogProto.Target(); int hotseatItemsCount = mLauncher.getHotseat().getShortcutsAndWidgets().getChildCount(); // -1 to exclude smart space int workspaceItemCount = mLauncher.getWorkspace().getScreenWithId( Workspace.FIRST_SCREEN_ID).getShortcutsAndWidgets().getChildCount() - 1; 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; target.rank = MIGRATION_EXPERIMENT_IDENTIFIER; // encoding migration type on pageIndex target.pageIndex = pageIndex; target.cardinality = (workspaceItemCount * 1000) + hotseatItemsCount; 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; Loading Loading @@ -248,7 +212,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable } AbstractFloatingView.closeAllOpenViews(mLauncher); attachToContainer(); logOnBoardingSeen(); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_SEEN); animateOpen(); populatePreview(predictions); } Loading quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +6 −2 Original line number Diff line number Diff line Loading @@ -340,10 +340,14 @@ public class HotseatPredictionController implements DragController.DragListener, * Create WorkspaceItemInfo objects and binds PredictedAppIcon views for cached predicted items. */ public void showCachedItems(List<AppInfo> apps, IntArray ranks) { if (hasPredictions() && mAppPredictor != null) { mAppPredictor.requestPredictionUpdate(); fillGapsWithPrediction(); return; } mIsCacheEmpty = apps.isEmpty(); int count = Math.min(ranks.size(), apps.size()); List<WorkspaceItemInfo> items = new ArrayList<>(count); mComponentKeyMappers.clear(); for (int i = 0; i < count; i++) { WorkspaceItemInfo item = new WorkspaceItemInfo(apps.get(i)); ComponentKey componentKey = new ComponentKey(item.getTargetComponent(), item.user); Loading quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +1 −2 Original line number Diff line number Diff line Loading @@ -187,8 +187,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { @Override public void bindPredictedItems(List<AppInfo> appInfos, IntArray ranks) { super.bindPredictedItems(appInfos, ranks); if (mHotseatPredictionController != null && !mHotseatPredictionController.hasPredictions()) { if (mHotseatPredictionController != null) { mHotseatPredictionController.showCachedItems(appInfos, ranks); } } Loading src/com/android/launcher3/logging/StatsLogManager.java +13 −2 Original line number Diff line number Diff line Loading @@ -130,9 +130,20 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_ALL_APPS_EDU_SHOWN(523), @UiEvent(doc = "User opened a folder.") LAUNCHER_FOLDER_OPEN(551); // ADD MORE LAUNCHER_FOLDER_OPEN(551), @UiEvent(doc = "Hotseat education half sheet seen") LAUNCHER_HOTSEAT_EDU_SEEN(479), @UiEvent(doc = "Hotseat migration accepted") LAUNCHER_HOTSEAT_EDU_ACCEPT(480), @UiEvent(doc = "Hotseat migration denied") LAUNCHER_HOTSEAT_EDU_DENY(481), @UiEvent(doc = "Hotseat education tip shown") LAUNCHER_HOTSEAT_EDU_ONLY_TIP(482); // ADD MORE private final int mId; LauncherEvent(int id) { Loading Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduController.java +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ */ package com.android.launcher3.hybridhotseat; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent .LAUNCHER_HOTSEAT_EDU_ONLY_TIP; import android.content.Intent; import android.view.View; Loading Loading @@ -262,6 +265,7 @@ public class HotseatEduController { requiresMigration ? R.string.hotseat_tip_no_empty_slots : R.string.hotseat_auto_enrolled), mHotseat.getTop()); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_ONLY_TIP); finishOnboarding(); } } Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java +7 −43 Original line number Diff line number Diff line Loading @@ -15,9 +15,10 @@ */ 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 static com.android.launcher3.logging.StatsLogManager.LauncherEvent .LAUNCHER_HOTSEAT_EDU_ACCEPT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_DENY; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_SEEN; import android.animation.PropertyValuesHolder; import android.content.Context; Loading @@ -35,10 +36,8 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.Insettable; import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.Workspace; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.uioverrides.PredictedAppIcon; import com.android.launcher3.userevent.nano.LauncherLogProto; Loading Loading @@ -113,15 +112,13 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable mHotseatEduController.moveHotseatItems(); mHotseatEduController.finishOnboarding(); //TODO: pass actual page index here. // Temporarily we're passing 1 for folder migration and 2 for page migration logUserAction(true, FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get() ? 1 : 2); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_ACCEPT); } private void onDismiss(View v) { mHotseatEduController.showDimissTip(); mHotseatEduController.finishOnboarding(); logUserAction(false, -1); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_DENY); handleClose(true); } Loading Loading @@ -165,39 +162,6 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable } } private void logUserAction(boolean migrated, int pageIndex) { LauncherLogProto.Action action = new LauncherLogProto.Action(); LauncherLogProto.Target target = new LauncherLogProto.Target(); int hotseatItemsCount = mLauncher.getHotseat().getShortcutsAndWidgets().getChildCount(); // -1 to exclude smart space int workspaceItemCount = mLauncher.getWorkspace().getScreenWithId( Workspace.FIRST_SCREEN_ID).getShortcutsAndWidgets().getChildCount() - 1; 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; target.rank = MIGRATION_EXPERIMENT_IDENTIFIER; // encoding migration type on pageIndex target.pageIndex = pageIndex; target.cardinality = (workspaceItemCount * 1000) + hotseatItemsCount; 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; Loading Loading @@ -248,7 +212,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable } AbstractFloatingView.closeAllOpenViews(mLauncher); attachToContainer(); logOnBoardingSeen(); mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_EDU_SEEN); animateOpen(); populatePreview(predictions); } Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +6 −2 Original line number Diff line number Diff line Loading @@ -340,10 +340,14 @@ public class HotseatPredictionController implements DragController.DragListener, * Create WorkspaceItemInfo objects and binds PredictedAppIcon views for cached predicted items. */ public void showCachedItems(List<AppInfo> apps, IntArray ranks) { if (hasPredictions() && mAppPredictor != null) { mAppPredictor.requestPredictionUpdate(); fillGapsWithPrediction(); return; } mIsCacheEmpty = apps.isEmpty(); int count = Math.min(ranks.size(), apps.size()); List<WorkspaceItemInfo> items = new ArrayList<>(count); mComponentKeyMappers.clear(); for (int i = 0; i < count; i++) { WorkspaceItemInfo item = new WorkspaceItemInfo(apps.get(i)); ComponentKey componentKey = new ComponentKey(item.getTargetComponent(), item.user); Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +1 −2 Original line number Diff line number Diff line Loading @@ -187,8 +187,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { @Override public void bindPredictedItems(List<AppInfo> appInfos, IntArray ranks) { super.bindPredictedItems(appInfos, ranks); if (mHotseatPredictionController != null && !mHotseatPredictionController.hasPredictions()) { if (mHotseatPredictionController != null) { mHotseatPredictionController.showCachedItems(appInfos, ranks); } } Loading
src/com/android/launcher3/logging/StatsLogManager.java +13 −2 Original line number Diff line number Diff line Loading @@ -130,9 +130,20 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_ALL_APPS_EDU_SHOWN(523), @UiEvent(doc = "User opened a folder.") LAUNCHER_FOLDER_OPEN(551); // ADD MORE LAUNCHER_FOLDER_OPEN(551), @UiEvent(doc = "Hotseat education half sheet seen") LAUNCHER_HOTSEAT_EDU_SEEN(479), @UiEvent(doc = "Hotseat migration accepted") LAUNCHER_HOTSEAT_EDU_ACCEPT(480), @UiEvent(doc = "Hotseat migration denied") LAUNCHER_HOTSEAT_EDU_DENY(481), @UiEvent(doc = "Hotseat education tip shown") LAUNCHER_HOTSEAT_EDU_ONLY_TIP(482); // ADD MORE private final int mId; LauncherEvent(int id) { Loading