summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2017-12-20 13:32:01 -0800
committerEric Erfanian <erfanian@google.com>2017-12-22 08:54:29 -0800
commit7c711fa89ab258e946b2440d94215de8ec18cb36 (patch)
treeb332e17bdbded25b9338c9f8ef69bf0910394953
parent705c152bc910125064459c5808334d8cad00536c (diff)
Fixed crash in PinnedShortcuts.
It was expecting only shortcuts for contacts but we also have the "NUI Launcher" shortcut now, so ignore it when attempting to update. Test: unit PiperOrigin-RevId: 179726507 Change-Id: I45e1594250ed70fcd1d18bfead5a9b4e9e46a58b
-rw-r--r--java/com/android/dialer/shortcuts/PinnedShortcuts.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/java/com/android/dialer/shortcuts/PinnedShortcuts.java b/java/com/android/dialer/shortcuts/PinnedShortcuts.java
index bfcc3df81..6e23a5c21 100644
--- a/java/com/android/dialer/shortcuts/PinnedShortcuts.java
+++ b/java/com/android/dialer/shortcuts/PinnedShortcuts.java
@@ -46,7 +46,6 @@ import java.util.Map;
* <p>When refreshing pinned shortcuts, we check to make sure that pinned contact information is
* still up to date (e.g. photo and name). We also check to see if the contact has been deleted from
* the user's contacts, and if so, we disable the pinned shortcut.
- *
*/
@TargetApi(VERSION_CODES.N_MR1) // Shortcuts introduced in N MR1
final class PinnedShortcuts {
@@ -107,6 +106,14 @@ final class PinnedShortcuts {
// setRank is nonsensical for pinned shortcuts and therefore could not be calculated.
continue;
}
+ // Exclude shortcuts like the "Phone NUI" shortcut.
+ String action = null;
+ if (shortcutInfo.getIntent() != null) {
+ action = shortcutInfo.getIntent().getAction();
+ }
+ if (action == null || !action.equals("com.android.dialer.shortcuts.CALL_CONTACT")) {
+ continue;
+ }
String lookupKey = DialerShortcut.getLookupKeyFromShortcutInfo(shortcutInfo);
Uri lookupUri = DialerShortcut.getLookupUriFromShortcutInfo(shortcutInfo);