summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-06-11 18:41:57 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-11 18:41:57 +0000
commitbf52673a6aa3f239f66f017d1161d22d603c20e4 (patch)
treeff383800b1892161c64ddcd53d09e60d0afe721e
parentbdac8459fb10306464155f42e58ec0c69557f996 (diff)
parent0561690cacbaa471d254ac6ce3109c7bc6924566 (diff)
Merge "Apply theme shape clipping to group convo avatars" into rvc-dev am: 0561690cac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11820082 Change-Id: Icc00a6f35213958cb5badfb4e7311e646608b1bf
-rw-r--r--core/java/android/app/Notification.java1
-rw-r--r--core/java/android/content/pm/LauncherApps.java32
-rw-r--r--core/java/com/android/internal/widget/ConversationLayout.java4
3 files changed, 27 insertions, 10 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index f881616fd35a..0e3f35e358c0 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -7495,6 +7495,7 @@ public class Notification implements Parcelable
mHistoricMessages = Message.getMessagesFromBundleArray(histMessages);
mIsGroupConversation = extras.getBoolean(EXTRA_IS_GROUP_CONVERSATION);
mUnreadMessageCount = extras.getInt(EXTRA_CONVERSATION_UNREAD_MESSAGE_COUNT);
+ mShortcutIcon = extras.getParcelable(EXTRA_CONVERSATION_ICON);
}
/**
diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java
index bd1ee27ece9e..1a694b34474a 100644
--- a/core/java/android/content/pm/LauncherApps.java
+++ b/core/java/android/content/pm/LauncherApps.java
@@ -1243,14 +1243,7 @@ public class LauncherApps {
private ParcelFileDescriptor getUriShortcutIconFd(@NonNull String packageName,
@NonNull String shortcutId, int userId) {
- String uri = null;
- try {
- uri = mService.getShortcutIconUri(mContext.getPackageName(), packageName, shortcutId,
- userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
-
+ String uri = getShortcutIconUri(packageName, shortcutId, userId);
if (uri == null) {
return null;
}
@@ -1262,6 +1255,18 @@ public class LauncherApps {
}
}
+ private String getShortcutIconUri(@NonNull String packageName,
+ @NonNull String shortcutId, int userId) {
+ String uri = null;
+ try {
+ uri = mService.getShortcutIconUri(mContext.getPackageName(), packageName, shortcutId,
+ userId);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ return uri;
+ }
+
/**
* Returns the icon for this shortcut, without any badging for the profile.
*
@@ -1357,6 +1362,17 @@ public class LauncherApps {
} catch (IOException ignore) {
}
}
+ } else if (shortcut.hasIconUri()) {
+ String uri = getShortcutIconUri(shortcut.getPackage(), shortcut.getId(),
+ shortcut.getUserId());
+ if (uri == null) {
+ return null;
+ }
+ if (shortcut.hasAdaptiveBitmap()) {
+ return Icon.createWithAdaptiveBitmapContentUri(uri);
+ } else {
+ return Icon.createWithContentUri(uri);
+ }
} else if (shortcut.hasIconResource()) {
return Icon.createWithResource(shortcut.getPackage(), shortcut.getIconResourceId());
} else {
diff --git a/core/java/com/android/internal/widget/ConversationLayout.java b/core/java/com/android/internal/widget/ConversationLayout.java
index 851aa10df459..b64923fb5bf8 100644
--- a/core/java/com/android/internal/widget/ConversationLayout.java
+++ b/core/java/com/android/internal/widget/ConversationLayout.java
@@ -785,8 +785,8 @@ public class ConversationLayout extends FrameLayout
}
@RemotableViewMethod
- public void setShortcutIcon(Icon conversationIcon) {
- mConversationIcon = conversationIcon;
+ public void setShortcutIcon(Icon shortcutIcon) {
+ mShortcutIcon = shortcutIcon;
}
/**