Fix unit test NPEs when testing against Minimal Telephony
This is not a problem with Minimal Telephony RIL itself, but these tests
leaking context or other calls to the OS and depending on environment
outside of unit test.
Bug: 365800992
Test: atest FrameworksTelephonyTests TelecomUnitTests TelephonyProviderTests TeleServiceTests ImsCommonTests
Flag: TEST_ONLY
Change-Id: I34bec1e9142c8076ae5db5b60826d9a2ff787661
diff --git a/tests/src/com/android/TestContext.java b/tests/src/com/android/TestContext.java
index 6e14574..a684ef5 100644
--- a/tests/src/com/android/TestContext.java
+++ b/tests/src/com/android/TestContext.java
@@ -103,6 +103,11 @@
}
@Override
+ public String getOpPackageName() {
+ return getPackageName();
+ }
+
+ @Override
public String getAttributionTag() {
return "";
}