PhoneInterfaceManager: Pass a non-null txTimeMs argument to ModemActivityInfo ctor.
ModemActivityInfo is expecting a non-null txTimeMs argument per the @NonNull
annotation on the argument. Without this we will crash inside the ctor like so:
java.lang.NullPointerException: Attempt to get length of null array
at android.telephony.ModemActivityInfo.populateTransmitPowerRange(ModemActivityInfo.java:73)
at android.telephony.ModemActivityInfo.<init>(ModemActivityInfo.java:66)
at com.android.phone.PhoneInterfaceManager$MainThreadHandler.handleMessage(PhoneInterfaceManager.java:880)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7445)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:517)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:951)
Bug: 142352330
Test: com.android.phone doesn't crash on fvp-eng
Change-Id: Id3147350fd68cf9a7ac2bbfceabc083002c87231
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index c0cb934..2ea0b66 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -877,7 +877,7 @@
}
// Result cannot be null. Return ModemActivityInfo with all fields set to 0.
if (request.result == null) {
- request.result = new ModemActivityInfo(0, 0, 0, null, 0);
+ request.result = new ModemActivityInfo(0, 0, 0, new int[0], 0);
}
notifyRequester(request);
break;