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
diff --git a/src/com/android/phone/satellite/accesscontrol/SatelliteAccessController.java b/src/com/android/phone/satellite/accesscontrol/SatelliteAccessController.java
index 49edf6a..be2e53b 100644
--- a/src/com/android/phone/satellite/accesscontrol/SatelliteAccessController.java
+++ b/src/com/android/phone/satellite/accesscontrol/SatelliteAccessController.java
@@ -425,6 +425,9 @@
                 handleIsSatelliteSupportedResult(resultCode, resultData);
             }
         };
+        mSatelliteController.incrementResultReceiverCount(
+                "SAC:mInternalSatelliteSupportedResultReceiver");
+
         mInternalSatelliteProvisionedResultReceiver = new ResultReceiver(this) {
             @Override
             protected void onReceiveResult(int resultCode, Bundle resultData) {
@@ -442,13 +445,16 @@
             public void onSatelliteSupportedStateChanged(boolean isSupported) {
                 logd("onSatelliteSupportedStateChanged: isSupported=" + isSupported);
                 if (isSupported) {
+                    final String caller = "SAC:onSatelliteSupportedStateChanged";
                     requestIsCommunicationAllowedForCurrentLocation(
                             new ResultReceiver(null) {
                                 @Override
                                 protected void onReceiveResult(int resultCode, Bundle resultData) {
+                                    mSatelliteController.decrementResultReceiverCount(caller);
                                     // do nothing
                                 }
                             }, false);
+                    mSatelliteController.incrementResultReceiverCount(caller);
                     if (mSatelliteDisallowedReasons.contains(
                             Integer.valueOf(SATELLITE_DISALLOWED_REASON_NOT_SUPPORTED))) {
                         mSatelliteDisallowedReasons.remove(
@@ -473,13 +479,16 @@
             public void onSatelliteProvisionStateChanged(boolean isProvisioned) {
                 logd("onSatelliteProvisionStateChanged: isProvisioned=" + isProvisioned);
                 if (isProvisioned) {
+                    final String caller = "SAC:onSatelliteProvisionStateChanged";
                     requestIsCommunicationAllowedForCurrentLocation(
                             new ResultReceiver(null) {
                                 @Override
                                 protected void onReceiveResult(int resultCode, Bundle resultData) {
+                                    mSatelliteController.decrementResultReceiverCount(caller);
                                     // do nothing
                                 }
                             }, false);
+                    mSatelliteController.incrementResultReceiverCount(caller);
                     if (mSatelliteDisallowedReasons.contains(
                             SATELLITE_DISALLOWED_REASON_NOT_PROVISIONED)) {
                         mSatelliteDisallowedReasons.remove(
@@ -591,6 +600,8 @@
         mAccessControllerMetricsStats.setTriggeringEvent(TRIGGERING_EVENT_EXTERNAL_REQUEST);
         sendRequestAsync(CMD_IS_SATELLITE_COMMUNICATION_ALLOWED,
                 new Pair<>(mSatelliteController.getSelectedSatelliteSubId(), result));
+        mSatelliteController.incrementResultReceiverCount(
+                "SAC:requestIsCommunicationAllowedForCurrentLocation");
     }
 
     /**
@@ -1180,6 +1191,8 @@
         synchronized (mLock) {
             for (ResultReceiver resultReceiver : mSatelliteAllowResultReceivers) {
                 resultReceiver.send(resultCode, resultData);
+                mSatelliteController.decrementResultReceiverCount(
+                        "SAC:requestIsCommunicationAllowedForCurrentLocation");
             }
             mSatelliteAllowResultReceivers.clear();
         }
