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

Commit e1b9dcc5 authored by Yan Yan's avatar Yan Yan
Browse files

Add a null pointer check for getSubscriptionsInGroup

Even though #getSubscriptionsInGroup is marked @NonNull, when the
Phone process crashes and this method is called from the system
process, it will return null.

Bug: 295339956
Test: atest CtsVcnTestCases, FrameworksVcnTests
Change-Id: I9f827f9e47efef08e9905c9cc6947df84651383b
parent a3cd5a9e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -456,7 +456,13 @@ public class VcnManagementService extends IVcnManagementService.Stub {
        final List<SubscriptionInfo> subscriptionInfos = new ArrayList<>();
        Binder.withCleanCallingIdentity(
                () -> {
                    subscriptionInfos.addAll(subMgr.getSubscriptionsInGroup(subscriptionGroup));
                    List<SubscriptionInfo> subsInGroup =
                            subMgr.getSubscriptionsInGroup(subscriptionGroup);
                    if (subsInGroup == null) {
                        logWtf("Received null from getSubscriptionsInGroup");
                        subsInGroup = Collections.emptyList();
                    }
                    subscriptionInfos.addAll(subsInGroup);
                });

        for (SubscriptionInfo info : subscriptionInfos) {