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

Commit 71cd7e3c authored by Varun Shah's avatar Varun Shah
Browse files

Ensure notification is attached before checking its channel.

Fixes: 333219165
Test: atest CtsAppTestCases
Change-Id: Ia73091544021f36b34b246d8790385bfd8a31fbe
parent 057d218e
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -835,7 +835,8 @@ public final class ActiveServices {
            for (int i = 0; i < smap.mServicesByInstanceName.size(); i++) {
            for (int i = 0; i < smap.mServicesByInstanceName.size(); i++) {
                final ServiceRecord sr = smap.mServicesByInstanceName.valueAt(i);
                final ServiceRecord sr = smap.mServicesByInstanceName.valueAt(i);
                if (sr.appInfo.packageName.equals(pkg) && sr.isForeground) {
                if (sr.appInfo.packageName.equals(pkg) && sr.isForeground) {
                    if (Objects.equals(sr.foregroundNoti.getChannelId(), channelId)) {
                    if (sr.foregroundNoti != null
                            && Objects.equals(sr.foregroundNoti.getChannelId(), channelId)) {
                        if (DEBUG_FOREGROUND_SERVICE) {
                        if (DEBUG_FOREGROUND_SERVICE) {
                            Slog.d(TAG_SERVICE, "Channel u" + userId + "/pkg=" + pkg
                            Slog.d(TAG_SERVICE, "Channel u" + userId + "/pkg=" + pkg
                                    + "/channelId=" + channelId
                                    + "/channelId=" + channelId