- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
34 lines
1.3 KiB
Java
34 lines
1.3 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;
|
|
|
|
@RequiresApi(26)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
/* loaded from: classes.dex */
|
|
class NotificationApiHelperForO {
|
|
public static boolean isChannelEnabled(NotificationManager notificationManager, String str) {
|
|
NotificationChannel notificationChannel = notificationManager.getNotificationChannel(str);
|
|
return notificationChannel == null || notificationChannel.getImportance() != 0;
|
|
}
|
|
|
|
@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();
|
|
}
|
|
|
|
private NotificationApiHelperForO() {
|
|
}
|
|
}
|