2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.utilities.fcm;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
import androidx.core.app.NotificationCompat;
|
2021-09-15 06:33:54 +00:00
|
|
|
import androidx.core.graphics.drawable.IconCompat;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.utilities.fcm.NotificationData;
|
|
|
|
import com.discord.utilities.images.MGImagesBitmap;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.util.List;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: NotificationRenderer.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes2.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public final class NotificationRenderer$displayAndUpdateCache$7 extends o implements Function1<MGImagesBitmap.CloseableBitmaps, Unit> {
|
|
|
|
public final /* synthetic */ Context $context;
|
|
|
|
public final /* synthetic */ NotificationData.DisplayPayload $displayPayload;
|
|
|
|
public final /* synthetic */ List $displayPayloadExtras;
|
|
|
|
public final /* synthetic */ NotificationData $notification;
|
|
|
|
public final /* synthetic */ NotificationCompat.Builder $notificationBuilder;
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
2021-08-03 07:33:18 +00:00
|
|
|
public NotificationRenderer$displayAndUpdateCache$7(NotificationData notificationData, NotificationCompat.Builder builder, List list, Context context, NotificationData.DisplayPayload displayPayload) {
|
|
|
|
super(1);
|
|
|
|
this.$notification = notificationData;
|
|
|
|
this.$notificationBuilder = builder;
|
|
|
|
this.$displayPayloadExtras = list;
|
|
|
|
this.$context = context;
|
|
|
|
this.$displayPayload = displayPayload;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(MGImagesBitmap.CloseableBitmaps closeableBitmaps) {
|
2022-03-07 09:34:54 +00:00
|
|
|
invoke2(closeableBitmaps);
|
2021-08-03 07:33:18 +00:00
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
/* renamed from: invoke reason: avoid collision after fix types in other method */
|
|
|
|
public final void invoke2(MGImagesBitmap.CloseableBitmaps closeableBitmaps) {
|
|
|
|
try {
|
|
|
|
Bitmap bitmap = (Bitmap) closeableBitmaps.get((Object) this.$notification.getIconUrl());
|
|
|
|
if (bitmap != null) {
|
|
|
|
this.$notificationBuilder.setLargeIcon(bitmap);
|
|
|
|
}
|
|
|
|
Throwable th = null;
|
|
|
|
if (!this.$displayPayloadExtras.isEmpty()) {
|
|
|
|
this.$notificationBuilder.setNumber(this.$displayPayloadExtras.size());
|
|
|
|
NotificationCompat.Builder builder = this.$notificationBuilder;
|
|
|
|
NotificationRenderer notificationRenderer = NotificationRenderer.INSTANCE;
|
|
|
|
Context context = this.$context;
|
|
|
|
NotificationData notificationData = this.$notification;
|
|
|
|
List list = this.$displayPayloadExtras;
|
|
|
|
m.checkNotNullExpressionValue(closeableBitmaps, "bitmapsForIconUris");
|
|
|
|
builder.setStyle(NotificationRenderer.access$getMessageStyle(notificationRenderer, context, notificationData, list, closeableBitmaps));
|
|
|
|
NotificationRenderer.access$pushShortcut(notificationRenderer, this.$context, this.$notification, this.$notificationBuilder, bitmap != null ? IconCompat.createWithBitmap(bitmap) : th);
|
|
|
|
}
|
|
|
|
NotificationRenderer.access$displayNotification(NotificationRenderer.INSTANCE, this.$context, this.$displayPayload.getId(), this.$notificationBuilder);
|
|
|
|
} finally {
|
|
|
|
try {
|
|
|
|
throw th;
|
|
|
|
} finally {
|
|
|
|
}
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|