Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad75b1e8 authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

Merge "Fix potential issue where sub info change listener is not registered."...

Merge "Fix potential issue where sub info change listener is not registered." into rvc-dev am: f0d56871 am: 16a9b71f

Change-Id: I3cf47f9ff123d3152dce5f3b02120c290794f6a7
parents 2156d06f 16a9b71f
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -944,6 +944,18 @@ public class SubscriptionManager {
            if (DBG) log("onSubscriptionsChanged: NOT OVERRIDDEN");
        }

        /**
         * Callback invoked when {@link SubscriptionManager#addOnSubscriptionsChangedListener(
         * Executor, OnSubscriptionsChangedListener)} or
         * {@link SubscriptionManager#addOnSubscriptionsChangedListener(
         * OnSubscriptionsChangedListener)} fails to complete due to the
         * {@link Context#TELEPHONY_REGISTRY_SERVICE} being unavailable.
         * @hide
         */
        public void onAddListenerFailed() {
            Rlog.w(LOG_TAG, "onAddListenerFailed not overridden");
        }

        private void log(String s) {
            Rlog.d(LOG_TAG, s);
        }
@@ -1012,6 +1024,12 @@ public class SubscriptionManager {
        if (telephonyRegistryManager != null) {
            telephonyRegistryManager.addOnSubscriptionsChangedListener(listener,
                    executor);
        } else {
            // If the telephony registry isn't available, we will inform the caller on their
            // listener that it failed so they can try to re-register.
            loge("addOnSubscriptionsChangedListener: pkgname=" + pkgName + " failed to be added "
                    + " due to TELEPHONY_REGISTRY_SERVICE being unavailable.");
            executor.execute(() -> listener.onAddListenerFailed());
        }
    }