Merge "Add LAUNCHER_APP_LAUNCH_PENDING_INTENT where an app is launched through pending intent." into udc-d1-dev

This commit is contained in:
Anushree Ganjam
2023-05-30 23:46:24 +00:00
committed by Android (Google) Code Review
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.")
LAUNCHER_TRANSIENT_TASKBAR_SHOW(1331),
@UiEvent(doc = "App launched through pending intent")
LAUNCHER_APP_LAUNCH_PENDING_INTENT(1394),
;
// 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.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_APP_LAUNCH_PENDING_INTENT;
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.util.Executors.MAIN_EXECUTOR;
@@ -305,6 +306,11 @@ public interface ActivityContext {
ActivityOptionsWrapper options = getActivityLaunchOptions(v, item);
try {
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;
} catch (PendingIntent.CanceledException e) {
Toast.makeText(v.getContext(),