Loading quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java +23 −7 Original line number Diff line number Diff line Loading @@ -16,11 +16,6 @@ package com.android.quickstep.logging; import android.content.Context; import android.content.Intent; import android.stats.launcher.nano.LauncherExtension; import android.stats.launcher.nano.LauncherTarget; import static android.stats.launcher.nano.Launcher.ALLAPPS; import static android.stats.launcher.nano.Launcher.HOME; import static android.stats.launcher.nano.Launcher.LAUNCH_APP; Loading @@ -29,6 +24,11 @@ import static android.stats.launcher.nano.Launcher.DISMISS_TASK; import static android.stats.launcher.nano.Launcher.BACKGROUND; import static android.stats.launcher.nano.Launcher.OVERVIEW; import android.content.Context; import android.content.Intent; import android.stats.launcher.nano.Launcher; import android.stats.launcher.nano.LauncherExtension; import android.stats.launcher.nano.LauncherTarget; import android.view.View; import com.android.launcher3.ItemInfo; Loading @@ -39,8 +39,6 @@ import com.android.launcher3.util.ComponentKey; import com.android.systemui.shared.system.StatsLogCompat; import com.google.protobuf.nano.MessageNano; import androidx.annotation.Nullable; /** * This method calls the StatsLog hidden method until they are made available public. * Loading Loading @@ -85,6 +83,17 @@ public class StatsLogCompatManager extends StatsLogManager { MessageNano.toByteArray(ext), true); } @Override public void logSwipeOnContainer(boolean isSwipingToLeft, int pageId) { LauncherExtension ext = new LauncherExtension(); ext.srcTarget = new LauncherTarget[1]; int srcState = mStateProvider.getCurrentState(); fillInLauncherExtensionWithPageId(ext, pageId); int launcherAction = isSwipingToLeft ? Launcher.SWIPE_LEFT : Launcher.SWIPE_RIGHT; StatsLogCompat.write(launcherAction, srcState, srcState, MessageNano.toByteArray(ext), true); } public static boolean fillInLauncherExtension(View v, LauncherExtension extension) { StatsLogUtils.LogContainerProvider provider = StatsLogUtils.getLaunchProviderRecursive(v); if (v == null || !(v.getTag() instanceof ItemInfo) || provider == null) { Loading @@ -99,6 +108,13 @@ public class StatsLogCompatManager extends StatsLogManager { return true; } public static boolean fillInLauncherExtensionWithPageId(LauncherExtension ext, int pageId) { Target target = new Target(); target.pageIndex = pageId; copy(target, ext.srcTarget[0]); return true; } private static void copy(Target src, LauncherTarget dst) { // fill in } Loading src/com/android/launcher3/Workspace.java +2 −0 Original line number Diff line number Diff line Loading @@ -1052,6 +1052,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> if (!mOverlayShown) { mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE, Action.Direction.LEFT, ContainerType.WORKSPACE, 0); mLauncher.getStatsLogManager().logSwipeOnContainer(true, 0); } mOverlayShown = true; // Not announcing the overlay page for accessibility since it announces itself. Loading @@ -1061,6 +1062,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> if (!ued.isPreviousHomeGesture()) { mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE, Action.Direction.RIGHT, ContainerType.WORKSPACE, -1); mLauncher.getStatsLogManager().logSwipeOnContainer(false, -1); } } else if (Float.compare(mOverlayTranslation, 0f) != 0) { // When arriving to 0 overscroll from non-zero overscroll, announce page for Loading src/com/android/launcher3/logging/StatsLogManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -41,5 +41,6 @@ public class StatsLogManager implements ResourceBasedOverride { public void logAppLaunch(View v, Intent intent) { } public void logTaskLaunch(View v, ComponentKey key) { } public void logTaskDismiss(View v, ComponentKey key) { } public void logSwipeOnContainer(boolean isSwipingToLeft, int pageId) { } public void verify() {} // TODO: should move into robo tests } Loading
quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java +23 −7 Original line number Diff line number Diff line Loading @@ -16,11 +16,6 @@ package com.android.quickstep.logging; import android.content.Context; import android.content.Intent; import android.stats.launcher.nano.LauncherExtension; import android.stats.launcher.nano.LauncherTarget; import static android.stats.launcher.nano.Launcher.ALLAPPS; import static android.stats.launcher.nano.Launcher.HOME; import static android.stats.launcher.nano.Launcher.LAUNCH_APP; Loading @@ -29,6 +24,11 @@ import static android.stats.launcher.nano.Launcher.DISMISS_TASK; import static android.stats.launcher.nano.Launcher.BACKGROUND; import static android.stats.launcher.nano.Launcher.OVERVIEW; import android.content.Context; import android.content.Intent; import android.stats.launcher.nano.Launcher; import android.stats.launcher.nano.LauncherExtension; import android.stats.launcher.nano.LauncherTarget; import android.view.View; import com.android.launcher3.ItemInfo; Loading @@ -39,8 +39,6 @@ import com.android.launcher3.util.ComponentKey; import com.android.systemui.shared.system.StatsLogCompat; import com.google.protobuf.nano.MessageNano; import androidx.annotation.Nullable; /** * This method calls the StatsLog hidden method until they are made available public. * Loading Loading @@ -85,6 +83,17 @@ public class StatsLogCompatManager extends StatsLogManager { MessageNano.toByteArray(ext), true); } @Override public void logSwipeOnContainer(boolean isSwipingToLeft, int pageId) { LauncherExtension ext = new LauncherExtension(); ext.srcTarget = new LauncherTarget[1]; int srcState = mStateProvider.getCurrentState(); fillInLauncherExtensionWithPageId(ext, pageId); int launcherAction = isSwipingToLeft ? Launcher.SWIPE_LEFT : Launcher.SWIPE_RIGHT; StatsLogCompat.write(launcherAction, srcState, srcState, MessageNano.toByteArray(ext), true); } public static boolean fillInLauncherExtension(View v, LauncherExtension extension) { StatsLogUtils.LogContainerProvider provider = StatsLogUtils.getLaunchProviderRecursive(v); if (v == null || !(v.getTag() instanceof ItemInfo) || provider == null) { Loading @@ -99,6 +108,13 @@ public class StatsLogCompatManager extends StatsLogManager { return true; } public static boolean fillInLauncherExtensionWithPageId(LauncherExtension ext, int pageId) { Target target = new Target(); target.pageIndex = pageId; copy(target, ext.srcTarget[0]); return true; } private static void copy(Target src, LauncherTarget dst) { // fill in } Loading
src/com/android/launcher3/Workspace.java +2 −0 Original line number Diff line number Diff line Loading @@ -1052,6 +1052,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> if (!mOverlayShown) { mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE, Action.Direction.LEFT, ContainerType.WORKSPACE, 0); mLauncher.getStatsLogManager().logSwipeOnContainer(true, 0); } mOverlayShown = true; // Not announcing the overlay page for accessibility since it announces itself. Loading @@ -1061,6 +1062,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> if (!ued.isPreviousHomeGesture()) { mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE, Action.Direction.RIGHT, ContainerType.WORKSPACE, -1); mLauncher.getStatsLogManager().logSwipeOnContainer(false, -1); } } else if (Float.compare(mOverlayTranslation, 0f) != 0) { // When arriving to 0 overscroll from non-zero overscroll, announce page for Loading
src/com/android/launcher3/logging/StatsLogManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -41,5 +41,6 @@ public class StatsLogManager implements ResourceBasedOverride { public void logAppLaunch(View v, Intent intent) { } public void logTaskLaunch(View v, ComponentKey key) { } public void logTaskDismiss(View v, ComponentKey key) { } public void logSwipeOnContainer(boolean isSwipingToLeft, int pageId) { } public void verify() {} // TODO: should move into robo tests }