Remove incorrect package check in test override
This change removes the package & uid cross-check in the carrier service
package override, since it gets called from inside the phone process
itself. Initially, this was thought to be necessary with the assumption
that we would have the binder calling identity of the CTS applicaiton,
but that has proven to be false, and the UIDs returned are always root,
or shell (depending on whether ADB is started as root, or not), while the opPackageName is always com.android.phone
As a result, while the enforceShellOnly succeeds, unless the caller is
root, the subsequent checkPackage call will immediately fail.
Bug: 236669534
Test: CTS tests pass without root
Change-Id: I8ab256b2e2c0a120f1122c77f13c10745294b313
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 809b1c2..f96ae3b 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -9193,10 +9193,6 @@
TelephonyPermissions.enforceShellOnly(
Binder.getCallingUid(), "setCarrierServicePackageOverride");
- // Verify that the callingPackage belongs to the calling UID
- mApp.getSystemService(AppOpsManager.class)
- .checkPackage(Binder.getCallingUid(), callingPackage);
-
final long identity = Binder.clearCallingIdentity();
try {
final Phone phone = getPhone(subId);