Merge "Add getSlotId API for ImsFeature and docs changes"

am: 375c74a865

Change-Id: I3c7e84575a552217637b611bff360b003ea43178
This commit is contained in:
Brad Ebinger
2019-07-31 11:31:26 -07:00
committed by android-build-merger
2 changed files with 32 additions and 11 deletions

View File

@@ -9081,6 +9081,7 @@ package android.telephony.ims.feature {
public abstract class ImsFeature { public abstract class ImsFeature {
ctor public ImsFeature(); ctor public ImsFeature();
method public abstract void changeEnabledCapabilities(android.telephony.ims.feature.CapabilityChangeRequest, android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy); 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 onFeatureReady();
method public abstract void onFeatureRemoved(); method public abstract void onFeatureRemoved();
method public final void setFeatureState(int); method public final void setFeatureState(int);
@@ -9094,7 +9095,7 @@ package android.telephony.ims.feature {
field public static final int STATE_UNAVAILABLE = 0; // 0x0 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; field @Deprecated protected int mCapabilities;
} }

View File

@@ -132,15 +132,20 @@ public abstract class ImsFeature {
public @interface ImsState {} 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; 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; 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; 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. * 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 * @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 { public static class Capabilities {
/** @deprecated Use getters and accessors instead. */
protected int mCapabilities = 0; protected int mCapabilities = 0;
/** /**
@@ -305,12 +313,12 @@ public abstract class ImsFeature {
/** @hide */ /** @hide */
protected final Object mLock = new Object(); protected final Object mLock = new Object();
private final Set<IImsFeatureStatusCallback> mStatusCallbacks = Collections.newSetFromMap( private final Set<IImsFeatureStatusCallback> mStatusCallbacks =
new WeakHashMap<IImsFeatureStatusCallback, Boolean>()); Collections.newSetFromMap(new WeakHashMap<>());
private @ImsState int mState = STATE_UNAVAILABLE; private @ImsState int mState = STATE_UNAVAILABLE;
private int mSlotId = SubscriptionManager.INVALID_SIM_SLOT_INDEX; private int mSlotId = SubscriptionManager.INVALID_SIM_SLOT_INDEX;
private final RemoteCallbackList<IImsCapabilityCallback> mCapabilityCallbacks private final RemoteCallbackList<IImsCapabilityCallback> mCapabilityCallbacks =
= new RemoteCallbackList<>(); new RemoteCallbackList<>();
private Capabilities mCapabilityStatus = new Capabilities(); private Capabilities mCapabilityStatus = new Capabilities();
/** /**
@@ -321,6 +329,16 @@ public abstract class ImsFeature {
mSlotId = slotId; mSlotId = slotId;
} }
/**
* @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}, * @return The current state of the feature, defined as {@link #STATE_UNAVAILABLE},
* {@link #STATE_INITIALIZING}, or {@link #STATE_READY}. * {@link #STATE_INITIALIZING}, or {@link #STATE_READY}.
@@ -490,7 +508,9 @@ public abstract class ImsFeature {
public abstract void onFeatureRemoved(); 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 * Any attempt by this feature to access the framework before this method is called will return
* with an {@link IllegalStateException}. * with an {@link IllegalStateException}.
* The IMS provider should use this method to trigger registration for this feature on the IMS * The IMS provider should use this method to trigger registration for this feature on the IMS