summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/notification/NotificationKeyData.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2019-08-21 02:25:20 -0700
committerHyunyoung Song <hyunyoungs@google.com>2019-08-21 22:20:03 +0000
commit227daf0108bc5769d9bb8bec88b0c2bb8ada96b2 (patch)
treebaee44af7cf46e3d6af195d1038a748eea6149ff /src/com/android/launcher3/notification/NotificationKeyData.java
parent63b2cbc0c7515ca3d34fd8503e6c3f87e5f34162 (diff)
parentd88f63bbed4c4c1e7eace9ab8c25e89ad6c662c9 (diff)
downloadandroid_packages_apps_Trebuchet-227daf0108bc5769d9bb8bec88b0c2bb8ada96b2.tar.gz
android_packages_apps_Trebuchet-227daf0108bc5769d9bb8bec88b0c2bb8ada96b2.tar.bz2
android_packages_apps_Trebuchet-227daf0108bc5769d9bb8bec88b0c2bb8ada96b2.zip
ub-launcher3-qt-qpr1-dev @ build 5818303
Test: presubmit setup on source branch Bug: 112282235 Starting an app from Launcher sometimes takes > 10 sec Bug: 125027540 Apps to be searchable in different languages Bug: 132336512 Notification dots on pinned shortcuts Bug: 135218095 Disable unnecessary services Bug: 136277517 Widgets often don’t support scroll direction up/down, left/right and use forward/backward instead Bug: 137777105 Make clearcut launcher logging feature parity with westworld logging Bug: 137952354 OnResume() and onStop logging doesn't reflect the real source id for -1 screen Bug: 137953006 Swiping/fling up from workspace logged as hotseat Bug: 138273985 The pause app message takes more than 30 seconds to display after restarting the device. Bug: 138683199 Pass the captured snapshot data to Launcher when recents animation is cancelled Bug: 138729456 [Flaky test] java.lang.AssertionError: http://go/tapl : Can't find an object with selector: BySelector [CLASS='\Qandroid.widget.TextView\E', PKG='\Qcom.google.android.apps.nexuslauncher\E', TEXT='\QShortcut 3\E'] (visible state: Workspace) Bug: 138743758 [Flaky test] java.lang.AssertionError: App still doesn't have Pause action: com.google.android.calculator Bug: 138743792 [Flaky test] java.lang.AssertionError: ensureScrollable didn't add Chrome app Bug: 138964490 Investigate if ToggleableFlags can be connected with DeviceConfig Bug: 139416391 CTS tests crash when app_prediction service is disabled Bug: 139498375 Flake: java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission Bug: 139540363 Launcher goes in crash loop Change-Id: Iaba4ed67e9fe4f8f5858324201e4c4e8711f59fa
Diffstat (limited to 'src/com/android/launcher3/notification/NotificationKeyData.java')
-rw-r--r--src/com/android/launcher3/notification/NotificationKeyData.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/com/android/launcher3/notification/NotificationKeyData.java b/src/com/android/launcher3/notification/NotificationKeyData.java
index 5050457b9..bfa4ba9ab 100644
--- a/src/com/android/launcher3/notification/NotificationKeyData.java
+++ b/src/com/android/launcher3/notification/NotificationKeyData.java
@@ -17,12 +17,18 @@
package com.android.launcher3.notification;
import android.app.Notification;
+import android.app.Person;
import android.service.notification.StatusBarNotification;
+import com.android.launcher3.Utilities;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
/**
* The key data associated with the notification, used to determine what to include
@@ -34,19 +40,25 @@ public class NotificationKeyData {
public final String notificationKey;
public final String shortcutId;
public int count;
+ @NonNull public final String[] personKeysFromNotification;
- private NotificationKeyData(String notificationKey, String shortcutId, int count) {
+ private NotificationKeyData(String notificationKey, String shortcutId, int count,
+ String[] personKeysFromNotification) {
this.notificationKey = notificationKey;
this.shortcutId = shortcutId;
this.count = Math.max(1, count);
+ this.personKeysFromNotification = personKeysFromNotification;
}
public static NotificationKeyData fromNotification(StatusBarNotification sbn) {
Notification notif = sbn.getNotification();
- return new NotificationKeyData(sbn.getKey(), notif.getShortcutId(), notif.number);
+ return new NotificationKeyData(sbn.getKey(), notif.getShortcutId(), notif.number,
+ extractPersonKeyOnly(notif.extras.getParcelableArrayList(
+ Notification.EXTRA_PEOPLE_LIST)));
}
- public static List<String> extractKeysOnly(@NonNull List<NotificationKeyData> notificationKeys) {
+ public static List<String> extractKeysOnly(
+ @NonNull List<NotificationKeyData> notificationKeys) {
List<String> keysOnly = new ArrayList<>(notificationKeys.size());
for (NotificationKeyData notificationKeyData : notificationKeys) {
keysOnly.add(notificationKeyData.notificationKey);
@@ -54,6 +66,13 @@ public class NotificationKeyData {
return keysOnly;
}
+ private static String[] extractPersonKeyOnly(@Nullable ArrayList<Person> people) {
+ if (people == null || people.isEmpty()) {
+ return Utilities.EMPTY_STRING_ARRAY;
+ }
+ return people.stream().map(Person::getKey).sorted().toArray(String[]::new);
+ }
+
@Override
public boolean equals(Object obj) {
if (!(obj instanceof NotificationKeyData)) {