Fix to be testable on TestApp.
Change the calling identity using Binder.clearCallingIdentity() and Binder.restoreCallingIdentity().
Bug: 361178940
Test: manual test with test apk
Test: regression test b/361178940#comment5
Flag: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn
Change-Id: Ie6990ced2d60afbcb672760b9525c3de938dde1f
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index be4b94c..4d83447 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -14312,8 +14312,13 @@
@SatelliteManager.SatelliteResult public int registerForCommunicationAllowedStateChanged(
int subId, @NonNull ISatelliteCommunicationAllowedStateCallback callback) {
enforceSatelliteCommunicationPermission("registerForCommunicationAllowedStateChanged");
- return mSatelliteAccessController.registerForCommunicationAllowedStateChanged(
- subId, callback);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return mSatelliteAccessController.registerForCommunicationAllowedStateChanged(
+ subId, callback);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
/**
@@ -14331,7 +14336,13 @@
public void unregisterForCommunicationAllowedStateChanged(
int subId, @NonNull ISatelliteCommunicationAllowedStateCallback callback) {
enforceSatelliteCommunicationPermission("unregisterForCommunicationAllowedStateChanged");
- mSatelliteAccessController.unregisterForCommunicationAllowedStateChanged(subId, callback);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mSatelliteAccessController.unregisterForCommunicationAllowedStateChanged(subId,
+ callback);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
/**
@@ -14347,7 +14358,12 @@
public void requestSatelliteSessionStats(int subId, @NonNull ResultReceiver result) {
enforceModifyPermission();
enforcePackageUsageStatsPermission("requestSatelliteSessionStats");
- mSatelliteController.requestSatelliteSessionStats(subId, result);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mSatelliteController.requestSatelliteSessionStats(subId, result);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
/**
@@ -14361,7 +14377,12 @@
@Override
public void requestSatelliteSubscriberProvisionStatus(@NonNull ResultReceiver result) {
enforceSatelliteCommunicationPermission("requestSatelliteSubscriberProvisionStatus");
- mSatelliteController.requestSatelliteSubscriberProvisionStatus(result);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mSatelliteController.requestSatelliteSubscriberProvisionStatus(result);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
/**
@@ -14376,6 +14397,11 @@
public void provisionSatellite(@NonNull List<SatelliteSubscriberInfo> list,
@NonNull ResultReceiver result) {
enforceSatelliteCommunicationPermission("provisionSatellite");
- mSatelliteController.provisionSatellite(list, result);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mSatelliteController.provisionSatellite(list, result);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
}