Merge "IMS RCS UCE API Improvement" am: a706df510f am: 321501ea9d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1918644 Change-Id: Ib83f3c1b02440a05a85a363ad2401a800c2f0a69
This commit is contained in:
@@ -13634,6 +13634,7 @@ package android.telephony.ims {
|
|||||||
field public static final int PUBLISH_STATE_NOT_PUBLISHED = 2; // 0x2
|
field public static final int PUBLISH_STATE_NOT_PUBLISHED = 2; // 0x2
|
||||||
field public static final int PUBLISH_STATE_OK = 1; // 0x1
|
field public static final int PUBLISH_STATE_OK = 1; // 0x1
|
||||||
field public static final int PUBLISH_STATE_OTHER_ERROR = 6; // 0x6
|
field public static final int PUBLISH_STATE_OTHER_ERROR = 6; // 0x6
|
||||||
|
field public static final int PUBLISH_STATE_PUBLISHING = 7; // 0x7
|
||||||
field public static final int PUBLISH_STATE_RCS_PROVISION_ERROR = 4; // 0x4
|
field public static final int PUBLISH_STATE_RCS_PROVISION_ERROR = 4; // 0x4
|
||||||
field public static final int PUBLISH_STATE_REQUEST_TIMEOUT = 5; // 0x5
|
field public static final int PUBLISH_STATE_REQUEST_TIMEOUT = 5; // 0x5
|
||||||
field public static final int PUBLISH_STATE_VOICE_PROVISION_ERROR = 3; // 0x3
|
field public static final int PUBLISH_STATE_VOICE_PROVISION_ERROR = 3; // 0x3
|
||||||
@@ -13896,6 +13897,7 @@ package android.telephony.ims.feature {
|
|||||||
package android.telephony.ims.stub {
|
package android.telephony.ims.stub {
|
||||||
|
|
||||||
public interface CapabilityExchangeEventListener {
|
public interface CapabilityExchangeEventListener {
|
||||||
|
method public default void onPublishUpdated(int, @NonNull String, int, @NonNull String) throws android.telephony.ims.ImsException;
|
||||||
method public void onRemoteCapabilityRequest(@NonNull android.net.Uri, @NonNull java.util.Set<java.lang.String>, @NonNull android.telephony.ims.stub.CapabilityExchangeEventListener.OptionsRequestCallback) throws android.telephony.ims.ImsException;
|
method public void onRemoteCapabilityRequest(@NonNull android.net.Uri, @NonNull java.util.Set<java.lang.String>, @NonNull android.telephony.ims.stub.CapabilityExchangeEventListener.OptionsRequestCallback) throws android.telephony.ims.ImsException;
|
||||||
method public void onRequestPublishCapabilities(int) throws android.telephony.ims.ImsException;
|
method public void onRequestPublishCapabilities(int) throws android.telephony.ims.ImsException;
|
||||||
method public void onUnpublish() throws android.telephony.ims.ImsException;
|
method public void onUnpublish() throws android.telephony.ims.ImsException;
|
||||||
|
|||||||
@@ -28,13 +28,10 @@ import android.os.Binder;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceSpecificException;
|
import android.os.ServiceSpecificException;
|
||||||
import android.telephony.CarrierConfigManager;
|
|
||||||
import android.telephony.SubscriptionManager;
|
|
||||||
import android.telephony.TelephonyFrameworkInitializer;
|
import android.telephony.TelephonyFrameworkInitializer;
|
||||||
import android.telephony.ims.aidl.IImsRcsController;
|
import android.telephony.ims.aidl.IImsRcsController;
|
||||||
import android.telephony.ims.aidl.IRcsUceControllerCallback;
|
import android.telephony.ims.aidl.IRcsUceControllerCallback;
|
||||||
import android.telephony.ims.aidl.IRcsUcePublishStateCallback;
|
import android.telephony.ims.aidl.IRcsUcePublishStateCallback;
|
||||||
import android.telephony.ims.feature.RcsFeature;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@@ -337,6 +334,14 @@ public class RcsUceAdapter {
|
|||||||
@SystemApi
|
@SystemApi
|
||||||
public static final int PUBLISH_STATE_OTHER_ERROR = 6;
|
public static final int PUBLISH_STATE_OTHER_ERROR = 6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The device is currently trying to publish its capabilities to the network.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public static final int PUBLISH_STATE_PUBLISHING = 7;
|
||||||
|
|
||||||
|
|
||||||
/**@hide*/
|
/**@hide*/
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef(prefix = "PUBLISH_STATE_", value = {
|
@IntDef(prefix = "PUBLISH_STATE_", value = {
|
||||||
@@ -345,7 +350,8 @@ public class RcsUceAdapter {
|
|||||||
PUBLISH_STATE_VOICE_PROVISION_ERROR,
|
PUBLISH_STATE_VOICE_PROVISION_ERROR,
|
||||||
PUBLISH_STATE_RCS_PROVISION_ERROR,
|
PUBLISH_STATE_RCS_PROVISION_ERROR,
|
||||||
PUBLISH_STATE_REQUEST_TIMEOUT,
|
PUBLISH_STATE_REQUEST_TIMEOUT,
|
||||||
PUBLISH_STATE_OTHER_ERROR
|
PUBLISH_STATE_OTHER_ERROR,
|
||||||
|
PUBLISH_STATE_PUBLISHING
|
||||||
})
|
})
|
||||||
public @interface PublishState {}
|
public @interface PublishState {}
|
||||||
|
|
||||||
@@ -480,9 +486,12 @@ public class RcsUceAdapter {
|
|||||||
* <p>
|
* <p>
|
||||||
* Be sure to check the availability of this feature using
|
* Be sure to check the availability of this feature using
|
||||||
* {@link ImsRcsManager#isAvailable(int, int)} and ensuring
|
* {@link ImsRcsManager#isAvailable(int, int)} and ensuring
|
||||||
* {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_OPTIONS_UCE} or
|
* {@link
|
||||||
* {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_PRESENCE_UCE} is enabled or else
|
* android.telephony.ims.feature.RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_OPTIONS_UCE} or
|
||||||
* this operation will fail with {@link #ERROR_NOT_AVAILABLE} or {@link #ERROR_NOT_ENABLED}.
|
* {@link
|
||||||
|
* android.telephony.ims.feature.RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_PRESENCE_UCE} is
|
||||||
|
* enabled or else this operation will fail with {@link #ERROR_NOT_AVAILABLE} or
|
||||||
|
* {@link #ERROR_NOT_ENABLED}.
|
||||||
*
|
*
|
||||||
* @param contactNumbers A list of numbers that the capabilities are being requested for.
|
* @param contactNumbers A list of numbers that the capabilities are being requested for.
|
||||||
* @param executor The executor that will be used when the request is completed and the
|
* @param executor The executor that will be used when the request is completed and the
|
||||||
@@ -573,8 +582,10 @@ public class RcsUceAdapter {
|
|||||||
* <p>
|
* <p>
|
||||||
* Be sure to check the availability of this feature using
|
* Be sure to check the availability of this feature using
|
||||||
* {@link ImsRcsManager#isAvailable(int, int)} and ensuring
|
* {@link ImsRcsManager#isAvailable(int, int)} and ensuring
|
||||||
* {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_OPTIONS_UCE} or
|
* {@link
|
||||||
* {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_PRESENCE_UCE} is
|
* android.telephony.ims.feature.RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_OPTIONS_UCE} or
|
||||||
|
* {@link
|
||||||
|
* android.telephony.ims.feature.RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_PRESENCE_UCE} is
|
||||||
* enabled or else this operation will fail with
|
* enabled or else this operation will fail with
|
||||||
* {@link #ERROR_NOT_AVAILABLE} or {@link #ERROR_NOT_ENABLED}.
|
* {@link #ERROR_NOT_AVAILABLE} or {@link #ERROR_NOT_ENABLED}.
|
||||||
*
|
*
|
||||||
@@ -690,7 +701,8 @@ public class RcsUceAdapter {
|
|||||||
* Registers a {@link OnPublishStateChangedListener} with the system, which will provide publish
|
* Registers a {@link OnPublishStateChangedListener} with the system, which will provide publish
|
||||||
* state updates for the subscription specified in {@link ImsManager@getRcsManager(subid)}.
|
* state updates for the subscription specified in {@link ImsManager@getRcsManager(subid)}.
|
||||||
* <p>
|
* <p>
|
||||||
* Use {@link SubscriptionManager.OnSubscriptionsChangedListener} to listen to subscription
|
* Use {@link android.telephony.SubscriptionManager.OnSubscriptionsChangedListener} to listen
|
||||||
|
* to subscription
|
||||||
* changed events and call
|
* changed events and call
|
||||||
* {@link #removeOnPublishStateChangedListener(OnPublishStateChangedListener)} to clean up.
|
* {@link #removeOnPublishStateChangedListener(OnPublishStateChangedListener)} to clean up.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -792,7 +804,8 @@ public class RcsUceAdapter {
|
|||||||
* cache associated with those contacts as the local cache becomes stale.
|
* cache associated with those contacts as the local cache becomes stale.
|
||||||
* <p>
|
* <p>
|
||||||
* This setting will only enable this feature if
|
* This setting will only enable this feature if
|
||||||
* {@link CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL} is also enabled.
|
* {@link android.telephony.CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL} is
|
||||||
|
* also enabled.
|
||||||
* <p>
|
* <p>
|
||||||
* Note: This setting does not affect whether or not the device publishes its service
|
* Note: This setting does not affect whether or not the device publishes its service
|
||||||
* capabilities if the subscription supports presence publication.
|
* capabilities if the subscription supports presence publication.
|
||||||
@@ -843,7 +856,8 @@ public class RcsUceAdapter {
|
|||||||
* session.
|
* session.
|
||||||
* <p>
|
* <p>
|
||||||
* This setting will only enable this feature if
|
* This setting will only enable this feature if
|
||||||
* {@link CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL} is also enabled.
|
* {@link android.telephony.CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL} is
|
||||||
|
* also enabled.
|
||||||
* <p>
|
* <p>
|
||||||
* Note: This setting does not affect whether or not the device publishes its service
|
* Note: This setting does not affect whether or not the device publishes its service
|
||||||
* capabilities if the subscription supports presence publication.
|
* capabilities if the subscription supports presence publication.
|
||||||
|
|||||||
@@ -80,6 +80,26 @@ public class CapabilityExchangeAidlWrapper implements CapabilityExchangeEventLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Receives the status of changes in the publishing connection from ims service
|
||||||
|
* and deliver this callback to the framework.
|
||||||
|
*/
|
||||||
|
public void onPublishUpdated(int reasonCode, @NonNull String reasonPhrase,
|
||||||
|
int reasonHeaderCause, @NonNull String reasonHeaderText) throws ImsException {
|
||||||
|
ICapabilityExchangeEventListener listener = mListenerBinder;
|
||||||
|
if (listener == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
listener.onPublishUpdated(reasonCode, reasonPhrase,
|
||||||
|
reasonHeaderCause, reasonHeaderText);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.w(LOG_TAG, "onPublishUpdated exception: " + e);
|
||||||
|
throw new ImsException("Remote is not available",
|
||||||
|
ImsException.CODE_ERROR_SERVICE_UNAVAILABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receives the callback of the remote capability request from the network and deliver this
|
* Receives the callback of the remote capability request from the network and deliver this
|
||||||
* request to the framework.
|
* request to the framework.
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import java.util.List;
|
|||||||
oneway interface ICapabilityExchangeEventListener {
|
oneway interface ICapabilityExchangeEventListener {
|
||||||
void onRequestPublishCapabilities(int publishTriggerType);
|
void onRequestPublishCapabilities(int publishTriggerType);
|
||||||
void onUnpublish();
|
void onUnpublish();
|
||||||
|
void onPublishUpdated(int reasonCode, String reasonPhrase, int reasonHeaderCause,
|
||||||
|
String reasonHeaderText);
|
||||||
void onRemoteCapabilityRequest(in Uri contactUri,
|
void onRemoteCapabilityRequest(in Uri contactUri,
|
||||||
in List<String> remoteCapabilities, IOptionsRequestCallback cb);
|
in List<String> remoteCapabilities, IOptionsRequestCallback cb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,30 @@ public interface CapabilityExchangeEventListener {
|
|||||||
*/
|
*/
|
||||||
void onUnpublish() throws ImsException;
|
void onUnpublish() throws ImsException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify the framework that the ImsService has refreshed the PUBLISH
|
||||||
|
* internally, which has resulted in a new PUBLISH result.
|
||||||
|
* <p>
|
||||||
|
* This method must return both SUCCESS (200 OK) and FAILURE (300+) codes in order to
|
||||||
|
* keep the AOSP stack up to date.
|
||||||
|
* @param reasonCode The SIP response code sent from the network.
|
||||||
|
* @param reasonPhrase The optional reason response from the network. If the
|
||||||
|
* network provided no reason with the sip code, the string should be empty.
|
||||||
|
* @param reasonHeaderCause The “cause” parameter of the “reason” header
|
||||||
|
* included in the SIP message.
|
||||||
|
* @param reasonHeaderText The “text” parameter of the “reason” header
|
||||||
|
* included in the SIP message.
|
||||||
|
* @throws ImsException If this {@link RcsCapabilityExchangeImplBase} instance is not
|
||||||
|
* currently connected to the framework. This can happen if the {@link RcsFeature} is not
|
||||||
|
* {@link ImsFeature#STATE_READY} and the {@link RcsFeature} has not received
|
||||||
|
* the {@link ImsFeature#onFeatureReady()} callback. This may also happen in rare
|
||||||
|
* cases when the Telephony stack has crashed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
default void onPublishUpdated(int reasonCode, @NonNull String reasonPhrase,
|
||||||
|
int reasonHeaderCause, @NonNull String reasonHeaderText) throws ImsException {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inform the framework of an OPTIONS query from a remote device for this device's UCE
|
* Inform the framework of an OPTIONS query from a remote device for this device's UCE
|
||||||
* capabilities.
|
* capabilities.
|
||||||
|
|||||||
Reference in New Issue
Block a user