mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-15 18:37:17 +01:00
34 lines
1.4 KiB
Java
34 lines
1.4 KiB
Java
package androidx.browser.trusted;
|
|
|
|
import android.app.Notification;
|
|
import android.app.NotificationChannel;
|
|
import android.app.NotificationManager;
|
|
import android.content.Context;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.annotation.RestrictTo;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@RequiresApi(26)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
/* loaded from: classes.dex */
|
|
class NotificationApiHelperForO {
|
|
private NotificationApiHelperForO() {
|
|
}
|
|
|
|
@Nullable
|
|
public static Notification copyNotificationOntoChannel(Context context, NotificationManager notificationManager, Notification notification, String str, String str2) {
|
|
notificationManager.createNotificationChannel(new NotificationChannel(str, str2, 3));
|
|
if (notificationManager.getNotificationChannel(str).getImportance() == 0) {
|
|
return null;
|
|
}
|
|
Notification.Builder recoverBuilder = Notification.Builder.recoverBuilder(context, notification);
|
|
recoverBuilder.setChannelId(str);
|
|
return recoverBuilder.build();
|
|
}
|
|
|
|
public static boolean isChannelEnabled(NotificationManager notificationManager, String str) {
|
|
NotificationChannel notificationChannel = notificationManager.getNotificationChannel(str);
|
|
return notificationChannel == null || notificationChannel.getImportance() != 0;
|
|
}
|
|
}
|