diff options
author | Danning Chen <danningc@google.com> | 2020-04-20 15:16:41 -0700 |
---|---|---|
committer | Danning Chen <danningc@google.com> | 2020-04-21 10:51:20 -0700 |
commit | 07cfaa6b08e99a76c46cda1334f02fca3eb75707 (patch) | |
tree | d9c00175ef035e4230046705dbe6084e3d8697d4 /services/people | |
parent | d53e8618cc5be38e006f0949c1423ab572fddcf2 (diff) |
Keep the conversation shortcut criteria in People Service consistent with the one in Notification Manager
Before this change, People Service uses the presence of the Person object
in ShortcutInfo as the criteria of conversation shortcut. This changes
the criteria that the shortcut needs to be a share shortcut instead of having Person object.
Change-Id: I1ea52a50c909ca96365c1d4e55af97931d048d8f
Test: atest ShortcutHelperTest
Test: atest DataManagerTest
Bug: 154254830
Diffstat (limited to 'services/people')
-rw-r--r-- | services/people/java/com/android/server/people/data/DataManager.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/services/people/java/com/android/server/people/data/DataManager.java b/services/people/java/com/android/server/people/data/DataManager.java index c87ece29800c..763e19bd14ab 100644 --- a/services/people/java/com/android/server/people/data/DataManager.java +++ b/services/people/java/com/android/server/people/data/DataManager.java @@ -67,6 +67,7 @@ import com.android.internal.os.BackgroundThread; import com.android.internal.telephony.SmsApplication; import com.android.server.LocalServices; import com.android.server.notification.NotificationManagerInternal; +import com.android.server.notification.ShortcutHelper; import java.util.ArrayList; import java.util.Collections; @@ -497,10 +498,6 @@ public class DataManager { EventStore.CATEGORY_SHORTCUT_BASED, shortcutId); } - private boolean isPersonShortcut(@NonNull ShortcutInfo shortcutInfo) { - return shortcutInfo.getPersons() != null && shortcutInfo.getPersons().length != 0; - } - @VisibleForTesting @WorkerThread void addOrUpdateConversationInfo(@NonNull ShortcutInfo shortcutInfo) { @@ -712,7 +709,8 @@ public class DataManager { @NonNull List<ShortcutInfo> shortcuts, @NonNull UserHandle user) { mInjector.getBackgroundExecutor().execute(() -> { for (ShortcutInfo shortcut : shortcuts) { - if (isPersonShortcut(shortcut)) { + if (ShortcutHelper.isConversationShortcut( + shortcut, mShortcutServiceInternal, user.getIdentifier())) { addOrUpdateConversationInfo(shortcut); } } |