Put additional logs to check ResultReceiver created over limit
Bug: 376281558
Flag: com.android.internal.telephony.flags.geofence_enhancement_for_better_ux
Test: atest SatelliteControllerTest#testLoggingCodeForResultReceiverCount
Test: atest SatelliteAccessControllerTest
Change-Id: Id20172b0272177505bd744811cbcfa9fee507f38
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index bd90a9d..4a0f1ec 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -13204,11 +13204,14 @@
final long identity = Binder.clearCallingIdentity();
try {
if (enableSatellite) {
+ String caller = "PIM:requestSatelliteEnabled";
ResultReceiver resultReceiver = new ResultReceiver(mMainThreadHandler) {
@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
Log.d(LOG_TAG, "Satellite access restriction resultCode=" + resultCode
+ ", resultData=" + resultData);
+ mSatelliteController.decrementResultReceiverCount(caller);
+
boolean isAllowed = false;
Consumer<Integer> result = FunctionalUtils.ignoreRemoteException(
callback::accept);
@@ -13241,6 +13244,7 @@
};
mSatelliteAccessController.requestIsCommunicationAllowedForCurrentLocation(
resultReceiver, true);
+ mSatelliteController.incrementResultReceiverCount(caller);
} else {
// No need to check if satellite is allowed at current location when disabling
// satellite