Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1086519 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "NotificationChannelExtractor: don't crash on missing AudioAttributes" into main

parents e4017225 8dab255f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -29,8 +29,8 @@ import android.content.Context;
import android.media.AudioAttributes;
import android.os.Binder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Slog;

import com.android.internal.compat.IPlatformCompat;

/**
@@ -79,6 +79,11 @@ public class NotificationChannelExtractor implements NotificationSignalExtractor
        if (restrictAudioAttributesCall() || restrictAudioAttributesAlarm()
                || restrictAudioAttributesMedia()) {
            AudioAttributes attributes = record.getChannel().getAudioAttributes();
            if (attributes == null) {
                if (DBG) Slog.d(TAG, "missing AudioAttributes");
                return null;
            }

            boolean updateAttributes =  false;
            if (restrictAudioAttributesCall()
                    && !record.getNotification().isStyle(Notification.CallStyle.class)