Fix crash in telephony tests
This doesn't fix the root cause but will fix the NPE allowing us to see
logs showing the actual issue.
Test: atest FrameworksTelephonyTests
Bug: 256244889
Change-Id: I2e83c7fbd3b75ffeffc97d70da174c492924433f
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index abbd816..6a7737a 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -935,7 +935,11 @@
* @return whether we have transitioned to dataRoaming
*/
private boolean dataIsNowRoaming(int subId) {
- return getPhone(subId).getServiceState().getDataRoaming();
+ if (getPhone(subId).getServiceState() == null) {
+ return false;
+ } else {
+ return getPhone(subId).getServiceState().getDataRoaming();
+ }
}
private void updateLimitedSimFunctionForDualSim() {