diff options
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/com/android/ims/ImsCallbackAdapterManager.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/java/com/android/ims/ImsCallbackAdapterManager.java b/src/java/com/android/ims/ImsCallbackAdapterManager.java index 08ca1c3e..931ce579 100644 --- a/src/java/com/android/ims/ImsCallbackAdapterManager.java +++ b/src/java/com/android/ims/ImsCallbackAdapterManager.java @@ -18,14 +18,10 @@ package com.android.ims; import android.content.Context; import android.os.IInterface; -import android.os.Looper; import android.os.RemoteCallbackList; import android.telephony.SubscriptionManager; import android.util.Log; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; public abstract class ImsCallbackAdapterManager<T extends IInterface> { private static final String TAG = "ImsCallbackAM"; @@ -67,10 +63,15 @@ public abstract class ImsCallbackAdapterManager<T extends IInterface> { } if (mSubId != subId) { // In some cases, telephony has changed sub id and IMS is still catching up to the - // state change. Since some devices do not check for IMS READY state before adding - // callbacks, still allow this condition. + // state change. Ensure that the device does not try to register a callback on an + // inactive subscription, because this can cause a condition where we remove the + // callback invisibly when the new subscription loads. Instead, simulate the existing + // IllegalStateException that happens when the ImsService is not ready/active for + // backwards compatibility. Log.w(TAG + " [" + mSlotId + ", " + mSubId + "]", "add callback: inactive" + " subID detected: " + subId); + throw new IllegalStateException("ImsService is not available for the subscription " + + "specified."); } synchronized (mLock) { addCallback(localCallback); |