Loading src/com/android/launcher3/logging/StatsLogManager.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -43,6 +43,9 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "Task launched from overview using TAP") @UiEvent(doc = "Task launched from overview using TAP") LAUNCHER_TASK_LAUNCH_TAP(339), LAUNCHER_TASK_LAUNCH_TAP(339), @UiEvent(doc = "User tapped on notification inside popup context menu.") LAUNCHER_NOTIFICATION_LAUNCH_TAP(516), @UiEvent(doc = "Task launched from overview using SWIPE DOWN") @UiEvent(doc = "Task launched from overview using SWIPE DOWN") LAUNCHER_TASK_LAUNCH_SWIPE_DOWN(340), LAUNCHER_TASK_LAUNCH_SWIPE_DOWN(340), Loading Loading @@ -101,7 +104,7 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS(517), LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS(517), @UiEvent(doc = "User opened package specific widgets list by tapping on widgets system " @UiEvent(doc = "User opened package specific widgets list by tapping on widgets system " + "shortcut within longpress popup window.") + "shortcut inside popup context menu.") LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP(514), LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP(514), @UiEvent(doc = "User tapped on app info system shortcut.") @UiEvent(doc = "User tapped on app info system shortcut.") Loading src/com/android/launcher3/notification/NotificationInfo.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.launcher3.notification; package com.android.launcher3.notification; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_LAUNCH_TAP; import android.app.ActivityOptions; import android.app.ActivityOptions; import android.app.Notification; import android.app.Notification; import android.app.PendingIntent; import android.app.PendingIntent; Loading @@ -32,6 +34,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherAppState; import com.android.launcher3.dot.DotInfo; import com.android.launcher3.dot.DotInfo; import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.PackageUserKey; /** /** Loading @@ -51,6 +54,7 @@ public class NotificationInfo implements View.OnClickListener { public final boolean autoCancel; public final boolean autoCancel; public final boolean dismissable; public final boolean dismissable; private final ItemInfo mItemInfo; private Drawable mIconDrawable; private Drawable mIconDrawable; private int mIconColor; private int mIconColor; private boolean mIsIconLarge; private boolean mIsIconLarge; Loading @@ -58,7 +62,8 @@ public class NotificationInfo implements View.OnClickListener { /** /** * Extracts the data that we need from the StatusBarNotification. * Extracts the data that we need from the StatusBarNotification. */ */ public NotificationInfo(Context context, StatusBarNotification statusBarNotification) { public NotificationInfo(Context context, StatusBarNotification statusBarNotification, ItemInfo itemInfo) { packageUserKey = PackageUserKey.fromNotification(statusBarNotification); packageUserKey = PackageUserKey.fromNotification(statusBarNotification); notificationKey = statusBarNotification.getKey(); notificationKey = statusBarNotification.getKey(); Notification notification = statusBarNotification.getNotification(); Notification notification = statusBarNotification.getNotification(); Loading Loading @@ -88,6 +93,7 @@ public class NotificationInfo implements View.OnClickListener { intent = notification.contentIntent; intent = notification.contentIntent; autoCancel = (notification.flags & Notification.FLAG_AUTO_CANCEL) != 0; autoCancel = (notification.flags & Notification.FLAG_AUTO_CANCEL) != 0; dismissable = (notification.flags & Notification.FLAG_ONGOING_EVENT) == 0; dismissable = (notification.flags & Notification.FLAG_ONGOING_EVENT) == 0; this.mItemInfo = itemInfo; } } @Override @Override Loading @@ -101,6 +107,8 @@ public class NotificationInfo implements View.OnClickListener { try { try { intent.send(null, 0, null, null, null, null, activityOptions); intent.send(null, 0, null, null, null, null, activityOptions); launcher.getUserEventDispatcher().logNotificationLaunch(view, intent); launcher.getUserEventDispatcher().logNotificationLaunch(view, intent); launcher.getStatsLogManager() .log(LAUNCHER_NOTIFICATION_LAUNCH_TAP, mItemInfo.buildProto()); } catch (PendingIntent.CanceledException e) { } catch (PendingIntent.CanceledException e) { e.printStackTrace(); e.printStackTrace(); } } Loading src/com/android/launcher3/popup/PopupPopulator.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -144,7 +144,7 @@ public class PopupPopulator { infos = Collections.emptyList(); infos = Collections.emptyList(); } else { } else { infos = notificationListener.getNotificationsForKeys(notificationKeys).stream() infos = notificationListener.getNotificationsForKeys(notificationKeys).stream() .map(sbn -> new NotificationInfo(launcher, sbn)) .map(sbn -> new NotificationInfo(launcher, sbn, originalInfo)) .collect(Collectors.toList()); .collect(Collectors.toList()); } } uiHandler.post(() -> container.applyNotificationInfos(infos)); uiHandler.post(() -> container.applyNotificationInfos(infos)); Loading Loading
src/com/android/launcher3/logging/StatsLogManager.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -43,6 +43,9 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "Task launched from overview using TAP") @UiEvent(doc = "Task launched from overview using TAP") LAUNCHER_TASK_LAUNCH_TAP(339), LAUNCHER_TASK_LAUNCH_TAP(339), @UiEvent(doc = "User tapped on notification inside popup context menu.") LAUNCHER_NOTIFICATION_LAUNCH_TAP(516), @UiEvent(doc = "Task launched from overview using SWIPE DOWN") @UiEvent(doc = "Task launched from overview using SWIPE DOWN") LAUNCHER_TASK_LAUNCH_SWIPE_DOWN(340), LAUNCHER_TASK_LAUNCH_SWIPE_DOWN(340), Loading Loading @@ -101,7 +104,7 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS(517), LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS(517), @UiEvent(doc = "User opened package specific widgets list by tapping on widgets system " @UiEvent(doc = "User opened package specific widgets list by tapping on widgets system " + "shortcut within longpress popup window.") + "shortcut inside popup context menu.") LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP(514), LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP(514), @UiEvent(doc = "User tapped on app info system shortcut.") @UiEvent(doc = "User tapped on app info system shortcut.") Loading
src/com/android/launcher3/notification/NotificationInfo.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.launcher3.notification; package com.android.launcher3.notification; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_LAUNCH_TAP; import android.app.ActivityOptions; import android.app.ActivityOptions; import android.app.Notification; import android.app.Notification; import android.app.PendingIntent; import android.app.PendingIntent; Loading @@ -32,6 +34,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherAppState; import com.android.launcher3.dot.DotInfo; import com.android.launcher3.dot.DotInfo; import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.PackageUserKey; /** /** Loading @@ -51,6 +54,7 @@ public class NotificationInfo implements View.OnClickListener { public final boolean autoCancel; public final boolean autoCancel; public final boolean dismissable; public final boolean dismissable; private final ItemInfo mItemInfo; private Drawable mIconDrawable; private Drawable mIconDrawable; private int mIconColor; private int mIconColor; private boolean mIsIconLarge; private boolean mIsIconLarge; Loading @@ -58,7 +62,8 @@ public class NotificationInfo implements View.OnClickListener { /** /** * Extracts the data that we need from the StatusBarNotification. * Extracts the data that we need from the StatusBarNotification. */ */ public NotificationInfo(Context context, StatusBarNotification statusBarNotification) { public NotificationInfo(Context context, StatusBarNotification statusBarNotification, ItemInfo itemInfo) { packageUserKey = PackageUserKey.fromNotification(statusBarNotification); packageUserKey = PackageUserKey.fromNotification(statusBarNotification); notificationKey = statusBarNotification.getKey(); notificationKey = statusBarNotification.getKey(); Notification notification = statusBarNotification.getNotification(); Notification notification = statusBarNotification.getNotification(); Loading Loading @@ -88,6 +93,7 @@ public class NotificationInfo implements View.OnClickListener { intent = notification.contentIntent; intent = notification.contentIntent; autoCancel = (notification.flags & Notification.FLAG_AUTO_CANCEL) != 0; autoCancel = (notification.flags & Notification.FLAG_AUTO_CANCEL) != 0; dismissable = (notification.flags & Notification.FLAG_ONGOING_EVENT) == 0; dismissable = (notification.flags & Notification.FLAG_ONGOING_EVENT) == 0; this.mItemInfo = itemInfo; } } @Override @Override Loading @@ -101,6 +107,8 @@ public class NotificationInfo implements View.OnClickListener { try { try { intent.send(null, 0, null, null, null, null, activityOptions); intent.send(null, 0, null, null, null, null, activityOptions); launcher.getUserEventDispatcher().logNotificationLaunch(view, intent); launcher.getUserEventDispatcher().logNotificationLaunch(view, intent); launcher.getStatsLogManager() .log(LAUNCHER_NOTIFICATION_LAUNCH_TAP, mItemInfo.buildProto()); } catch (PendingIntent.CanceledException e) { } catch (PendingIntent.CanceledException e) { e.printStackTrace(); e.printStackTrace(); } } Loading
src/com/android/launcher3/popup/PopupPopulator.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -144,7 +144,7 @@ public class PopupPopulator { infos = Collections.emptyList(); infos = Collections.emptyList(); } else { } else { infos = notificationListener.getNotificationsForKeys(notificationKeys).stream() infos = notificationListener.getNotificationsForKeys(notificationKeys).stream() .map(sbn -> new NotificationInfo(launcher, sbn)) .map(sbn -> new NotificationInfo(launcher, sbn, originalInfo)) .collect(Collectors.toList()); .collect(Collectors.toList()); } } uiHandler.post(() -> container.applyNotificationInfos(infos)); uiHandler.post(() -> container.applyNotificationInfos(infos)); Loading