Merge "Add new capability polling opt-in intent" into rvc-dev am: cd31f739da am: 6c7a529add am: 45150b77f2 am: 0a1b779d64
Change-Id: Id780867b8a350cdddf032086ab8cb986f433bb17
This commit is contained in:
@@ -48775,6 +48775,7 @@ package android.telephony.ims {
|
||||
|
||||
public class ImsManager {
|
||||
method @NonNull public android.telephony.ims.ImsMmTelManager getImsMmTelManager(int);
|
||||
method @NonNull public android.telephony.ims.ImsRcsManager getImsRcsManager(int);
|
||||
field public static final String ACTION_WFC_IMS_REGISTRATION_ERROR = "android.telephony.ims.action.WFC_IMS_REGISTRATION_ERROR";
|
||||
field public static final String EXTRA_WFC_REGISTRATION_FAILURE_MESSAGE = "android.telephony.ims.extra.WFC_REGISTRATION_FAILURE_MESSAGE";
|
||||
field public static final String EXTRA_WFC_REGISTRATION_FAILURE_TITLE = "android.telephony.ims.extra.WFC_REGISTRATION_FAILURE_TITLE";
|
||||
@@ -48803,6 +48804,15 @@ package android.telephony.ims {
|
||||
method public void onCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.MmTelFeature.MmTelCapabilities);
|
||||
}
|
||||
|
||||
public class ImsRcsManager implements android.telephony.ims.RegistrationManager {
|
||||
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void getRegistrationState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
|
||||
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void getRegistrationTransportType(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
|
||||
method @NonNull public android.telephony.ims.RcsUceAdapter getUceAdapter();
|
||||
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.RegistrationManager.RegistrationCallback) throws android.telephony.ims.ImsException;
|
||||
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.RegistrationManager.RegistrationCallback);
|
||||
field public static final String ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN = "android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN";
|
||||
}
|
||||
|
||||
public final class ImsReasonInfo implements android.os.Parcelable {
|
||||
ctor public ImsReasonInfo(int, int, @Nullable String);
|
||||
method public int describeContents();
|
||||
@@ -48986,6 +48996,10 @@ package android.telephony.ims {
|
||||
field public static final int EXTRA_CODE_CALL_RETRY_SILENT_REDIAL = 2; // 0x2
|
||||
}
|
||||
|
||||
public class RcsUceAdapter {
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException;
|
||||
}
|
||||
|
||||
public interface RegistrationManager {
|
||||
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void getRegistrationState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
|
||||
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void getRegistrationTransportType(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
|
||||
|
||||
@@ -12412,7 +12412,6 @@ package android.telephony.ims {
|
||||
}
|
||||
|
||||
public class ImsManager {
|
||||
method @NonNull public android.telephony.ims.ImsRcsManager getImsRcsManager(int);
|
||||
field public static final String ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION = "com.android.internal.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION";
|
||||
}
|
||||
|
||||
@@ -12440,10 +12439,6 @@ package android.telephony.ims {
|
||||
ctor @Deprecated public ImsMmTelManager.RegistrationCallback();
|
||||
}
|
||||
|
||||
public class ImsRcsManager implements android.telephony.ims.RegistrationManager {
|
||||
method @NonNull public android.telephony.ims.RcsUceAdapter getUceAdapter();
|
||||
}
|
||||
|
||||
public final class ImsReasonInfo implements android.os.Parcelable {
|
||||
field public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED = "Forbidden. Not Authorized for Service";
|
||||
}
|
||||
@@ -12820,7 +12815,6 @@ package android.telephony.ims {
|
||||
}
|
||||
|
||||
public class RcsUceAdapter {
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException;
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
|
||||
}
|
||||
|
||||
|
||||
@@ -3998,7 +3998,6 @@ package android.telephony.ims {
|
||||
}
|
||||
|
||||
public class ImsManager {
|
||||
method @NonNull public android.telephony.ims.ImsRcsManager getImsRcsManager(int);
|
||||
field public static final String ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION = "com.android.internal.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION";
|
||||
}
|
||||
|
||||
@@ -4026,10 +4025,6 @@ package android.telephony.ims {
|
||||
ctor @Deprecated public ImsMmTelManager.RegistrationCallback();
|
||||
}
|
||||
|
||||
public class ImsRcsManager implements android.telephony.ims.RegistrationManager {
|
||||
method @NonNull public android.telephony.ims.RcsUceAdapter getUceAdapter();
|
||||
}
|
||||
|
||||
public class ImsService extends android.app.Service {
|
||||
ctor public ImsService();
|
||||
method public android.telephony.ims.feature.MmTelFeature createMmTelFeature(int);
|
||||
@@ -4402,7 +4397,6 @@ package android.telephony.ims {
|
||||
}
|
||||
|
||||
public class RcsUceAdapter {
|
||||
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException;
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
|
||||
}
|
||||
|
||||
|
||||
@@ -5120,8 +5120,8 @@ public final class Telephony {
|
||||
public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
|
||||
|
||||
/**
|
||||
* Determines if the user has enabled IMS RCS User Capability Exchange (UCE) for this
|
||||
* subscription.
|
||||
* TelephonyProvider column name for determining if the user has enabled IMS RCS User
|
||||
* Capability Exchange (UCE) for this subscription.
|
||||
*/
|
||||
public static final String IMS_RCS_UCE_ENABLED = "ims_rcs_uce_enabled";
|
||||
|
||||
|
||||
@@ -103,10 +103,7 @@ public class ImsManager {
|
||||
* @param subscriptionId The ID of the subscription that this ImsRcsManager will use.
|
||||
* @throws IllegalArgumentException if the subscription is invalid.
|
||||
* @return a ImsRcsManager instance with the specific subscription ID.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
@NonNull
|
||||
public ImsRcsManager getImsRcsManager(int subscriptionId) {
|
||||
if (!SubscriptionManager.isValidSubscriptionId(subscriptionId)) {
|
||||
|
||||
@@ -47,11 +47,12 @@ public final class ImsException extends Exception {
|
||||
public static final int CODE_ERROR_SERVICE_UNAVAILABLE = 1;
|
||||
|
||||
/**
|
||||
* This device or carrier configuration does not support IMS for this subscription.
|
||||
* This device or carrier configuration does not support this feature for this subscription.
|
||||
* <p>
|
||||
* This is a permanent configuration error and there should be no retry. Usually this is
|
||||
* because {@link PackageManager#FEATURE_TELEPHONY_IMS} is not available
|
||||
* or the device has no ImsService implementation to service this request.
|
||||
* This is a permanent configuration error and there should be no retry until the subscription
|
||||
* changes if this operation is denied due to a carrier configuration. If this is due to a
|
||||
* device configuration, the feature {@link PackageManager#FEATURE_TELEPHONY_IMS} is not
|
||||
* available or the device has no ImsService implementation to service this request.
|
||||
*/
|
||||
public static final int CODE_ERROR_UNSUPPORTED_OPERATION = 2;
|
||||
|
||||
|
||||
@@ -20,13 +20,15 @@ import android.Manifest;
|
||||
import android.annotation.CallbackExecutor;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.annotation.SdkConstant;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.AccessNetworkConstants;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyFrameworkInitializer;
|
||||
import android.telephony.ims.aidl.IImsCapabilityCallback;
|
||||
@@ -46,13 +48,33 @@ import java.util.function.Consumer;
|
||||
* (UCE) service, as well as managing user settings.
|
||||
*
|
||||
* Use {@link ImsManager#getImsRcsManager(int)} to create an instance of this manager.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public class ImsRcsManager implements RegistrationManager {
|
||||
private static final String TAG = "ImsRcsManager";
|
||||
|
||||
/**
|
||||
* Activity Action: Show the opt-in dialog for enabling or disabling RCS contact discovery
|
||||
* using User Capability Exchange (UCE).
|
||||
* <p>
|
||||
* An application that depends on contact discovery being enabled may send this intent
|
||||
* using {@link Context#startActivity(Intent)} to ask the user to opt-in for contacts upload for
|
||||
* capability exchange if it is currently disabled. Whether or not this setting has been enabled
|
||||
* can be queried using {@link RcsUceAdapter#isUceSettingEnabled()}.
|
||||
* <p>
|
||||
* This intent should only be sent if the carrier supports RCS capability exchange, which can be
|
||||
* queried using the key {@link CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL}. Otherwise, the
|
||||
* setting will not be present.
|
||||
* <p>
|
||||
* Input: A mandatory {@link Settings#EXTRA_SUB_ID} extra containing the subscription that the
|
||||
* setting will be be shown for.
|
||||
* <p>
|
||||
* Output: Nothing
|
||||
* @see RcsUceAdapter
|
||||
*/
|
||||
@SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
|
||||
public static final String ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN =
|
||||
"android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN";
|
||||
|
||||
/**
|
||||
* Receives RCS availability status updates from the ImsService.
|
||||
*
|
||||
@@ -145,11 +167,10 @@ public class ImsRcsManager implements RegistrationManager {
|
||||
*/
|
||||
@NonNull
|
||||
public RcsUceAdapter getUceAdapter() {
|
||||
return new RcsUceAdapter(mSubId);
|
||||
return new RcsUceAdapter(mContext, mSubId);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
@@ -181,7 +202,6 @@ public class ImsRcsManager implements RegistrationManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
@@ -206,7 +226,6 @@ public class ImsRcsManager implements RegistrationManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
@@ -239,7 +258,6 @@ public class ImsRcsManager implements RegistrationManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -23,10 +23,13 @@ import android.annotation.NonNull;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.content.Context;
|
||||
import android.database.ContentObserver;
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Telephony;
|
||||
import android.telephony.TelephonyFrameworkInitializer;
|
||||
import android.telephony.ims.aidl.IImsRcsController;
|
||||
import android.telephony.ims.aidl.IRcsUceControllerCallback;
|
||||
@@ -42,10 +45,7 @@ import java.util.concurrent.Executor;
|
||||
* Manages RCS User Capability Exchange for the subscription specified.
|
||||
*
|
||||
* @see ImsRcsManager#getUceAdapter() for information on creating an instance of this class.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public class RcsUceAdapter {
|
||||
private static final String TAG = "RcsUceAdapter";
|
||||
|
||||
@@ -215,6 +215,7 @@ public class RcsUceAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
private final Context mContext;
|
||||
private final int mSubId;
|
||||
|
||||
/**
|
||||
@@ -222,7 +223,8 @@ public class RcsUceAdapter {
|
||||
* {@link ImsRcsManager#getUceAdapter()} to instantiate this manager class.
|
||||
* @hide
|
||||
*/
|
||||
RcsUceAdapter(int subId) {
|
||||
RcsUceAdapter(Context context, int subId) {
|
||||
mContext = context;
|
||||
mSubId = subId;
|
||||
}
|
||||
|
||||
@@ -290,7 +292,8 @@ public class RcsUceAdapter {
|
||||
};
|
||||
|
||||
try {
|
||||
imsRcsController.requestCapabilities(mSubId, contactNumbers, internalCallback);
|
||||
imsRcsController.requestCapabilities(mSubId, mContext.getOpPackageName(),
|
||||
mContext.getFeatureId(), contactNumbers, internalCallback);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Error calling IImsRcsController#requestCapabilities", e);
|
||||
throw new ImsException("Remote IMS Service is not available",
|
||||
@@ -340,7 +343,7 @@ public class RcsUceAdapter {
|
||||
* available. This can happen if the ImsService has crashed, for example, or if the subscription
|
||||
* becomes inactive. See {@link ImsException#getCode()} for more information on the error codes.
|
||||
*/
|
||||
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
|
||||
@RequiresPermission(Manifest.permission.READ_PHONE_STATE)
|
||||
public boolean isUceSettingEnabled() throws ImsException {
|
||||
IImsRcsController imsRcsController = getIImsRcsController();
|
||||
if (imsRcsController == null) {
|
||||
@@ -348,9 +351,10 @@ public class RcsUceAdapter {
|
||||
throw new ImsException("Can not find remote IMS service",
|
||||
ImsException.CODE_ERROR_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
|
||||
try {
|
||||
return imsRcsController.isUceSettingEnabled(mSubId);
|
||||
// Telephony.SimInfo#IMS_RCS_UCE_ENABLED can also be used to listen to changes to this.
|
||||
return imsRcsController.isUceSettingEnabled(mSubId, mContext.getOpPackageName(),
|
||||
mContext.getFeatureId());
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Error calling IImsRcsController#isUceSettingEnabled", e);
|
||||
throw new ImsException("Remote IMS Service is not available",
|
||||
@@ -361,6 +365,10 @@ public class RcsUceAdapter {
|
||||
/**
|
||||
* Change the user’s setting for whether or not UCE is enabled for the associated subscription.
|
||||
* <p>
|
||||
* If an application Requires UCE, they may launch an Activity using the Intent
|
||||
* {@link ImsRcsManager#ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN}, which will ask the user if
|
||||
* they wish to enable this feature.
|
||||
* <p>
|
||||
* Note: This setting does not affect whether or not the device publishes its service
|
||||
* capabilities if the subscription supports presence publication.
|
||||
*
|
||||
@@ -370,7 +378,10 @@ public class RcsUceAdapter {
|
||||
* {@link RcsUceAdapter} is valid, but the ImsService associated with the subscription is not
|
||||
* available. This can happen if the ImsService has crashed, for example, or if the subscription
|
||||
* becomes inactive. See {@link ImsException#getCode()} for more information on the error codes.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
|
||||
public void setUceSettingEnabled(boolean isEnabled) throws ImsException {
|
||||
IImsRcsController imsRcsController = getIImsRcsController();
|
||||
|
||||
@@ -42,8 +42,9 @@ interface IImsRcsController {
|
||||
boolean isAvailable(int subId, int capability);
|
||||
|
||||
// ImsUceAdapter specific
|
||||
void requestCapabilities(int subId, in List<Uri> contactNumbers, IRcsUceControllerCallback c);
|
||||
void requestCapabilities(int subId, String callingPackage, String callingFeatureId,
|
||||
in List<Uri> contactNumbers, IRcsUceControllerCallback c);
|
||||
int getUcePublishState(int subId);
|
||||
boolean isUceSettingEnabled(int subId);
|
||||
boolean isUceSettingEnabled(int subId, String callingPackage, String callingFeatureId);
|
||||
void setUceSettingEnabled(int subId, boolean isEnabled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user