diff options
| author | 2019-07-31 11:31:26 -0700 | |
|---|---|---|
| committer | 2019-07-31 11:31:26 -0700 | |
| commit | 7c50667bc60e75158760272e8fce7c2e8faa3d16 (patch) | |
| tree | 570e6bcc0b049cb0d3fb1cd448a2d22066efdbc3 | |
| parent | ad9384ee97e62924a66494674322b3568b59ea2a (diff) | |
| parent | 375c74a865fea2b9d1480d7fa6ff6a130ad14306 (diff) | |
Merge "Add getSlotId API for ImsFeature and docs changes"
am: 375c74a865
Change-Id: I3c7e84575a552217637b611bff360b003ea43178
| -rw-r--r-- | api/system-current.txt | 3 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/feature/ImsFeature.java | 40 |
2 files changed, 32 insertions, 11 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index e5ea2c859bb4..3edf5d96d0e5 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -9081,6 +9081,7 @@ package android.telephony.ims.feature { public abstract class ImsFeature { ctor public ImsFeature(); method public abstract void changeEnabledCapabilities(android.telephony.ims.feature.CapabilityChangeRequest, android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy); + method public final int getSlotIndex(); method public abstract void onFeatureReady(); method public abstract void onFeatureRemoved(); method public final void setFeatureState(int); @@ -9094,7 +9095,7 @@ package android.telephony.ims.feature { field public static final int STATE_UNAVAILABLE = 0; // 0x0 } - @Deprecated public static class ImsFeature.Capabilities { + public static class ImsFeature.Capabilities { field @Deprecated protected int mCapabilities; } diff --git a/telephony/java/android/telephony/ims/feature/ImsFeature.java b/telephony/java/android/telephony/ims/feature/ImsFeature.java index 74af6bf6fe6e..3bec8b000bb7 100644 --- a/telephony/java/android/telephony/ims/feature/ImsFeature.java +++ b/telephony/java/android/telephony/ims/feature/ImsFeature.java @@ -132,15 +132,20 @@ public abstract class ImsFeature { public @interface ImsState {} /** - * This {@link ImsFeature}'s state is unavailable and should not be communicated with. + * This {@link ImsFeature}'s state is unavailable and should not be communicated with. This will + * remove all bindings back to the framework. Any attempt to communicate with the framework + * during this time will result in an {@link IllegalStateException}. */ public static final int STATE_UNAVAILABLE = 0; /** - * This {@link ImsFeature} state is initializing and should not be communicated with. + * This {@link ImsFeature} state is initializing and should not be communicated with. This will + * remove all bindings back to the framework. Any attempt to communicate with the framework + * during this time will result in an {@link IllegalStateException}. */ public static final int STATE_INITIALIZING = 1; /** - * This {@link ImsFeature} is ready for communication. + * This {@link ImsFeature} is ready for communication. Do not attempt to call framework methods + * until {@link #onFeatureReady()} is called. */ public static final int STATE_READY = 2; @@ -208,11 +213,14 @@ public abstract class ImsFeature { /** * Contains the capabilities defined and supported by an ImsFeature in the form of a bit mask. + * <p> + * Typically this class is not used directly, but rather extended in subclasses of + * {@link ImsFeature} to provide service specific capabilities. * @hide - * @deprecated Use {@link MmTelFeature.MmTelCapabilities} instead. */ - @SystemApi // SystemApi only because it was leaked through type usage in a previous release. + @SystemApi public static class Capabilities { + /** @deprecated Use getters and accessors instead. */ protected int mCapabilities = 0; /** @@ -305,12 +313,12 @@ public abstract class ImsFeature { /** @hide */ protected final Object mLock = new Object(); - private final Set<IImsFeatureStatusCallback> mStatusCallbacks = Collections.newSetFromMap( - new WeakHashMap<IImsFeatureStatusCallback, Boolean>()); + private final Set<IImsFeatureStatusCallback> mStatusCallbacks = + Collections.newSetFromMap(new WeakHashMap<>()); private @ImsState int mState = STATE_UNAVAILABLE; private int mSlotId = SubscriptionManager.INVALID_SIM_SLOT_INDEX; - private final RemoteCallbackList<IImsCapabilityCallback> mCapabilityCallbacks - = new RemoteCallbackList<>(); + private final RemoteCallbackList<IImsCapabilityCallback> mCapabilityCallbacks = + new RemoteCallbackList<>(); private Capabilities mCapabilityStatus = new Capabilities(); /** @@ -322,6 +330,16 @@ public abstract class ImsFeature { } /** + * @return The SIM slot index associated with this ImsFeature. + * + * @see SubscriptionManager#getSubscriptionIds(int) for more information on getting the + * subscription IDs associated with this slot. + */ + public final int getSlotIndex() { + return mSlotId; + } + + /** * @return The current state of the feature, defined as {@link #STATE_UNAVAILABLE}, * {@link #STATE_INITIALIZING}, or {@link #STATE_READY}. * @hide @@ -490,7 +508,9 @@ public abstract class ImsFeature { public abstract void onFeatureRemoved(); /** - * Called when the feature has been initialized and communication with the framework is set up. + * Called after this ImsFeature has been initialized and has been set to the + * {@link ImsState#STATE_READY} state. + * <p> * Any attempt by this feature to access the framework before this method is called will return * with an {@link IllegalStateException}. * The IMS provider should use this method to trigger registration for this feature on the IMS |