Add LAUNCHER_APP_LAUNCH_PENDING_INTENT where an app is launched through

pending intent.

Bug: Bug: 282236269
Test: Manual
Flag: NA
Change-Id: I6fb15a77f32ce5914f9632f5fb77f340acd3cfda
Merged-In: I6fb15a77f32ce5914f9632f5fb77f340acd3cfda
This commit is contained in:
Anushree Ganjam
2023-05-23 20:15:45 +00:00
parent 57eaf86f8d
commit cfbbf8510c
2 changed files with 9 additions and 0 deletions
@@ -642,6 +642,9 @@ public class StatsLogManager implements ResourceBasedOverride {
@UiEvent(doc = "User has swiped upwards from the gesture handle to show transient taskbar.") @UiEvent(doc = "User has swiped upwards from the gesture handle to show transient taskbar.")
LAUNCHER_TRANSIENT_TASKBAR_SHOW(1331), LAUNCHER_TRANSIENT_TASKBAR_SHOW(1331),
@UiEvent(doc = "App launched through pending intent")
LAUNCHER_APP_LAUNCH_PENDING_INTENT(1394),
; ;
// ADD MORE // ADD MORE
@@ -20,6 +20,7 @@ import static android.window.SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR;
import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON; import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON;
import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.HIDE; import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_PENDING_INTENT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS; import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
@@ -305,6 +306,11 @@ public interface ActivityContext {
ActivityOptionsWrapper options = getActivityLaunchOptions(v, item); ActivityOptionsWrapper options = getActivityLaunchOptions(v, item);
try { try {
intent.send(null, 0, null, null, null, null, options.toBundle()); intent.send(null, 0, null, null, null, null, options.toBundle());
if (item != null) {
InstanceId instanceId = new InstanceIdSequence().newInstanceId();
getStatsLogManager().logger().withItemInfo(item).withInstanceId(instanceId)
.log(LAUNCHER_APP_LAUNCH_PENDING_INTENT);
}
return options.onEndCallback; return options.onEndCallback;
} catch (PendingIntent.CanceledException e) { } catch (PendingIntent.CanceledException e) {
Toast.makeText(v.getContext(), Toast.makeText(v.getContext(),