Fix module errors in telephony unit tests
This doesn't fix the root cause, but the NPEs here are probably covering
the actual failure cause. Not able to repro the module crash locally, so
it may be an issue with APCT or CF. Temporarily fix the NPEs to debug
the actual issue in crash logs.
Test: atest FrameworksTelephonyTests
Bug: 256244889
Change-Id: Ib70ff7923d0d3fafecd0b74f332763b464833f23
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 88b4443..3f05f0a 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -6805,7 +6805,11 @@
Phone phone = PhoneFactory.getPhone(phoneId);
if (phone != null) {
boolean retVal;
- retVal = phone.getDataSettingsManager().isDataEnabled();
+ if (phone.getDataSettingsManager() == null) {
+ retVal = false;
+ } else {
+ retVal = phone.getDataSettingsManager().isDataEnabled();
+ }
if (DBG) log("isDataEnabled: " + retVal + ", subId=" + subId);
return retVal;
} else {