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

Commit 67f36a35 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed NPE when OsAppId is null in traffic descriptor

Fix: 225373655
Test: Manual
Merged-In: I45b993c4dd444d1834b41b0825bcff021ee94f66
Change-Id: I45b993c4dd444d1834b41b0825bcff021ee94f66
parent 43e4e0cf
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1587,6 +1587,7 @@ public class DataNetwork extends StateMachine {
        // Extract network capabilities from the traffic descriptor.
        for (TrafficDescriptor trafficDescriptor : mTrafficDescriptors) {
            try {
                if (trafficDescriptor.getOsAppId() == null) continue;
                OsAppId osAppId = new OsAppId(trafficDescriptor.getOsAppId());
                if (!osAppId.getOsId().equals(OsAppId.ANDROID_OS_ID)) {
                    loge("Received non-Android OS id " + osAppId.getOsId());
@@ -1597,10 +1598,7 @@ public class DataNetwork extends StateMachine {
                switch (networkCapability) {
                    case NetworkCapabilities.NET_CAPABILITY_ENTERPRISE:
                        builder.addCapability(networkCapability);
                        // Enterprise is the only capability supporting differentiator.
                        if (networkCapability == NetworkCapabilities.NET_CAPABILITY_ENTERPRISE) {
                        builder.addEnterpriseId(osAppId.getDifferentiator());
                        }
                        break;
                    case NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_LATENCY:
                    case NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_BANDWIDTH: