Fix flaky TeleServices tests causing module errors
Some tests were using reflection to replace static instances but not
resetting the previous values, causing the device to remain in a bad
state. Add a replaceInstance and restoreInstances method to
TelephonyTestBase and have these classes extend it so cleanup can be
done in the @After method.
Fix flaky NotificationMgrTests causing module errors due to incomplete
mocks.
Also revert changes added to help debug b/256244889.
Test: atest TeleServiceTests
Bug: 256244889
Change-Id: Id758e207da862f450d5c90971cb3ea1bd2afe40d
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 3f05f0a..7c176ef 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -6804,12 +6804,7 @@
int phoneId = mSubscriptionController.getPhoneId(subId);
Phone phone = PhoneFactory.getPhone(phoneId);
if (phone != null) {
- boolean retVal;
- if (phone.getDataSettingsManager() == null) {
- retVal = false;
- } else {
- retVal = phone.getDataSettingsManager().isDataEnabled();
- }
+ boolean retVal = phone.getDataSettingsManager().isDataEnabled();
if (DBG) log("isDataEnabled: " + retVal + ", subId=" + subId);
return retVal;
} else {