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

Commit cb5d80f4 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed NPE when OsAppId is null in traffic descriptor

Fix: 225373655
Test: Manual
Change-Id: I45b993c4dd444d1834b41b0825bcff021ee94f66
parent 098b9ead
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1558,6 +1558,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());
@@ -1568,10 +1569,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: