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

Commit 1b3b8f19 authored by tobitege's avatar tobitege Committed by Gerrit Code Review
Browse files

Fix NPE in NetdResponseCode.InterfaceClassActivity

Under circumstances the 4th param is null and causes NPE.
Exception looks like this in logcat:
E/NetdConnector( 1086): Error handling '613 IfaceClass idle (null)':
java.lang.NumberFormatException: Invalid int: "(null)"

Change-Id: Id1bbbeeec8452e7103c4213be7b3029c6d36fa55
parent 656a6d85
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -735,7 +735,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub
                        timestampNanos = SystemClock.elapsedRealtimeNanos();
                    }
                    boolean isActive = cooked[2].equals("active");
                    notifyInterfaceClassActivity(Integer.parseInt(cooked[3]),
                    notifyInterfaceClassActivity(cooked[3] == null ? 0 : Integer.parseInt(cooked[3]),
                            isActive ? DataConnectionRealTimeInfo.DC_POWER_STATE_HIGH
                            : DataConnectionRealTimeInfo.DC_POWER_STATE_LOW, timestampNanos, false);
                    return true;