Skip to content

Commit

Permalink
Patch androidx.core.NotificationCompat.BubbleMetadata.toPlatform
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Apr 25, 2024
1 parent 21d4562 commit 596d9b5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/src/main/java/androidx/core/NotificationCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -8496,14 +8496,15 @@ public void setFlags(int flags) {
* is non-null, otherwise null.
*/
public static @Nullable android.app.Notification.BubbleMetadata toPlatform(
@Nullable BubbleMetadata compatMetadata) {
@Nullable BubbleMetadata compatMetadata,
@NonNull Context context) {
if (compatMetadata == null) {
return null;
}
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.toPlatform(compatMetadata);
return Api30Impl.toPlatform(compatMetadata, context);
} else if (Build.VERSION.SDK_INT == 29) {
return Api29Impl.toPlatform(compatMetadata);
return Api29Impl.toPlatform(compatMetadata, context);
}
return null;
}
Expand Down Expand Up @@ -8779,7 +8780,8 @@ private Api29Impl() {
*/
@RequiresApi(29)
@Nullable static android.app.Notification.BubbleMetadata toPlatform(
@Nullable BubbleMetadata compatMetadata) {
@Nullable BubbleMetadata compatMetadata,
@NonNull Context context) {
if (compatMetadata == null) {
return null;
}
Expand All @@ -8790,7 +8792,7 @@ private Api29Impl() {

android.app.Notification.BubbleMetadata.Builder platformMetadataBuilder =
new android.app.Notification.BubbleMetadata.Builder()
.setIcon(compatMetadata.getIcon().toIcon())
.setIcon(compatMetadata.getIcon().toIcon(context))
.setIntent(compatMetadata.getIntent())
.setDeleteIntent(compatMetadata.getDeleteIntent())
.setAutoExpandBubble(compatMetadata.getAutoExpandBubble())
Expand Down Expand Up @@ -8862,7 +8864,8 @@ private Api30Impl() {
*/
@RequiresApi(30)
@Nullable static android.app.Notification.BubbleMetadata toPlatform(
@Nullable BubbleMetadata compatMetadata) {
@Nullable BubbleMetadata compatMetadata,
@NonNull Context context) {
if (compatMetadata == null) {
return null;
}
Expand All @@ -8874,7 +8877,7 @@ private Api30Impl() {
} else {
platformMetadataBuilder =
new android.app.Notification.BubbleMetadata.Builder(
compatMetadata.getIntent(), compatMetadata.getIcon().toIcon());
compatMetadata.getIntent(), compatMetadata.getIcon().toIcon(context));
}
platformMetadataBuilder
.setDeleteIntent(compatMetadata.getDeleteIntent())
Expand Down

0 comments on commit 596d9b5

Please sign in to comment.