Merge "Support putting one Ethernet interface in server mode."
diff --git a/Android.bp b/Android.bp
index f97d307..a211d26 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1064,7 +1064,11 @@
"--hide MissingPermission --hide BroadcastBehavior " +
"--hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol " +
"--hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo " +
- "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.*"
+ "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.* " +
+ "--api-lint-ignore-prefix android.icu. " +
+ "--api-lint-ignore-prefix java. " +
+ "--api-lint-ignore-prefix junit. " +
+ "--api-lint-ignore-prefix org. "
build = [
"StubLibraries.bp",
diff --git a/apex/sdkextensions/framework/Android.bp b/apex/sdkextensions/framework/Android.bp
index dd17473..245a96b 100644
--- a/apex/sdkextensions/framework/Android.bp
+++ b/apex/sdkextensions/framework/Android.bp
@@ -32,6 +32,7 @@
libs: [ "framework-annotations-lib" ],
permitted_packages: [ "android.os.ext" ],
installable: true,
+ plugins: ["java_api_finder"],
visibility: [
"//frameworks/base/apex/sdkextensions",
"//frameworks/base/apex/sdkextensions/testing",
diff --git a/api/current.txt b/api/current.txt
index fb77629..22f014e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -9873,6 +9873,7 @@
field public static final String STORAGE_STATS_SERVICE = "storagestats";
field public static final String SYSTEM_HEALTH_SERVICE = "systemhealth";
field public static final String TELECOM_SERVICE = "telecom";
+ field public static final String TELEPHONY_IMS_SERVICE = "telephony_ims";
field public static final String TELEPHONY_SERVICE = "phone";
field public static final String TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service";
field public static final String TEXT_CLASSIFICATION_SERVICE = "textclassification";
@@ -43569,6 +43570,7 @@
method public void registerCallback(android.telecom.Call.Callback);
method public void registerCallback(android.telecom.Call.Callback, android.os.Handler);
method public void reject(boolean, String);
+ method public void reject(int);
method public void removeExtras(java.util.List<java.lang.String>);
method public void removeExtras(java.lang.String...);
method public void respondToRttRequest(int, boolean);
@@ -43584,6 +43586,8 @@
field public static final String EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS = "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS";
field public static final String EXTRA_SILENT_RINGING_REQUESTED = "android.telecom.extra.SILENT_RINGING_REQUESTED";
field public static final String EXTRA_SUGGESTED_PHONE_ACCOUNTS = "android.telecom.extra.SUGGESTED_PHONE_ACCOUNTS";
+ field public static final int REJECT_REASON_DECLINED = 1; // 0x1
+ field public static final int REJECT_REASON_UNWANTED = 2; // 0x2
field public static final int STATE_ACTIVE = 4; // 0x4
field public static final int STATE_AUDIO_PROCESSING = 12; // 0xc
field public static final int STATE_CONNECTING = 9; // 0x9
@@ -43851,6 +43855,7 @@
method public void onPostDialContinue(boolean);
method public void onPullExternalCall();
method public void onReject();
+ method public void onReject(int);
method public void onReject(String);
method public void onSeparate();
method public void onShowIncomingCallUi();
@@ -46386,13 +46391,20 @@
public final class ImsException extends java.lang.Exception {
method public int getCode();
+ field public static final int CODE_ERROR_INVALID_SUBSCRIPTION = 3; // 0x3
field public static final int CODE_ERROR_SERVICE_UNAVAILABLE = 1; // 0x1
field public static final int CODE_ERROR_UNSPECIFIED = 0; // 0x0
field public static final int CODE_ERROR_UNSUPPORTED_OPERATION = 2; // 0x2
}
+ public class ImsManager {
+ method @NonNull public android.telephony.ims.ImsMmTelManager getImsMmTelManager(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";
+ }
+
public class ImsMmTelManager implements android.telephony.ims.RegistrationManager {
- method @NonNull @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
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(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public void getRegistrationTransportType(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public int getVoWiFiModeSetting();
diff --git a/api/system-current.txt b/api/system-current.txt
index 121f39a..b0fe305 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -93,6 +93,7 @@
field public static final String INTERNAL_SYSTEM_WINDOW = "android.permission.INTERNAL_SYSTEM_WINDOW";
field public static final String INVOKE_CARRIER_SETUP = "android.permission.INVOKE_CARRIER_SETUP";
field public static final String KILL_UID = "android.permission.KILL_UID";
+ field public static final String LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH = "android.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH";
field public static final String LOCAL_MAC_ADDRESS = "android.permission.LOCAL_MAC_ADDRESS";
field public static final String LOCK_DEVICE = "android.permission.LOCK_DEVICE";
field public static final String LOOP_RADIO = "android.permission.LOOP_RADIO";
@@ -1590,7 +1591,6 @@
field public static final String STATS_MANAGER = "stats";
field public static final String STATUS_BAR_SERVICE = "statusbar";
field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
- field public static final String TELEPHONY_IMS_SERVICE = "telephony_ims";
field public static final String TELEPHONY_REGISTRY_SERVICE = "telephony_registry";
field public static final String TETHERING_SERVICE = "tethering";
field public static final String VR_SERVICE = "vrmanager";
@@ -7217,6 +7217,7 @@
field public static final String HPLMNS = "hplmns";
field public static final String ICC_ID = "icc_id";
field public static final String IMSI = "imsi";
+ field public static final String IMS_RCS_UCE_ENABLED = "ims_rcs_uce_enabled";
field public static final String ISO_COUNTRY_CODE = "iso_country_code";
field public static final String IS_EMBEDDED = "is_embedded";
field public static final String IS_OPPORTUNISTIC = "is_opportunistic";
@@ -8986,6 +8987,7 @@
method public int getSleepTimeMillis();
method public long getTimestamp();
method @NonNull public java.util.List<android.telephony.ModemActivityInfo.TransmitPower> getTransmitPowerInfo();
+ method public boolean isValid();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ModemActivityInfo> CREATOR;
field public static final int TX_POWER_LEVELS = 5; // 0x5
@@ -9083,6 +9085,7 @@
method public void onRadioPowerStateChanged(int);
method public void onSrvccStateChanged(int);
method public void onVoiceActivationStateChanged(int);
+ field @RequiresPermission(android.Manifest.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH) public static final int LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH = 512; // 0x200
field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_CALL = 268435456; // 0x10000000
field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_SMS = 536870912; // 0x20000000
@@ -9534,6 +9537,7 @@
method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAlwaysReportSignalStrength(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
@@ -9560,6 +9564,7 @@
method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String);
field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED";
field public static final String ACTION_EMERGENCY_ASSISTANCE = "android.telephony.action.EMERGENCY_ASSISTANCE";
+ field public static final String ACTION_SERVICE_PROVIDERS_UPDATED = "android.telephony.action.SERVICE_PROVIDERS_UPDATED";
field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
@@ -9572,7 +9577,12 @@
field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff
field public static final String EXTRA_ANOMALY_DESCRIPTION = "android.telephony.extra.ANOMALY_DESCRIPTION";
field public static final String EXTRA_ANOMALY_ID = "android.telephony.extra.ANOMALY_ID";
+ field public static final String EXTRA_DATA_SPN = "android.telephony.extra.DATA_SPN";
+ field public static final String EXTRA_PLMN = "android.telephony.extra.PLMN";
+ field public static final String EXTRA_SHOW_PLMN = "android.telephony.extra.SHOW_PLMN";
+ field public static final String EXTRA_SHOW_SPN = "android.telephony.extra.SHOW_SPN";
field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
+ field public static final String EXTRA_SPN = "android.telephony.extra.SPN";
field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
@@ -10161,15 +10171,12 @@
}
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_FORBIDDEN_NO_SERVICE_AUTHORIZATION = "com.android.internal.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION";
- 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";
}
public class ImsMmTelManager implements android.telephony.ims.RegistrationManager {
+ method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getFeatureState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>) throws android.telephony.ims.ImsException;
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getRegistrationState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiRoamingModeSetting();
@@ -10537,8 +10544,8 @@
method public int describeContents();
method @NonNull public java.util.List<java.lang.String> getCapableExtensionTags();
method @NonNull public android.net.Uri getContactUri();
- method @Nullable public android.net.Uri getServiceUri(int);
- method public boolean isCapable(int);
+ method @Nullable public android.net.Uri getServiceUri(long);
+ method public boolean isCapable(long);
method public boolean isCapable(@NonNull String);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field public static final int CAPABILITY_CALL_COMPOSER = 4194304; // 0x400000
@@ -10560,6 +10567,7 @@
field public static final int CAPABILITY_IMAGE_SHARE = 256; // 0x100
field public static final int CAPABILITY_IP_VIDEO_CALL = 16384; // 0x4000
field public static final int CAPABILITY_IP_VOICE_CALL = 8192; // 0x2000
+ field public static final int CAPABILITY_MMTEL_CALL_COMPOSER = 1073741824; // 0x40000000
field public static final int CAPABILITY_PLUG_IN = 268435456; // 0x10000000
field public static final int CAPABILITY_POST_CALL = 8388608; // 0x800000
field public static final int CAPABILITY_RCS_VIDEO_CALL = 1048576; // 0x100000
@@ -10568,6 +10576,7 @@
field public static final int CAPABILITY_SHARED_MAP = 16777216; // 0x1000000
field public static final int CAPABILITY_SHARED_SKETCH = 33554432; // 0x2000000
field public static final int CAPABILITY_SOCIAL_PRESENCE = 2048; // 0x800
+ field public static final int CAPABILITY_STANDALONE_CHAT_BOT = 536870912; // 0x20000000
field public static final int CAPABILITY_VIDEO_SHARE = 1024; // 0x400
field public static final int CAPABILITY_VIDEO_SHARE_DURING_CS_CALL = 512; // 0x200
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.RcsContactUceCapability> CREATOR;
@@ -10575,12 +10584,43 @@
public static class RcsContactUceCapability.Builder {
ctor public RcsContactUceCapability.Builder(@NonNull android.net.Uri);
- method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(int, @NonNull android.net.Uri);
- method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(int);
+ method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(long, @NonNull android.net.Uri);
+ method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(long);
method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(@NonNull String);
method @NonNull public android.telephony.ims.RcsContactUceCapability build();
}
+ public class RcsUceAdapter {
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getUcePublishState() throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void requestCapabilities(@NonNull java.util.concurrent.Executor, @NonNull java.util.List<android.net.Uri>, @NonNull android.telephony.ims.RcsUceAdapter.CapabilitiesCallback) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
+ field public static final int ERROR_ALREADY_IN_QUEUE = 13; // 0xd
+ field public static final int ERROR_FORBIDDEN = 6; // 0x6
+ field public static final int ERROR_GENERIC_FAILURE = 1; // 0x1
+ field public static final int ERROR_INSUFFICIENT_MEMORY = 11; // 0xb
+ field public static final int ERROR_LOST_NETWORK = 12; // 0xc
+ field public static final int ERROR_NOT_AUTHORIZED = 5; // 0x5
+ field public static final int ERROR_NOT_AVAILABLE = 3; // 0x3
+ field public static final int ERROR_NOT_ENABLED = 2; // 0x2
+ field public static final int ERROR_NOT_FOUND = 7; // 0x7
+ field public static final int ERROR_NOT_REGISTERED = 4; // 0x4
+ field public static final int ERROR_REQUEST_TIMEOUT = 10; // 0xa
+ field public static final int ERROR_REQUEST_TOO_LARGE = 8; // 0x8
+ field public static final int PUBLISH_STATE_200_OK = 1; // 0x1
+ field public static final int PUBLISH_STATE_NOT_PUBLISHED = 2; // 0x2
+ field public static final int PUBLISH_STATE_OTHER_ERROR = 6; // 0x6
+ 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_VOLTE_PROVISION_ERROR = 3; // 0x3
+ }
+
+ public static class RcsUceAdapter.CapabilitiesCallback {
+ ctor public RcsUceAdapter.CapabilitiesCallback();
+ method public void onCapabilitiesReceived(@NonNull java.util.List<android.telephony.ims.RcsContactUceCapability>);
+ method public void onError(int);
+ }
+
}
package android.telephony.ims.feature {
@@ -10670,6 +10710,8 @@
public class RcsFeature extends android.telephony.ims.feature.ImsFeature {
ctor public RcsFeature();
method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method @NonNull public android.telephony.ims.stub.RcsSipOptionsImplBase getOptionsExchangeImpl();
+ method @NonNull public android.telephony.ims.stub.RcsPresenceExchangeImplBase getPresenceExchangeImpl();
method public final void notifyCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.RcsFeature.RcsImsCapabilities);
method public void onFeatureReady();
method public void onFeatureRemoved();
@@ -10862,6 +10904,71 @@
field public static final int INVALID_RESULT = -1; // 0xffffffff
}
+ public class RcsCapabilityExchange {
+ ctor public RcsCapabilityExchange();
+ method public final void onCommandUpdate(int, int) throws android.telephony.ims.ImsException;
+ field public static final int COMMAND_CODE_FETCH_ERROR = 4; // 0x4
+ field public static final int COMMAND_CODE_GENERIC_FAILURE = 2; // 0x2
+ field public static final int COMMAND_CODE_INSUFFICIENT_MEMORY = 6; // 0x6
+ field public static final int COMMAND_CODE_INVALID_PARAM = 3; // 0x3
+ field public static final int COMMAND_CODE_LOST_NETWORK_CONNECTION = 7; // 0x7
+ field public static final int COMMAND_CODE_NOT_FOUND = 9; // 0x9
+ field public static final int COMMAND_CODE_NOT_SUPPORTED = 8; // 0x8
+ field public static final int COMMAND_CODE_NO_CHANGE_IN_CAP = 11; // 0xb
+ field public static final int COMMAND_CODE_REQUEST_TIMEOUT = 5; // 0x5
+ field public static final int COMMAND_CODE_SERVICE_UNAVAILABLE = 10; // 0xa
+ field public static final int COMMAND_CODE_SERVICE_UNKNOWN = 0; // 0x0
+ field public static final int COMMAND_CODE_SUCCESS = 1; // 0x1
+ }
+
+ public class RcsPresenceExchangeImplBase extends android.telephony.ims.stub.RcsCapabilityExchange {
+ ctor public RcsPresenceExchangeImplBase();
+ method public final void onCapabilityRequestResponse(@NonNull java.util.List<android.telephony.ims.RcsContactUceCapability>, int) throws android.telephony.ims.ImsException;
+ method public final void onNetworkResponse(int, @NonNull String, int) throws android.telephony.ims.ImsException;
+ method public final void onNotifyUpdateCapabilites(int) throws android.telephony.ims.ImsException;
+ method public final void onUnpublish() throws android.telephony.ims.ImsException;
+ method public void requestCapabilities(@NonNull java.util.List<android.net.Uri>, int);
+ method public void updateCapabilities(@NonNull android.telephony.ims.RcsContactUceCapability, int);
+ field public static final int CAPABILITY_UPDATE_TRIGGER_ETAG_EXPIRED = 0; // 0x0
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_2G = 6; // 0x6
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_3G = 5; // 0x5
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_EHRPD = 3; // 0x3
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_HSPAPLUS = 4; // 0x4
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_IWLAN = 8; // 0x8
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_LTE_VOPS_DISABLED = 1; // 0x1
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_LTE_VOPS_ENABLED = 2; // 0x2
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_NR5G_VOPS_DISABLED = 10; // 0xa
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_NR5G_VOPS_ENABLED = 11; // 0xb
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_WLAN = 7; // 0x7
+ field public static final int CAPABILITY_UPDATE_TRIGGER_UNKNOWN = 9; // 0x9
+ field public static final int RESPONSE_FORBIDDEN = 3; // 0x3
+ field public static final int RESPONSE_NOT_AUTHORIZED_FOR_PRESENCE = 2; // 0x2
+ field public static final int RESPONSE_NOT_FOUND = 4; // 0x4
+ field public static final int RESPONSE_NOT_REGISTERED = 1; // 0x1
+ field public static final int RESPONSE_SIP_INTERVAL_TOO_SHORT = 7; // 0x7
+ field public static final int RESPONSE_SIP_REQUEST_TIMEOUT = 5; // 0x5
+ field public static final int RESPONSE_SIP_SERVICE_UNAVAILABLE = 8; // 0x8
+ field public static final int RESPONSE_SUBSCRIBE_GENERIC_FAILURE = -1; // 0xffffffff
+ field public static final int RESPONSE_SUBSCRIBE_TOO_LARGE = 6; // 0x6
+ field public static final int RESPONSE_SUCCESS = 0; // 0x0
+ }
+
+ public class RcsSipOptionsImplBase extends android.telephony.ims.stub.RcsCapabilityExchange {
+ ctor public RcsSipOptionsImplBase();
+ method public final void onCapabilityRequestResponse(int, @NonNull String, @Nullable android.telephony.ims.RcsContactUceCapability, int) throws android.telephony.ims.ImsException;
+ method public final void onRemoteCapabilityRequest(@NonNull android.net.Uri, @NonNull android.telephony.ims.RcsContactUceCapability, int) throws android.telephony.ims.ImsException;
+ method public void respondToCapabilityRequest(@NonNull String, @NonNull android.telephony.ims.RcsContactUceCapability, int);
+ method public void respondToCapabilityRequestWithError(@NonNull android.net.Uri, int, @NonNull String, int);
+ method public void sendCapabilityRequest(@NonNull android.net.Uri, @NonNull android.telephony.ims.RcsContactUceCapability, int);
+ field public static final int RESPONSE_BAD_REQUEST = 5; // 0x5
+ field public static final int RESPONSE_DOES_NOT_EXIST_ANYWHERE = 4; // 0x4
+ field public static final int RESPONSE_GENERIC_FAILURE = -1; // 0xffffffff
+ field public static final int RESPONSE_NOT_FOUND = 3; // 0x3
+ field public static final int RESPONSE_REQUEST_TIMEOUT = 2; // 0x2
+ field public static final int RESPONSE_SUCCESS = 0; // 0x0
+ field public static final int RESPONSE_TEMPORARILY_UNAVAILABLE = 1; // 0x1
+ }
+
}
package android.telephony.mbms {
diff --git a/api/test-current.txt b/api/test-current.txt
index fcf68dc..827ec34 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -657,7 +657,6 @@
field public static final String PERMISSION_SERVICE = "permission";
field public static final String ROLLBACK_SERVICE = "rollback";
field public static final String STATUS_BAR_SERVICE = "statusbar";
- field public static final String TELEPHONY_IMS_SERVICE = "telephony_ims";
field public static final String TEST_NETWORK_SERVICE = "test_network";
}
@@ -3400,15 +3399,12 @@
}
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_FORBIDDEN_NO_SERVICE_AUTHORIZATION = "com.android.internal.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION";
- 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";
}
public class ImsMmTelManager implements android.telephony.ims.RegistrationManager {
+ method @Deprecated @NonNull @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void getFeatureState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>) throws android.telephony.ims.ImsException;
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 int getVoWiFiRoamingModeSetting();
@@ -3768,6 +3764,87 @@
method public void onProvisioningStringChanged(int, @NonNull String);
}
+ public final class RcsContactUceCapability implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<java.lang.String> getCapableExtensionTags();
+ method @NonNull public android.net.Uri getContactUri();
+ method @Nullable public android.net.Uri getServiceUri(long);
+ method public boolean isCapable(long);
+ method public boolean isCapable(@NonNull String);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CAPABILITY_CALL_COMPOSER = 4194304; // 0x400000
+ field public static final int CAPABILITY_CHAT_BOT = 67108864; // 0x4000000
+ field public static final int CAPABILITY_CHAT_BOT_ROLE = 134217728; // 0x8000000
+ field public static final int CAPABILITY_CHAT_SESSION = 2; // 0x2
+ field public static final int CAPABILITY_CHAT_SESSION_STORE_FORWARD = 4; // 0x4
+ field public static final int CAPABILITY_CHAT_STANDALONE = 1; // 0x1
+ field public static final int CAPABILITY_DISCOVERY_VIA_PRESENCE = 4096; // 0x1000
+ field public static final int CAPABILITY_FILE_TRANSFER = 8; // 0x8
+ field public static final int CAPABILITY_FILE_TRANSFER_HTTP = 64; // 0x40
+ field public static final int CAPABILITY_FILE_TRANSFER_SMS = 128; // 0x80
+ field public static final int CAPABILITY_FILE_TRANSFER_STORE_FORWARD = 32; // 0x20
+ field public static final int CAPABILITY_FILE_TRANSFER_THUMBNAIL = 16; // 0x10
+ field public static final int CAPABILITY_GEOLOCATION_PULL = 131072; // 0x20000
+ field public static final int CAPABILITY_GEOLOCATION_PULL_FILE_TRANSFER = 262144; // 0x40000
+ field public static final int CAPABILITY_GEOLOCATION_PUSH = 32768; // 0x8000
+ field public static final int CAPABILITY_GEOLOCATION_PUSH_SMS = 65536; // 0x10000
+ field public static final int CAPABILITY_IMAGE_SHARE = 256; // 0x100
+ field public static final int CAPABILITY_IP_VIDEO_CALL = 16384; // 0x4000
+ field public static final int CAPABILITY_IP_VOICE_CALL = 8192; // 0x2000
+ field public static final int CAPABILITY_MMTEL_CALL_COMPOSER = 1073741824; // 0x40000000
+ field public static final int CAPABILITY_PLUG_IN = 268435456; // 0x10000000
+ field public static final int CAPABILITY_POST_CALL = 8388608; // 0x800000
+ field public static final int CAPABILITY_RCS_VIDEO_CALL = 1048576; // 0x100000
+ field public static final int CAPABILITY_RCS_VIDEO_ONLY_CALL = 2097152; // 0x200000
+ field public static final int CAPABILITY_RCS_VOICE_CALL = 524288; // 0x80000
+ field public static final int CAPABILITY_SHARED_MAP = 16777216; // 0x1000000
+ field public static final int CAPABILITY_SHARED_SKETCH = 33554432; // 0x2000000
+ field public static final int CAPABILITY_SOCIAL_PRESENCE = 2048; // 0x800
+ field public static final int CAPABILITY_STANDALONE_CHAT_BOT = 536870912; // 0x20000000
+ field public static final int CAPABILITY_VIDEO_SHARE = 1024; // 0x400
+ field public static final int CAPABILITY_VIDEO_SHARE_DURING_CS_CALL = 512; // 0x200
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.RcsContactUceCapability> CREATOR;
+ }
+
+ public static class RcsContactUceCapability.Builder {
+ ctor public RcsContactUceCapability.Builder(@NonNull android.net.Uri);
+ method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(long, @NonNull android.net.Uri);
+ method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(long);
+ method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(@NonNull String);
+ method @NonNull public android.telephony.ims.RcsContactUceCapability build();
+ }
+
+ public class RcsUceAdapter {
+ method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public int getUcePublishState() throws android.telephony.ims.ImsException;
+ method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException;
+ method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void requestCapabilities(@NonNull java.util.concurrent.Executor, @NonNull java.util.List<android.net.Uri>, @NonNull android.telephony.ims.RcsUceAdapter.CapabilitiesCallback) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
+ field public static final int ERROR_ALREADY_IN_QUEUE = 13; // 0xd
+ field public static final int ERROR_FORBIDDEN = 6; // 0x6
+ field public static final int ERROR_GENERIC_FAILURE = 1; // 0x1
+ field public static final int ERROR_INSUFFICIENT_MEMORY = 11; // 0xb
+ field public static final int ERROR_LOST_NETWORK = 12; // 0xc
+ field public static final int ERROR_NOT_AUTHORIZED = 5; // 0x5
+ field public static final int ERROR_NOT_AVAILABLE = 3; // 0x3
+ field public static final int ERROR_NOT_ENABLED = 2; // 0x2
+ field public static final int ERROR_NOT_FOUND = 7; // 0x7
+ field public static final int ERROR_NOT_REGISTERED = 4; // 0x4
+ field public static final int ERROR_REQUEST_TIMEOUT = 10; // 0xa
+ field public static final int ERROR_REQUEST_TOO_LARGE = 8; // 0x8
+ field public static final int PUBLISH_STATE_200_OK = 1; // 0x1
+ field public static final int PUBLISH_STATE_NOT_PUBLISHED = 2; // 0x2
+ field public static final int PUBLISH_STATE_OTHER_ERROR = 6; // 0x6
+ 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_VOLTE_PROVISION_ERROR = 3; // 0x3
+ }
+
+ public static class RcsUceAdapter.CapabilitiesCallback {
+ ctor public RcsUceAdapter.CapabilitiesCallback();
+ method public void onCapabilitiesReceived(@NonNull java.util.List<android.telephony.ims.RcsContactUceCapability>);
+ method public void onError(int);
+ }
+
}
package android.telephony.ims.feature {
@@ -3857,6 +3934,8 @@
public class RcsFeature extends android.telephony.ims.feature.ImsFeature {
ctor public RcsFeature();
method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method @NonNull public android.telephony.ims.stub.RcsSipOptionsImplBase getOptionsExchangeImpl();
+ method @NonNull public android.telephony.ims.stub.RcsPresenceExchangeImplBase getPresenceExchangeImpl();
method public final void notifyCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.RcsFeature.RcsImsCapabilities);
method public void onFeatureReady();
method public void onFeatureRemoved();
@@ -4049,6 +4128,71 @@
field public static final int INVALID_RESULT = -1; // 0xffffffff
}
+ public class RcsCapabilityExchange {
+ ctor public RcsCapabilityExchange();
+ method public final void onCommandUpdate(int, int) throws android.telephony.ims.ImsException;
+ field public static final int COMMAND_CODE_FETCH_ERROR = 4; // 0x4
+ field public static final int COMMAND_CODE_GENERIC_FAILURE = 2; // 0x2
+ field public static final int COMMAND_CODE_INSUFFICIENT_MEMORY = 6; // 0x6
+ field public static final int COMMAND_CODE_INVALID_PARAM = 3; // 0x3
+ field public static final int COMMAND_CODE_LOST_NETWORK_CONNECTION = 7; // 0x7
+ field public static final int COMMAND_CODE_NOT_FOUND = 9; // 0x9
+ field public static final int COMMAND_CODE_NOT_SUPPORTED = 8; // 0x8
+ field public static final int COMMAND_CODE_NO_CHANGE_IN_CAP = 11; // 0xb
+ field public static final int COMMAND_CODE_REQUEST_TIMEOUT = 5; // 0x5
+ field public static final int COMMAND_CODE_SERVICE_UNAVAILABLE = 10; // 0xa
+ field public static final int COMMAND_CODE_SERVICE_UNKNOWN = 0; // 0x0
+ field public static final int COMMAND_CODE_SUCCESS = 1; // 0x1
+ }
+
+ public class RcsPresenceExchangeImplBase extends android.telephony.ims.stub.RcsCapabilityExchange {
+ ctor public RcsPresenceExchangeImplBase();
+ method public final void onCapabilityRequestResponse(@NonNull java.util.List<android.telephony.ims.RcsContactUceCapability>, int) throws android.telephony.ims.ImsException;
+ method public final void onNetworkResponse(int, @NonNull String, int) throws android.telephony.ims.ImsException;
+ method public final void onNotifyUpdateCapabilites(int) throws android.telephony.ims.ImsException;
+ method public final void onUnpublish() throws android.telephony.ims.ImsException;
+ method public void requestCapabilities(@NonNull java.util.List<android.net.Uri>, int);
+ method public void updateCapabilities(@NonNull android.telephony.ims.RcsContactUceCapability, int);
+ field public static final int CAPABILITY_UPDATE_TRIGGER_ETAG_EXPIRED = 0; // 0x0
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_2G = 6; // 0x6
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_3G = 5; // 0x5
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_EHRPD = 3; // 0x3
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_HSPAPLUS = 4; // 0x4
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_IWLAN = 8; // 0x8
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_LTE_VOPS_DISABLED = 1; // 0x1
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_LTE_VOPS_ENABLED = 2; // 0x2
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_NR5G_VOPS_DISABLED = 10; // 0xa
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_NR5G_VOPS_ENABLED = 11; // 0xb
+ field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_WLAN = 7; // 0x7
+ field public static final int CAPABILITY_UPDATE_TRIGGER_UNKNOWN = 9; // 0x9
+ field public static final int RESPONSE_FORBIDDEN = 3; // 0x3
+ field public static final int RESPONSE_NOT_AUTHORIZED_FOR_PRESENCE = 2; // 0x2
+ field public static final int RESPONSE_NOT_FOUND = 4; // 0x4
+ field public static final int RESPONSE_NOT_REGISTERED = 1; // 0x1
+ field public static final int RESPONSE_SIP_INTERVAL_TOO_SHORT = 7; // 0x7
+ field public static final int RESPONSE_SIP_REQUEST_TIMEOUT = 5; // 0x5
+ field public static final int RESPONSE_SIP_SERVICE_UNAVAILABLE = 8; // 0x8
+ field public static final int RESPONSE_SUBSCRIBE_GENERIC_FAILURE = -1; // 0xffffffff
+ field public static final int RESPONSE_SUBSCRIBE_TOO_LARGE = 6; // 0x6
+ field public static final int RESPONSE_SUCCESS = 0; // 0x0
+ }
+
+ public class RcsSipOptionsImplBase extends android.telephony.ims.stub.RcsCapabilityExchange {
+ ctor public RcsSipOptionsImplBase();
+ method public final void onCapabilityRequestResponse(int, @NonNull String, @Nullable android.telephony.ims.RcsContactUceCapability, int) throws android.telephony.ims.ImsException;
+ method public final void onRemoteCapabilityRequest(@NonNull android.net.Uri, @NonNull android.telephony.ims.RcsContactUceCapability, int) throws android.telephony.ims.ImsException;
+ method public void respondToCapabilityRequest(@NonNull String, @NonNull android.telephony.ims.RcsContactUceCapability, int);
+ method public void respondToCapabilityRequestWithError(@NonNull android.net.Uri, int, @NonNull String, int);
+ method public void sendCapabilityRequest(@NonNull android.net.Uri, @NonNull android.telephony.ims.RcsContactUceCapability, int);
+ field public static final int RESPONSE_BAD_REQUEST = 5; // 0x5
+ field public static final int RESPONSE_DOES_NOT_EXIST_ANYWHERE = 4; // 0x4
+ field public static final int RESPONSE_GENERIC_FAILURE = -1; // 0xffffffff
+ field public static final int RESPONSE_NOT_FOUND = 3; // 0x3
+ field public static final int RESPONSE_REQUEST_TIMEOUT = 2; // 0x2
+ field public static final int RESPONSE_SUCCESS = 0; // 0x0
+ field public static final int RESPONSE_TEMPORARILY_UNAVAILABLE = 1; // 0x1
+ }
+
}
package android.telephony.mbms {
diff --git a/cmds/telecom/src/com/android/commands/telecom/Telecom.java b/cmds/telecom/src/com/android/commands/telecom/Telecom.java
index 1987440..9707405 100644
--- a/cmds/telecom/src/com/android/commands/telecom/Telecom.java
+++ b/cmds/telecom/src/com/android/commands/telecom/Telecom.java
@@ -366,12 +366,8 @@
}
private void runGetMaxPhones() throws RemoteException {
- // This assumes the max number of SIMs is 2, which it currently is
- if (TelephonyManager.MULTISIM_ALLOWED == mTelephonyManager.isMultiSimSupported()) {
- System.out.println("2");
- } else {
- System.out.println("1");
- }
+ // how many logical modems can be potentially active simultaneously
+ System.out.println(mTelephonyManager.getSupportedModemCount());
}
private void runSetEmergencyPhoneAccountPackageFilter() throws RemoteException {
diff --git a/core/java/android/annotation/SystemApi.java b/core/java/android/annotation/SystemApi.java
index 2cb93e4..ecbfed9 100644
--- a/core/java/android/annotation/SystemApi.java
+++ b/core/java/android/annotation/SystemApi.java
@@ -23,6 +23,7 @@
import static java.lang.annotation.ElementType.PACKAGE;
import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@@ -40,39 +41,48 @@
*/
@Target({TYPE, FIELD, METHOD, CONSTRUCTOR, ANNOTATION_TYPE, PACKAGE})
@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(SystemApi.Container.class) // TODO(b/146727827): make this non-repeatable
public @interface SystemApi {
enum Client {
/**
* Specifies that the intended clients of a SystemApi are privileged apps.
- * This is the default value for {@link #client}. This implies
- * MODULE_APPS and MODULE_LIBRARIES as well, which means that APIs will also
- * be available to module apps and jars.
+ * This is the default value for {@link #client}.
+ * TODO Update the javadoc according to the final spec
*/
PRIVILEGED_APPS,
/**
- * Specifies that the intended clients of a SystemApi are modules implemented
- * as apps, like the NetworkStack app. This implies MODULE_LIBRARIES as well,
- * which means that APIs will also be available to module jars.
+ * DO NOT USE. Use PRIVILEGED_APPS instead.
+ * (This would provide no further protection over PRIVILEGED_APPS; do not rely on it)
+ * @deprecated Use #PRIVILEGED_APPS instead
*/
+ @Deprecated
MODULE_APPS,
/**
* Specifies that the intended clients of a SystemApi are modules implemented
* as libraries, like the conscrypt.jar in the conscrypt APEX.
+ * TODO Update the javadoc according to the final spec
*/
- MODULE_LIBRARIES
+ MODULE_LIBRARIES,
+
+ /**
+ * Specifies that the system API is available only in the system server process.
+ * Use this to expose APIs from code loaded by the system server process <em>but</em>
+ * not in <pre>BOOTCLASSPATH</pre>.
+ * TODO(b/148177503) Update "services-stubs" and actually use it.
+ */
+ SYSTEM_SERVER
}
+ /** @deprecated do not use */
+ @Deprecated
enum Process {
- /**
- * Specifies that the SystemAPI is available in every Java processes.
- * This is the default value for {@link #process}.
- */
+ /** @deprecated do not use */
ALL,
/**
- * Specifies that the SystemAPI is available only in the system server process.
+ * @deprecated use Client#SYSTEM_SERVER instead
*/
SYSTEM_SERVER
}
@@ -83,7 +93,18 @@
Client client() default android.annotation.SystemApi.Client.PRIVILEGED_APPS;
/**
- * The process(es) that this SystemAPI is available
+ * @deprecated use Client#SYSTEM_SERVER instead for system_server APIs
*/
+ @Deprecated
Process process() default android.annotation.SystemApi.Process.ALL;
+
+
+ /**
+ * Container for {@link SystemApi} that allows it to be applied repeatedly to types.
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(TYPE)
+ @interface Container {
+ SystemApi[] value();
+ }
}
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 472d956..8fa00ab 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4854,10 +4854,7 @@
/**
* Use with {@link #getSystemService(String)} to retrieve an
* {@link android.telephony.ims.ImsManager}.
- * @hide
*/
- @SystemApi
- @TestApi
public static final String TELEPHONY_IMS_SERVICE = "telephony_ims";
/**
diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java
index ca07c89..1611d28 100644
--- a/core/java/android/provider/Telephony.java
+++ b/core/java/android/provider/Telephony.java
@@ -5252,6 +5252,12 @@
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.
+ */
+ public static final String IMS_RCS_UCE_ENABLED = "ims_rcs_uce_enabled";
+
+ /**
* TelephonyProvider column name for whether a subscription is opportunistic, that is,
* whether the network it connects to is limited in functionality or coverage.
* For example, CBRS.
diff --git a/core/java/android/telephony/PhoneStateListener.java b/core/java/android/telephony/PhoneStateListener.java
index f886cf5..03e7361 100644
--- a/core/java/android/telephony/PhoneStateListener.java
+++ b/core/java/android/telephony/PhoneStateListener.java
@@ -168,6 +168,16 @@
public static final int LISTEN_SIGNAL_STRENGTHS = 0x00000100;
/**
+ * Listen for always reported changes of the network signal strengths (cellular),
+ * even in some situations such as the screen of the device is off.
+ *
+ * @hide
+ */
+ @RequiresPermission(android.Manifest.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH)
+ @SystemApi
+ public static final int LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH = 0x00000200;
+
+ /**
* Listen for changes to observed cell info.
*
* @see #onCellInfoChanged
diff --git a/core/java/com/android/internal/util/ConnectivityUtil.java b/core/java/com/android/internal/util/LocationPermissionChecker.java
similarity index 71%
rename from core/java/com/android/internal/util/ConnectivityUtil.java
rename to core/java/com/android/internal/util/LocationPermissionChecker.java
index b1d4fa0d..dc318b4 100644
--- a/core/java/com/android/internal/util/ConnectivityUtil.java
+++ b/core/java/com/android/internal/util/LocationPermissionChecker.java
@@ -33,28 +33,59 @@
/**
- * Utility methods for common functionality using by different networks.
+ * The methods used for location permission and location mode checking.
*
* @hide
*/
-public class ConnectivityUtil {
+public class LocationPermissionChecker {
- private static final String TAG = "ConnectivityUtil";
+ private static final String TAG = "LocationPermissionChecker";
private final Context mContext;
- private final AppOpsManager mAppOps;
+ private final AppOpsManager mAppOpsManager;
private final UserManager mUserManager;
+ private final LocationManager mLocationManager;
- public ConnectivityUtil(Context context) {
+ public LocationPermissionChecker(Context context) {
mContext = context;
- mAppOps = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
+ mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
+ mLocationManager =
+ (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
}
/**
- * API to determine if the caller has fine/coarse location permission (depending on
- * config/targetSDK level) and the location mode is enabled for the user. SecurityException is
- * thrown if the caller has no permission or the location mode is disabled.
+ * Check location permission granted by the caller.
+ *
+ * This API check if the location mode enabled for the caller and the caller has
+ * ACCESS_COARSE_LOCATION permission is targetSDK<29, otherwise, has ACCESS_FINE_LOCATION.
+ *
+ * @param pkgName package name of the application requesting access
+ * @param featureId The feature in the package
+ * @param uid The uid of the package
+ * @param message A message describing why the permission was checked. Only needed if this is
+ * not inside of a two-way binder call from the data receiver
+ *
+ * @return {@code true} returns if the caller has location permission and the location mode is
+ * enabled.
+ */
+ public boolean checkLocationPermission(String pkgName, @Nullable String featureId,
+ int uid, @Nullable String message) {
+ try {
+ enforceLocationPermission(pkgName, featureId, uid, message);
+ return true;
+ } catch (SecurityException e) {
+ return false;
+ }
+ }
+
+ /**
+ * Enforce the caller has location permission.
+ *
+ * This API determines if the location mode enabled for the caller and the caller has
+ * ACCESS_COARSE_LOCATION permission is targetSDK<29, otherwise, has ACCESS_FINE_LOCATION.
+ * SecurityException is thrown if the caller has no permission or the location mode is disabled.
+ *
* @param pkgName package name of the application requesting access
* @param featureId The feature in the package
* @param uid The uid of the package
@@ -62,31 +93,21 @@
* not inside of a two-way binder call from the data receiver
*/
public void enforceLocationPermission(String pkgName, @Nullable String featureId, int uid,
- @Nullable String message)
- throws SecurityException {
+ @Nullable String message) throws SecurityException {
+
checkPackage(uid, pkgName);
// Location mode must be enabled
if (!isLocationModeEnabled()) {
- // Location mode is disabled, scan results cannot be returned
throw new SecurityException("Location mode is disabled for the device");
}
// LocationAccess by App: caller must have Coarse/Fine Location permission to have access to
// location information.
- boolean canAppPackageUseLocation = checkCallersLocationPermission(pkgName, featureId,
- uid, /* coarseForTargetSdkLessThanQ */ true, message);
-
- // If neither caller or app has location access, there is no need to check
- // any other permissions. Deny access to scan results.
- if (!canAppPackageUseLocation) {
+ if (!checkCallersLocationPermission(pkgName, featureId,
+ uid, /* coarseForTargetSdkLessThanQ */ true, message)) {
throw new SecurityException("UID " + uid + " has no location permission");
}
- // If the User or profile is current, permission is granted
- // Otherwise, uid must have INTERACT_ACROSS_USERS_FULL permission.
- if (!isCurrentProfile(uid) && !checkInteractAcrossUsersFull(uid)) {
- throw new SecurityException("UID " + uid + " profile not permitted");
- }
}
/**
@@ -104,6 +125,7 @@
*/
public boolean checkCallersLocationPermission(String pkgName, @Nullable String featureId,
int uid, boolean coarseForTargetSdkLessThanQ, @Nullable String message) {
+
boolean isTargetSdkLessThanQ = isTargetSdkLessThan(pkgName, Build.VERSION_CODES.Q, uid);
String permissionType = Manifest.permission.ACCESS_FINE_LOCATION;
@@ -111,8 +133,7 @@
// Having FINE permission implies having COARSE permission (but not the reverse)
permissionType = Manifest.permission.ACCESS_COARSE_LOCATION;
}
- if (getUidPermission(permissionType, uid)
- == PackageManager.PERMISSION_DENIED) {
+ if (getUidPermission(permissionType, uid) == PackageManager.PERMISSION_DENIED) {
return false;
}
@@ -134,10 +155,8 @@
* Retrieves a handle to LocationManager (if not already done) and check if location is enabled.
*/
public boolean isLocationModeEnabled() {
- LocationManager locationManager =
- (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
try {
- return locationManager.isLocationEnabledForUser(UserHandle.of(
+ return mLocationManager.isLocationEnabledForUser(UserHandle.of(
getCurrentUser()));
} catch (Exception e) {
Log.e(TAG, "Failure to get location mode via API, falling back to settings", e);
@@ -166,28 +185,15 @@
private boolean noteAppOpAllowed(String op, String pkgName, @Nullable String featureId,
int uid, @Nullable String message) {
- return mAppOps.noteOp(op, uid, pkgName) == AppOpsManager.MODE_ALLOWED;
+ return mAppOpsManager.noteOp(op, uid, pkgName) == AppOpsManager.MODE_ALLOWED;
}
- private void checkPackage(int uid, String pkgName) throws SecurityException {
+ private void checkPackage(int uid, String pkgName)
+ throws SecurityException {
if (pkgName == null) {
throw new SecurityException("Checking UID " + uid + " but Package Name is Null");
}
- mAppOps.checkPackage(uid, pkgName);
- }
-
- private boolean isCurrentProfile(int uid) {
- UserHandle currentUser = UserHandle.of(getCurrentUser());
- UserHandle callingUser = UserHandle.getUserHandleForUid(uid);
- return currentUser.equals(callingUser)
- || mUserManager.isSameProfileGroup(
- currentUser.getIdentifier(), callingUser.getIdentifier());
- }
-
- private boolean checkInteractAcrossUsersFull(int uid) {
- return getUidPermission(
- android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, uid)
- == PackageManager.PERMISSION_GRANTED;
+ mAppOpsManager.checkPackage(uid, pkgName);
}
@VisibleForTesting
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 5c204ab..0c0493b 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2082,6 +2082,11 @@
<permission android:name="android.permission.READ_ACTIVE_EMERGENCY_SESSION"
android:protectionLevel="signature" />
+ <!-- @SystemApi Allows listen permission to always reported signal strength.
+ @hide Used internally. -->
+ <permission android:name="android.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH"
+ android:protectionLevel="signature|telephony" />
+
<!-- @SystemApi Protects the ability to register any PhoneAccount with
PhoneAccount#CAPABILITY_SIM_SUBSCRIPTION. This capability indicates that the PhoneAccount
corresponds to a device SIM.
diff --git a/core/tests/utiltests/src/com/android/internal/util/ConnectivityUtilTest.java b/core/tests/utiltests/src/com/android/internal/util/LocationPermissionCheckerTest.java
similarity index 83%
rename from core/tests/utiltests/src/com/android/internal/util/ConnectivityUtilTest.java
rename to core/tests/utiltests/src/com/android/internal/util/LocationPermissionCheckerTest.java
index 5564712..6a0a3dc 100644
--- a/core/tests/utiltests/src/com/android/internal/util/ConnectivityUtilTest.java
+++ b/core/tests/utiltests/src/com/android/internal/util/LocationPermissionCheckerTest.java
@@ -27,6 +27,7 @@
import static org.mockito.Mockito.when;
import android.Manifest;
+import android.app.ActivityManager;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -47,8 +48,8 @@
import java.util.HashMap;
-/** Unit tests for {@link ConnectivityUtil}. */
-public class ConnectivityUtilTest {
+/** Unit tests for {@link LocationPermissionChecker}. */
+public class LocationPermissionCheckerTest {
public static final String TAG = "ConnectivityUtilTest";
@@ -84,18 +85,7 @@
private boolean mThrowSecurityException;
private Answer<Integer> mReturnPermission;
private HashMap<String, Integer> mPermissionsList = new HashMap<String, Integer>();
-
- private class TestConnectivityUtil extends ConnectivityUtil {
-
- TestConnectivityUtil(Context context) {
- super(context);
- }
-
- @Override
- protected int getCurrentUser() {
- return mCurrentUser;
- }
- }
+ private LocationPermissionChecker mChecker;
@Before
public void setUp() {
@@ -140,11 +130,12 @@
mThrowSecurityException = true;
mMockApplInfo.targetSdkVersion = Build.VERSION_CODES.M;
mIsLocationEnabled = false;
- mCurrentUser = UserHandle.USER_SYSTEM;
+ mCurrentUser = ActivityManager.getCurrentUser();
mCoarseLocationPermission = PackageManager.PERMISSION_DENIED;
mFineLocationPermission = PackageManager.PERMISSION_DENIED;
mAllowCoarseLocationApps = AppOpsManager.MODE_ERRORED;
mAllowFineLocationApps = AppOpsManager.MODE_ERRORED;
+ mChecker = new LocationPermissionChecker(mMockContext);
}
private void setupMockInterface() {
@@ -188,8 +179,7 @@
mWifiScanAllowApps = AppOpsManager.MODE_ALLOWED;
mUid = mCurrentUser;
setupTestCase();
- new TestConnectivityUtil(mMockContext)
- .enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null);
+ mChecker.enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null);
}
@Test
@@ -202,8 +192,7 @@
mAllowFineLocationApps = AppOpsManager.MODE_ALLOWED;
mWifiScanAllowApps = AppOpsManager.MODE_ALLOWED;
setupTestCase();
- new TestConnectivityUtil(mMockContext)
- .enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null);
+ mChecker.enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null);
}
@Test
@@ -216,22 +205,8 @@
setupTestCase();
assertThrows(SecurityException.class,
- () -> new TestConnectivityUtil(mMockContext)
- .enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
- }
-
- @Test
- public void testenforceCanAccessScanResults_UserOrProfileNotCurrent() throws Exception {
- mIsLocationEnabled = true;
- mThrowSecurityException = false;
- mCoarseLocationPermission = PackageManager.PERMISSION_GRANTED;
- mAllowCoarseLocationApps = AppOpsManager.MODE_ALLOWED;
- mWifiScanAllowApps = AppOpsManager.MODE_ALLOWED;
- setupTestCase();
-
- assertThrows(SecurityException.class,
- () -> new TestConnectivityUtil(mMockContext)
- .enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
+ () -> mChecker.enforceLocationPermission(
+ TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
}
@Test
@@ -240,8 +215,8 @@
mIsLocationEnabled = true;
setupTestCase();
assertThrows(SecurityException.class,
- () -> new TestConnectivityUtil(mMockContext)
- .enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
+ () -> mChecker.enforceLocationPermission(
+ TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
}
@Test
@@ -255,8 +230,8 @@
setupTestCase();
assertThrows(SecurityException.class,
- () -> new TestConnectivityUtil(mMockContext)
- .enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
+ () -> mChecker.enforceLocationPermission(
+ TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
verify(mMockAppOps, never()).noteOp(anyInt(), anyInt(), anyString());
}
@@ -271,8 +246,8 @@
setupTestCase();
assertThrows(SecurityException.class,
- () -> new TestConnectivityUtil(mMockContext)
- .enforceLocationPermission(TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
+ () -> mChecker.enforceLocationPermission(
+ TEST_PKG_NAME, TEST_FEATURE_ID, mUid, null));
}
private static void assertThrows(Class<? extends Exception> exceptionClass, Runnable r) {
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 62743aa..5eacb28 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -882,6 +882,10 @@
remove(r.binder);
}
}
+ if ((events & PhoneStateListener.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH)
+ != 0) {
+ updateReportSignalStrengthDecision(r.subId);
+ }
if (validateEventsAndUserLocked(r, PhoneStateListener.LISTEN_CELL_INFO)) {
try {
if (DBG_LOC) log("listen: mCellInfo[" + phoneId + "] = "
@@ -1005,6 +1009,27 @@
}
}
+ private void updateReportSignalStrengthDecision(int subscriptionId) {
+ synchronized (mRecords) {
+ TelephonyManager telephonyManager = (TelephonyManager) mContext
+ .getSystemService(Context.TELEPHONY_SERVICE);
+ for (Record r : mRecords) {
+ // If any of the system clients wants to always listen to signal strength,
+ // we need to set it on.
+ if (r.matchPhoneStateListenerEvent(
+ PhoneStateListener.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH)) {
+ telephonyManager.createForSubscriptionId(subscriptionId)
+ .setAlwaysReportSignalStrength(true);
+ return;
+ }
+ }
+ // If none of the system clients wants to always listen to signal strength,
+ // we need to set it off.
+ telephonyManager.createForSubscriptionId(subscriptionId)
+ .setAlwaysReportSignalStrength(false);
+ }
+ }
+
private String getCallIncomingNumber(Record record, int phoneId) {
// Only reveal the incoming number if the record has read call log permission.
return record.canReadCallLog() ? mCallIncomingNumber[phoneId] : "";
@@ -1062,6 +1087,14 @@
}
mRecords.remove(i);
+
+ // Every time a client that is registrating to always receive the signal
+ // strength is removed from registry records, we need to check if
+ // the signal strength decision needs to update on its slot.
+ if (r.matchPhoneStateListenerEvent(
+ PhoneStateListener.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH)) {
+ updateReportSignalStrengthDecision(r.subId);
+ }
return;
}
}
@@ -2415,6 +2448,11 @@
android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION, null);
}
+ if ((events & PhoneStateListener.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH) != 0) {
+ mContext.enforceCallingOrSelfPermission(
+ android.Manifest.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH, null);
+ }
+
if ((events & PhoneStateListener.LISTEN_OEM_HOOK_RAW_EVENT) != 0) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index f021008..5833d16 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -272,6 +272,7 @@
static final int MSG_BG_START_TIMEOUT = 1;
static final int MSG_UPDATE_FOREGROUND_APPS = 2;
+ static final int MSG_ENSURE_NOT_START_BG = 3;
ServiceMap(Looper looper, int userId) {
super(looper);
@@ -289,6 +290,11 @@
case MSG_UPDATE_FOREGROUND_APPS: {
updateForegroundApps(this);
} break;
+ case MSG_ENSURE_NOT_START_BG: {
+ synchronized (mAm) {
+ rescheduleDelayedStartsLocked();
+ }
+ } break;
}
}
@@ -296,7 +302,9 @@
if (mStartingBackground.remove(r)) {
if (DEBUG_DELAYED_STARTS) Slog.v(TAG_SERVICE,
"No longer background starting: " + r);
- rescheduleDelayedStartsLocked();
+ removeMessages(MSG_ENSURE_NOT_START_BG);
+ Message msg = obtainMessage(MSG_ENSURE_NOT_START_BG);
+ sendMessage(msg);
}
if (mDelayedStartList.remove(r)) {
if (DEBUG_DELAYED_STARTS) Slog.v(TAG_SERVICE, "No longer delaying start: " + r);
diff --git a/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java b/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java
index 4d229ef..625766a 100644
--- a/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java
+++ b/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java
@@ -157,6 +157,8 @@
String expected =
"TestThread2 annotated stack trace:\n" +
" at java.lang.Object.wait(Native Method)\n" +
+ " at java.lang.Object.wait(Object.java:442)\n" +
+ " at java.lang.Object.wait(Object.java:568)\n" +
" at com.android.server.WatchdogDiagnosticsTest$TestThread2.y(" +
"WatchdogDiagnosticsTest.java:91)\n" +
" - locked <HASH> (a java.lang.String)\n" +
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index acf51f3..f54f8d1 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -265,6 +265,29 @@
public static final String EVENT_HANDOVER_FAILED =
"android.telecom.event.HANDOVER_FAILED";
+
+ /**
+ * Reject reason used with {@link #reject(int)} to indicate that the user is rejecting this
+ * call because they have declined to answer it. This typically means that they are unable
+ * to answer the call at this time and would prefer it be sent to voicemail.
+ */
+ public static final int REJECT_REASON_DECLINED = 1;
+
+ /**
+ * Reject reason used with {@link #reject(int)} to indicate that the user is rejecting this
+ * call because it is an unwanted call. This allows the user to indicate that they are
+ * rejecting a call because it is likely a nuisance call.
+ */
+ public static final int REJECT_REASON_UNWANTED = 2;
+
+ /**
+ * @hide
+ */
+ @IntDef(prefix = { "REJECT_REASON_" },
+ value = {REJECT_REASON_DECLINED, REJECT_REASON_UNWANTED})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface RejectReason {};
+
public static class Details {
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@@ -1520,6 +1543,16 @@
}
/**
+ * Instructs the {@link ConnectionService} providing this {@link #STATE_RINGING} call that the
+ * user has chosen to reject the call and has indicated a reason why the call is being rejected.
+ *
+ * @param rejectReason the reason the call is being rejected.
+ */
+ public void reject(@RejectReason int rejectReason) {
+ mInCallAdapter.rejectCall(mTelecomCallId, rejectReason);
+ }
+
+ /**
* Instructs this {@code Call} to disconnect.
*/
public void disconnect() {
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index c934625..72c66d2 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -3037,6 +3037,17 @@
public void onReject() {}
/**
+ * Notifies this Connection, which is in {@link #STATE_RINGING}, of a request to reject.
+ * <p>
+ * For managed {@link ConnectionService}s, this will be called when the user rejects a call via
+ * the default dialer's {@link InCallService} using {@link Call#reject(int)}.
+ * @param rejectReason the reason the user provided for rejecting the call.
+ */
+ public void onReject(@android.telecom.Call.RejectReason int rejectReason) {
+ // to be implemented by ConnectionService.
+ }
+
+ /**
* Notifies this Connection, which is in {@link #STATE_RINGING}, of
* a request to reject with a message.
*/
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 440f044..00c2918 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -194,6 +194,7 @@
private static final int MSG_CREATE_CONFERENCE = 35;
private static final int MSG_CREATE_CONFERENCE_COMPLETE = 36;
private static final int MSG_CREATE_CONFERENCE_FAILED = 37;
+ private static final int MSG_REJECT_WITH_REASON = 38;
private static Connection sNullConnection;
@@ -450,6 +451,21 @@
}
@Override
+ public void rejectWithReason(String callId,
+ @android.telecom.Call.RejectReason int rejectReason, Session.Info sessionInfo) {
+ Log.startSession(sessionInfo, SESSION_REJECT);
+ try {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = callId;
+ args.argi1 = rejectReason;
+ args.arg2 = Log.createSubsession();
+ mHandler.obtainMessage(MSG_REJECT_WITH_REASON, args).sendToTarget();
+ } finally {
+ Log.endSession();
+ }
+ }
+
+ @Override
public void rejectWithMessage(String callId, String message, Session.Info sessionInfo) {
Log.startSession(sessionInfo, SESSION_REJECT_MESSAGE);
try {
@@ -1053,6 +1069,17 @@
}
break;
}
+ case MSG_REJECT_WITH_REASON: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ Log.continueSession((Session) args.arg2, SESSION_HANDLER + SESSION_REJECT);
+ try {
+ reject((String) args.arg1, args.argi1);
+ } finally {
+ args.recycle();
+ Log.endSession();
+ }
+ break;
+ }
case MSG_REJECT_WITH_MESSAGE: {
SomeArgs args = (SomeArgs) msg.obj;
Log.continueSession((Session) args.arg3,
@@ -1981,6 +2008,11 @@
findConnectionForAction(callId, "reject").onReject(rejectWithMessage);
}
+ private void reject(String callId, @android.telecom.Call.RejectReason int rejectReason) {
+ Log.d(this, "reject %s with reason %d", callId, rejectReason);
+ findConnectionForAction(callId, "reject").onReject(rejectReason);
+ }
+
private void silence(String callId) {
Log.d(this, "silence %s", callId);
findConnectionForAction(callId, "silence").onSilence();
diff --git a/telecomm/java/android/telecom/InCallAdapter.java b/telecomm/java/android/telecom/InCallAdapter.java
index 2612468..594c1eb 100644
--- a/telecomm/java/android/telecom/InCallAdapter.java
+++ b/telecomm/java/android/telecom/InCallAdapter.java
@@ -89,6 +89,19 @@
}
/**
+ * Instructs Telecom to reject the specified call.
+ *
+ * @param callId The identifier of the call to reject.
+ * @param rejectReason The reason the call was rejected.
+ */
+ public void rejectCall(String callId, @Call.RejectReason int rejectReason) {
+ try {
+ mAdapter.rejectCallWithReason(callId, rejectReason);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
* Instructs Telecom to disconnect the specified call.
*
* @param callId The identifier of the call to disconnect.
diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl
index 96f2483..4249dff 100644
--- a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl
+++ b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl
@@ -77,6 +77,8 @@
void reject(String callId, in Session.Info sessionInfo);
+ void rejectWithReason(String callId, int rejectReason, in Session.Info sessionInfo);
+
void rejectWithMessage(String callId, String message, in Session.Info sessionInfo);
void disconnect(String callId, in Session.Info sessionInfo);
diff --git a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl
index 60745e4..eb2d714 100644
--- a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl
@@ -34,6 +34,8 @@
void rejectCall(String callId, boolean rejectWithMessage, String textMessage);
+ void rejectCallWithReason(String callId, int rejectReason);
+
void disconnectCall(String callId);
void holdCall(String callId);
diff --git a/telephony/java/android/telephony/ImsManager.java b/telephony/java/android/telephony/ImsManager.java
index 9b4292f..704e5aa 100644
--- a/telephony/java/android/telephony/ImsManager.java
+++ b/telephony/java/android/telephony/ImsManager.java
@@ -27,11 +27,7 @@
/**
* Provides access to information about Telephony IMS services on the device.
- *
- * @hide
*/
-@SystemApi
-@TestApi
@SystemService(Context.TELEPHONY_IMS_SERVICE)
public class ImsManager {
@@ -45,7 +41,10 @@
* <p class="note">
* Carrier applications may listen to this broadcast to be notified of possible IMS provisioning
* issues.
+ * @hide
*/
+ @SystemApi
+ @TestApi
// Moved from TelephonyIntents, need to keep backwards compatibility with OEM apps that have
// this value hard-coded in BroadcastReceiver.
@SuppressLint("ActionValue")
@@ -104,7 +103,10 @@
* @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)) {
diff --git a/telephony/java/android/telephony/ModemActivityInfo.java b/telephony/java/android/telephony/ModemActivityInfo.java
index aee7cca..bd2375f 100644
--- a/telephony/java/android/telephony/ModemActivityInfo.java
+++ b/telephony/java/android/telephony/ModemActivityInfo.java
@@ -199,10 +199,10 @@
}
/**
+ * Indicate if the ModemActivityInfo is invalid due to modem's invalid reporting.
+ *
* @return {@code true} if this {@link ModemActivityInfo} record is valid,
* {@code false} otherwise.
- *
- * @hide
*/
public boolean isValid() {
for (TransmitPower powerInfo : getTransmitPowerInfo()) {
diff --git a/telephony/java/android/telephony/PreciseDataConnectionState.java b/telephony/java/android/telephony/PreciseDataConnectionState.java
index 31434c1..0cfb8c5 100644
--- a/telephony/java/android/telephony/PreciseDataConnectionState.java
+++ b/telephony/java/android/telephony/PreciseDataConnectionState.java
@@ -20,6 +20,9 @@
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
+import android.compat.Compatibility;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.EnabledAfter;
import android.compat.annotation.UnsupportedAppUsage;
import android.net.LinkProperties;
import android.os.Build;
@@ -31,8 +34,6 @@
import android.telephony.Annotation.NetworkType;
import android.telephony.data.ApnSetting;
-import dalvik.system.VMRuntime;
-
import java.util.Objects;
@@ -134,6 +135,13 @@
}
/**
+ * To check the SDK version for {@link PreciseDataConnectionState#getDataConnectionState}.
+ */
+ @ChangeId
+ @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q)
+ private static final long GET_DATA_CONNECTION_STATE_CODE_CHANGE = 147600208L;
+
+ /**
* Returns the state of data connection that supported the apn types returned by
* {@link #getDataConnectionApnTypeBitMask()}
*
@@ -144,7 +152,7 @@
@SystemApi
public @DataState int getDataConnectionState() {
if (mState == TelephonyManager.DATA_DISCONNECTING
- && VMRuntime.getRuntime().getTargetSdkVersion() < Build.VERSION_CODES.R) {
+ && !Compatibility.isChangeEnabled(GET_DATA_CONNECTION_STATE_CODE_CHANGE)) {
return TelephonyManager.DATA_CONNECTED;
}
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index 0ba36b1..e7b2613 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -25,11 +25,12 @@
import android.annotation.SuppressAutoDoc;
import android.annotation.SystemApi;
import android.annotation.TestApi;
-import android.app.ActivityThread;
import android.app.PendingIntent;
+import android.compat.Compatibility;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.EnabledAfter;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
-import android.content.pm.PackageManager;
import android.database.CursorWindow;
import android.net.Uri;
import android.os.Build;
@@ -388,7 +389,7 @@
String destinationAddress, String scAddress, String text,
PendingIntent sentIntent, PendingIntent deliveryIntent) {
sendTextMessageInternal(destinationAddress, scAddress, text, sentIntent, deliveryIntent,
- true /* persistMessage*/, ActivityThread.currentPackageName());
+ true /* persistMessage*/, null);
}
/**
@@ -598,7 +599,7 @@
String destinationAddress, String scAddress, String text,
PendingIntent sentIntent, PendingIntent deliveryIntent) {
sendTextMessageInternal(destinationAddress, scAddress, text, sentIntent, deliveryIntent,
- false /* persistMessage */, ActivityThread.currentPackageName());
+ false /* persistMessage */, null);
}
private void sendTextMessageInternal(
@@ -641,7 +642,7 @@
ISms iSms = getISmsServiceOrThrow();
if (iSms != null) {
iSms.sendTextForSubscriberWithOptions(subId,
- ActivityThread.currentPackageName(), destinationAddress,
+ null, destinationAddress,
scAddress,
text, sentIntent, deliveryIntent, persistMessage, finalPriority,
expectMore, finalValidity);
@@ -663,7 +664,7 @@
ISms iSms = getISmsServiceOrThrow();
if (iSms != null) {
iSms.sendTextForSubscriberWithOptions(getSubscriptionId(),
- ActivityThread.currentPackageName(), destinationAddress,
+ null, destinationAddress,
scAddress,
text, sentIntent, deliveryIntent, persistMessage, finalPriority,
expectMore, finalValidity);
@@ -881,7 +882,7 @@
String destinationAddress, String scAddress, ArrayList<String> parts,
ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents) {
sendMultipartTextMessageInternal(destinationAddress, scAddress, parts, sentIntents,
- deliveryIntents, true /* persistMessage*/, ActivityThread.currentPackageName());
+ deliveryIntents, true /* persistMessage*/, null);
}
/**
@@ -898,8 +899,9 @@
* subscription.
* </p>
*
- * @param packageName serves as the default package name if
- * {@link ActivityThread#currentPackageName()} is null.
+ * @param packageName serves as the default package name if the package name that is
+ * associated with the user id is null.
+ *
* @hide
*/
@SystemApi
@@ -909,9 +911,7 @@
@NonNull List<String> parts, @Nullable List<PendingIntent> sentIntents,
@Nullable List<PendingIntent> deliveryIntents, @NonNull String packageName) {
sendMultipartTextMessageInternal(destinationAddress, scAddress, parts, sentIntents,
- deliveryIntents, true /* persistMessage*/,
- ActivityThread.currentPackageName() == null
- ? packageName : ActivityThread.currentPackageName());
+ deliveryIntents, true /* persistMessage*/, packageName);
}
private void sendMultipartTextMessageInternal(
@@ -1012,7 +1012,7 @@
String destinationAddress, String scAddress, List<String> parts,
List<PendingIntent> sentIntents, List<PendingIntent> deliveryIntents) {
sendMultipartTextMessageInternal(destinationAddress, scAddress, parts, sentIntents,
- deliveryIntents, false /* persistMessage*/, ActivityThread.currentPackageName());
+ deliveryIntents, false /* persistMessage*/, null);
}
/**
@@ -1174,7 +1174,7 @@
ISms iSms = getISmsServiceOrThrow();
if (iSms != null) {
iSms.sendMultipartTextForSubscriberWithOptions(subId,
- ActivityThread.currentPackageName(), destinationAddress,
+ null, destinationAddress,
scAddress, parts, sentIntents, deliveryIntents,
persistMessage, finalPriority, expectMore, finalValidity);
}
@@ -1196,7 +1196,7 @@
ISms iSms = getISmsServiceOrThrow();
if (iSms != null) {
iSms.sendMultipartTextForSubscriberWithOptions(getSubscriptionId(),
- ActivityThread.currentPackageName(), destinationAddress,
+ null, destinationAddress,
scAddress, parts, sentIntents, deliveryIntents,
persistMessage, finalPriority, expectMore, finalValidity);
}
@@ -1327,7 +1327,7 @@
public void onSuccess(int subId) {
try {
ISms iSms = getISmsServiceOrThrow();
- iSms.sendDataForSubscriber(subId, ActivityThread.currentPackageName(),
+ iSms.sendDataForSubscriber(subId, null,
destinationAddress, scAddress, destinationPort & 0xFFFF, data,
sentIntent, deliveryIntent);
} catch (RemoteException e) {
@@ -1453,7 +1453,6 @@
private void resolveSubscriptionForOperation(SubscriptionResolverResult resolverResult) {
int subId = getSubscriptionId();
boolean isSmsSimPickActivityNeeded = false;
- final Context context = ActivityThread.currentApplication().getApplicationContext();
try {
ISms iSms = getISmsService();
if (iSms != null) {
@@ -1475,14 +1474,14 @@
return;
}
// We need to ask the user pick an appropriate subid for the operation.
- Log.d(TAG, "resolveSubscriptionForOperation isSmsSimPickActivityNeeded is true for package "
- + context.getPackageName());
+ Log.d(TAG, "resolveSubscriptionForOperation isSmsSimPickActivityNeeded is true for calling"
+ + " package. ");
try {
// Create the SMS pick activity and call back once the activity is complete. Can't do
// it here because we do not have access to the activity context that is performing this
// operation.
// Requires that the calling process has the SEND_SMS permission.
- getITelephony().enqueueSmsPickResult(context.getOpPackageName(),
+ getITelephony().enqueueSmsPickResult(null,
new IIntegerConsumer.Stub() {
@Override
public void accept(int subId) {
@@ -1500,6 +1499,13 @@
}
}
+ /**
+ * To check the SDK version for SmsManager.sendResolverResult method.
+ */
+ @ChangeId
+ @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.P)
+ private static final long GET_TARGET_SDK_VERSION_CODE_CHANGE = 145147528L;
+
private void sendResolverResult(SubscriptionResolverResult resolverResult, int subId,
boolean pickActivityShown) {
if (SubscriptionManager.isValidSubscriptionId(subId)) {
@@ -1507,7 +1513,8 @@
return;
}
- if (getTargetSdkVersion() <= Build.VERSION_CODES.P && !pickActivityShown) {
+ if (!Compatibility.isChangeEnabled(GET_TARGET_SDK_VERSION_CODE_CHANGE)
+ && !pickActivityShown) {
// Do not fail, return a success with an INVALID subid for apps targeting P or below
// that tried to perform an operation and the SMS disambiguation dialog was never shown,
// as these applications may not have been written to handle the failure case properly.
@@ -1520,19 +1527,6 @@
}
}
- private static int getTargetSdkVersion() {
- final Context context = ActivityThread.currentApplication().getApplicationContext();
- int targetSdk;
- try {
- targetSdk = context.getPackageManager().getApplicationInfo(
- context.getOpPackageName(), 0).targetSdkVersion;
- } catch (PackageManager.NameNotFoundException e) {
- // Default to old behavior if we can not find this.
- targetSdk = -1;
- }
- return targetSdk;
- }
-
private static ITelephony getITelephony() {
ITelephony binder = ITelephony.Stub.asInterface(
ServiceManager.getService(Context.TELEPHONY_SERVICE));
@@ -1616,7 +1610,7 @@
ISms iSms = getISmsService();
if (iSms != null) {
success = iSms.copyMessageToIccEfForSubscriber(getSubscriptionId(),
- ActivityThread.currentPackageName(),
+ null,
status, pdu, smsc);
}
} catch (RemoteException ex) {
@@ -1657,7 +1651,7 @@
ISms iSms = getISmsService();
if (iSms != null) {
success = iSms.updateMessageOnIccEfForSubscriber(getSubscriptionId(),
- ActivityThread.currentPackageName(),
+ null,
messageIndex, STATUS_ON_ICC_FREE, null /* pdu */);
}
} catch (RemoteException ex) {
@@ -1700,7 +1694,7 @@
ISms iSms = getISmsService();
if (iSms != null) {
success = iSms.updateMessageOnIccEfForSubscriber(getSubscriptionId(),
- ActivityThread.currentPackageName(),
+ null,
messageIndex, newStatus, pdu);
}
} catch (RemoteException ex) {
@@ -1752,7 +1746,7 @@
if (iSms != null) {
records = iSms.getAllMessagesFromIccEfForSubscriber(
getSubscriptionId(),
- ActivityThread.currentPackageName());
+ null);
}
} catch (RemoteException ex) {
// ignore it
@@ -2495,7 +2489,7 @@
try {
ISms iccSms = getISmsServiceOrThrow();
return iccSms.createAppSpecificSmsToken(getSubscriptionId(),
- ActivityThread.currentPackageName(), intent);
+ null, intent);
} catch (RemoteException ex) {
ex.rethrowFromSystemServer();
@@ -2615,7 +2609,7 @@
try {
ISms iccSms = getISmsServiceOrThrow();
return iccSms.createAppSpecificSmsTokenWithPackageInfo(getSubscriptionId(),
- ActivityThread.currentPackageName(), prefixes, intent);
+ null, prefixes, intent);
} catch (RemoteException ex) {
ex.rethrowFromSystemServer();
@@ -2706,7 +2700,7 @@
ISms iccISms = getISmsServiceOrThrow();
if (iccISms != null) {
return iccISms.checkSmsShortCodeDestination(getSubscriptionId(),
- ActivityThread.currentPackageName(), null, destAddress, countryIso);
+ null, null, destAddress, countryIso);
}
} catch (RemoteException e) {
Log.e(TAG, "checkSmsShortCodeDestination() RemoteException", e);
@@ -2742,7 +2736,7 @@
ISms iSms = getISmsService();
if (iSms != null) {
smsc = iSms.getSmscAddressFromIccEfForSubscriber(
- getSubscriptionId(), ActivityThread.currentPackageName());
+ getSubscriptionId(), null);
}
} catch (RemoteException ex) {
// ignore it
@@ -2776,7 +2770,7 @@
ISms iSms = getISmsService();
if (iSms != null) {
return iSms.setSmscAddressOnIccEfForSubscriber(
- smsc, getSubscriptionId(), ActivityThread.currentPackageName());
+ smsc, getSubscriptionId(), null);
}
} catch (RemoteException ex) {
// ignore it
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 8adf947..ea95aac 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -677,6 +677,13 @@
public static final String WFC_IMS_ROAMING_ENABLED = SimInfo.WFC_IMS_ROAMING_ENABLED;
/**
+ * Determines if the user has enabled IMS RCS User Capability Exchange (UCE) for this
+ * subscription.
+ * @hide
+ */
+ public static final String IMS_RCS_UCE_ENABLED = SimInfo.IMS_RCS_UCE_ENABLED;
+
+ /**
* TelephonyProvider column name for whether a subscription is opportunistic, that is,
* whether the network it connects to is limited in functionality or coverage.
* For example, CBRS.
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 173f84e..3dff079 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -37,7 +37,6 @@
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.WorkerThread;
-import android.app.ActivityThread;
import android.app.PendingIntent;
import android.compat.Compatibility;
import android.compat.annotation.ChangeId;
@@ -109,8 +108,6 @@
import com.android.internal.telephony.SmsApplication;
import com.android.telephony.Rlog;
-import dalvik.system.VMRuntime;
-
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.annotation.Retention;
@@ -374,8 +371,17 @@
// effort and get the context from the current activity thread.
if (mContext != null) {
return mContext.getOpPackageName();
+ } else {
+ ITelephony telephony = getITelephony();
+ if (telephony == null) return null;
+ try {
+ return telephony.getCurrentPackageName();
+ } catch (RemoteException ex) {
+ return null;
+ } catch (NullPointerException ex) {
+ return null;
+ }
}
- return ActivityThread.currentOpPackageName();
}
private String getFeatureId() {
@@ -1222,6 +1228,80 @@
public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.extra.SUBSCRIPTION_ID";
/**
+ * Broadcast Action: The Service Provider string(s) have been updated. Activities or
+ * services that use these strings should update their display.
+ *
+ * <p>The intent will have the following extra values:
+ * <dl>
+ * <dt>{@link #EXTRA_SHOW_PLMN}</dt>
+ * <dd>Boolean that indicates whether the PLMN should be shown.</dd>
+ * <dt>{@link #EXTRA_PLMN}</dt>
+ * <dd>The operator name of the registered network, as a string.</dd>
+ * <dt>{@link #EXTRA_SHOW_SPN}</dt>
+ * <dd>Boolean that indicates whether the SPN should be shown.</dd>
+ * <dt>{@link #EXTRA_SPN}</dt>
+ * <dd>The service provider name, as a string.</dd>
+ * <dt>{@link #EXTRA_DATA_SPN}</dt>
+ * <dd>The service provider name for data service, as a string.</dd>
+ * </dl>
+ *
+ * Note that {@link #EXTRA_SHOW_PLMN} may indicate that {@link #EXTRA_PLMN} should be displayed,
+ * even though the value for {@link #EXTRA_PLMN} is null. This can happen, for example, if the
+ * phone has not registered to a network yet. In this case the receiver may substitute an
+ * appropriate placeholder string (eg, "No service").
+ *
+ * It is recommended to display {@link #EXTRA_PLMN} before / above {@link #EXTRA_SPN} if
+ * both are displayed.
+ *
+ * <p>Note: this is a protected intent that can only be sent by the system.
+ * @hide
+ */
+ @SystemApi
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_SERVICE_PROVIDERS_UPDATED =
+ "android.telephony.action.SERVICE_PROVIDERS_UPDATED";
+
+ /**
+ * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate
+ * whether the PLMN should be shown.
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_SHOW_PLMN = "android.telephony.extra.SHOW_PLMN";
+
+ /**
+ * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate
+ * the operator name of the registered network.
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_PLMN = "android.telephony.extra.PLMN";
+
+ /**
+ * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate
+ * whether the PLMN should be shown.
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_SHOW_SPN = "android.telephony.extra.SHOW_SPN";
+
+ /**
+ * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate
+ * the service provider name.
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_SPN = "android.telephony.extra.SPN";
+
+ /**
+ * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate
+ * the service provider name for data service.
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_DATA_SPN = "android.telephony.extra.DATA_SPN";
+
+ /**
* Broadcast intent action indicating that when data stall recovery is attempted by Telephony,
* intended for report every data stall recovery step attempted.
*
@@ -5109,6 +5189,13 @@
public static final int DATA_DISCONNECTING = 4;
/**
+ * To check the SDK version for {@link TelephonyManager#getDataState}.
+ */
+ @ChangeId
+ @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q)
+ private static final long GET_DATA_STATE_CODE_CHANGE = 147600208L;
+
+ /**
* Returns a constant indicating the current data connection state
* (cellular).
*
@@ -5126,7 +5213,7 @@
int state = telephony.getDataStateForSubId(
getSubId(SubscriptionManager.getActiveDataSubscriptionId()));
if (state == TelephonyManager.DATA_DISCONNECTING
- && VMRuntime.getRuntime().getTargetSdkVersion() < Build.VERSION_CODES.R) {
+ && !Compatibility.isChangeEnabled(GET_DATA_STATE_CODE_CHANGE)) {
return TelephonyManager.DATA_CONNECTED;
}
@@ -5179,6 +5266,13 @@
//
/**
+ * To check the SDK version for {@link TelephonyManager#listen}.
+ */
+ @ChangeId
+ @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.P)
+ private static final long LISTEN_CODE_CHANGE = 147600208L;
+
+ /**
* Registers a listener object to receive notification of changes
* in specified telephony states.
* <p>
@@ -5217,7 +5311,7 @@
// subId from PhoneStateListener is deprecated Q on forward, use the subId from
// TelephonyManager instance. keep using subId from PhoneStateListener for pre-Q.
int subId = mSubId;
- if (VMRuntime.getRuntime().getTargetSdkVersion() >= Build.VERSION_CODES.Q) {
+ if (Compatibility.isChangeEnabled(LISTEN_CODE_CHANGE)) {
// since mSubId in PhoneStateListener is deprecated from Q on forward, this is
// the only place to set mSubId and its for "informational" only.
// TODO: remove this once we completely get rid of mSubId in PhoneStateListener
@@ -10577,6 +10671,27 @@
}
/**
+ * Enable or disable signal strength changes from radio will always be reported in any
+ * condition (e.g. screen is off). This is only allowed for System caller.
+ *
+ * @param isEnabled {@code true} for enabling; {@code false} for disabling.
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setAlwaysReportSignalStrength(boolean isEnabled) {
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony != null) {
+ telephony.setAlwaysReportSignalStrength(getSubId(), isEnabled);
+ }
+ } catch (RemoteException ex) {
+ Log.e(TAG, "setAlwaysReportSignalStrength RemoteException", ex);
+ ex.rethrowAsRuntimeException();
+ }
+ }
+
+ /**
* Get the most recently available signal strength information.
*
* Get the most recent SignalStrength information reported by the modem. Due
diff --git a/telephony/java/android/telephony/ims/ImsException.java b/telephony/java/android/telephony/ims/ImsException.java
index cb3f0f9..643f452 100644
--- a/telephony/java/android/telephony/ims/ImsException.java
+++ b/telephony/java/android/telephony/ims/ImsException.java
@@ -61,7 +61,6 @@
* This is a configuration error and there should be no retry. The subscription used for this
* operation is either invalid or has become inactive. The active subscriptions can be queried
* with {@link SubscriptionManager#getActiveSubscriptionInfoList()}.
- * @hide
*/
public static final int CODE_ERROR_INVALID_SUBSCRIPTION = 3;
diff --git a/telephony/java/android/telephony/ims/ImsMmTelManager.java b/telephony/java/android/telephony/ims/ImsMmTelManager.java
index c66672f..ba8e90f 100644
--- a/telephony/java/android/telephony/ims/ImsMmTelManager.java
+++ b/telephony/java/android/telephony/ims/ImsMmTelManager.java
@@ -57,7 +57,8 @@
* registration and MmTel capability status callbacks, as well as query/modify user settings for the
* associated subscription.
*
- * @see #createForSubscriptionId(int)
+ * Use {@link android.telephony.ims.ImsManager#getImsMmTelManager(int)} to get an instance of this
+ * manager.
*/
public class ImsMmTelManager implements RegistrationManager {
@@ -225,8 +226,13 @@
* (see {@link android.telephony.TelephonyManager#hasCarrierPrivileges}).
*
* @throws IllegalArgumentException if the subscription is invalid.
- *
+ * @deprecated Use {@link android.telephony.ims.ImsManager#getImsMmTelManager(int)} to get an
+ * instance of this class.
+ * @hide
*/
+ @SystemApi
+ @TestApi
+ @Deprecated
@SuppressAutoDoc // No support for device / profile owner or carrier privileges (b/72967236).
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
@@ -242,7 +248,7 @@
}
/**
- * Only visible for testing, use {@link #createForSubscriptionId(int)} instead.
+ * Only visible for testing, use {@link ImsManager#getImsMmTelManager(int)} instead.
* @hide
*/
@VisibleForTesting
@@ -252,7 +258,7 @@
/**
* Registers a {@link RegistrationCallback} with the system, which will provide registration
- * updates for the subscription specified in {@link #createForSubscriptionId(int)}. Use
+ * updates for the subscription specified in {@link ImsManager#getImsMmTelManager(int)}. Use
* {@link SubscriptionManager.OnSubscriptionsChangedListener} to listen to Subscription changed
* events and call {@link #unregisterImsRegistrationCallback(RegistrationCallback)} to clean up.
*
@@ -450,7 +456,7 @@
/**
* Registers a {@link CapabilityCallback} with the system, which will provide MmTel service
* availability updates for the subscription specified in
- * {@link #createForSubscriptionId(int)}. The method {@see #isAvailable(int, int)}
+ * {@link ImsManager#getImsMmTelManager(int)}. The method {@see #isAvailable(int, int)}
* can also be used to query this information at any time.
*
* Use {@link SubscriptionManager.OnSubscriptionsChangedListener} to listen to
diff --git a/telephony/java/android/telephony/ims/ImsService.java b/telephony/java/android/telephony/ims/ImsService.java
index 62bc2ae..2b3072e 100644
--- a/telephony/java/android/telephony/ims/ImsService.java
+++ b/telephony/java/android/telephony/ims/ImsService.java
@@ -60,9 +60,10 @@
* The telephony framework will then bind to the ImsService you have defined in your manifest
* if you are either:
* 1) Defined as the default ImsService for the device in the device overlay using
- * "config_ims_package".
+ * "config_ims_mmtel_package" or "config_ims_rcs_package".
* 2) Defined as a Carrier Provided ImsService in the Carrier Configuration using
- * {@link CarrierConfigManager#KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING}.
+ * {@link CarrierConfigManager#KEY_CONFIG_IMS_MMTEL_PACKAGE_OVERRIDE_STRING} or
+ * {@link CarrierConfigManager#KEY_CONFIG_IMS_RCS_PACKAGE_OVERRIDE_STRING}.
*
* There are two ways to define to the platform which {@link ImsFeature}s this {@link ImsService}
* supports, dynamic or static definitions.
diff --git a/telephony/java/android/telephony/ims/RcsContactUceCapability.java b/telephony/java/android/telephony/ims/RcsContactUceCapability.java
index 3e2903f..57b9b7a 100644
--- a/telephony/java/android/telephony/ims/RcsContactUceCapability.java
+++ b/telephony/java/android/telephony/ims/RcsContactUceCapability.java
@@ -16,10 +16,11 @@
package android.telephony.ims;
-import android.annotation.IntDef;
+import android.annotation.LongDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
@@ -37,6 +38,7 @@
* @hide
*/
@SystemApi
+@TestApi
public final class RcsContactUceCapability implements Parcelable {
/** Supports 1-to-1 chat */
@@ -99,11 +101,16 @@
public static final int CAPABILITY_CHAT_BOT_ROLE = (1 << 27);
/** Supports the unidirectional plug-ins framework. */
public static final int CAPABILITY_PLUG_IN = (1 << 28);
+ /** Supports standalone Chatbot communication. */
+ public static final int CAPABILITY_STANDALONE_CHAT_BOT = (1 << 29);
+ /** Supports MMTEL based call composer. */
+ public static final int CAPABILITY_MMTEL_CALL_COMPOSER = (1 << 30);
+
/** @hide*/
@Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = "CAPABILITY_", flag = true, value = {
+ @LongDef(prefix = "CAPABILITY_", flag = true, value = {
CAPABILITY_CHAT_STANDALONE,
CAPABILITY_CHAT_SESSION,
CAPABILITY_CHAT_SESSION_STORE_FORWARD,
@@ -132,7 +139,9 @@
CAPABILITY_SHARED_SKETCH,
CAPABILITY_CHAT_BOT,
CAPABILITY_CHAT_BOT_ROLE,
- CAPABILITY_PLUG_IN
+ CAPABILITY_PLUG_IN,
+ CAPABILITY_STANDALONE_CHAT_BOT,
+ CAPABILITY_MMTEL_CALL_COMPOSER
})
public @interface CapabilityFlag {}
@@ -159,11 +168,11 @@
* @param type The capability to map to a service URI that is different from the contact's
* URI.
*/
- public @NonNull Builder add(@CapabilityFlag int type, @NonNull Uri serviceUri) {
+ public @NonNull Builder add(@CapabilityFlag long type, @NonNull Uri serviceUri) {
mCapabilities.mCapabilities |= type;
// Put each of these capabilities into the map separately.
- for (int shift = 0; shift < Integer.SIZE; shift++) {
- int cap = type & (1 << shift);
+ for (long shift = 0; shift < Integer.SIZE; shift++) {
+ long cap = type & (1 << shift);
if (cap != 0) {
mCapabilities.mServiceMap.put(cap, serviceUri);
// remove that capability from the field.
@@ -181,7 +190,7 @@
* Add a UCE capability flag that this contact supports.
* @param type the capability that the contact supports.
*/
- public @NonNull Builder add(@CapabilityFlag int type) {
+ public @NonNull Builder add(@CapabilityFlag long type) {
mCapabilities.mCapabilities |= type;
return this;
}
@@ -207,7 +216,7 @@
private final Uri mContactUri;
private long mCapabilities;
private List<String> mExtensionTags = new ArrayList<>();
- private Map<Integer, Uri> mServiceMap = new HashMap<>();
+ private Map<Long, Uri> mServiceMap = new HashMap<>();
/**
* Use {@link Builder} to build an instance of this interface.
@@ -225,7 +234,7 @@
// read mServiceMap as key,value pair
int mapSize = in.readInt();
for (int i = 0; i < mapSize; i++) {
- mServiceMap.put(in.readInt(), in.readParcelable(Uri.class.getClassLoader()));
+ mServiceMap.put(in.readLong(), in.readParcelable(Uri.class.getClassLoader()));
}
}
@@ -250,8 +259,8 @@
// write mServiceMap as key,value pairs
int mapSize = mServiceMap.keySet().size();
out.writeInt(mapSize);
- for (int key : mServiceMap.keySet()) {
- out.writeInt(key);
+ for (long key : mServiceMap.keySet()) {
+ out.writeLong(key);
out.writeParcelable(mServiceMap.get(key), 0);
}
}
@@ -266,7 +275,7 @@
* @param type The capability flag to query.
* @return true if the capability flag specified is set, false otherwise.
*/
- public boolean isCapable(@CapabilityFlag int type) {
+ public boolean isCapable(@CapabilityFlag long type) {
return (mCapabilities & type) > 0;
}
@@ -290,13 +299,13 @@
* <p>
* This will typically be the contact {@link Uri} available via {@link #getContactUri()} unless
* a different service {@link Uri} was associated with this capability using
- * {@link Builder#add(int, Uri)}.
+ * {@link Builder#add(long, Uri)}.
*
* @return a String containing the {@link Uri} associated with the service tag or
* {@code null} if this capability is not set as capable.
- * @see #isCapable(int)
+ * @see #isCapable(long)
*/
- public @Nullable Uri getServiceUri(@CapabilityFlag int type) {
+ public @Nullable Uri getServiceUri(@CapabilityFlag long type) {
Uri result = mServiceMap.getOrDefault(type, null);
// If the capability is capable, but does not have a service URI associated, use the default
// contact URI.
diff --git a/telephony/java/android/telephony/ims/RcsUceAdapter.java b/telephony/java/android/telephony/ims/RcsUceAdapter.java
index b47bcb9..d3f393a 100644
--- a/telephony/java/android/telephony/ims/RcsUceAdapter.java
+++ b/telephony/java/android/telephony/ims/RcsUceAdapter.java
@@ -21,6 +21,8 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.content.Context;
import android.net.Uri;
import android.os.Binder;
@@ -29,6 +31,7 @@
import android.os.ServiceManager;
import android.telephony.ims.aidl.IImsRcsController;
import android.telephony.ims.aidl.IRcsUceControllerCallback;
+import android.telephony.ims.feature.RcsFeature;
import android.util.Log;
import java.lang.annotation.Retention;
@@ -42,6 +45,8 @@
* @see ImsRcsManager#getUceAdapter() for information on creating an instance of this class.
* @hide
*/
+@SystemApi
+@TestApi
public class RcsUceAdapter {
private static final String TAG = "RcsUceAdapter";
@@ -197,6 +202,7 @@
/**
* Not to be instantiated directly, use
* {@link ImsRcsManager#getUceAdapter()} to instantiate this manager class.
+ * @hide
*/
RcsUceAdapter(int subId) {
mSubId = subId;
@@ -222,7 +228,7 @@
* becomes inactive. See {@link ImsException#getCode()} for more information on the error codes.
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- public void requestCapabilities(@CallbackExecutor Executor executor,
+ public void requestCapabilities(@NonNull @CallbackExecutor Executor executor,
@NonNull List<Uri> contactNumbers,
@NonNull CapabilitiesCallback c) throws ImsException {
if (c == null) {
@@ -299,7 +305,7 @@
* for the associated subscription.
*
* @return true if the user’s setting for UCE is enabled, false otherwise. If false,
- * {@link ImsRcsManager#isCapable(int)} will return false for
+ * {@link ImsRcsManager#isCapable(int, int)} will return false for
* {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_OPTIONS_UCE} and
* {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_PRESENCE_UCE}
* @see #setUceSettingEnabled(boolean)
diff --git a/telephony/java/android/telephony/ims/feature/MmTelFeature.java b/telephony/java/android/telephony/ims/feature/MmTelFeature.java
index f3aea49..a3ce1b5 100644
--- a/telephony/java/android/telephony/ims/feature/MmTelFeature.java
+++ b/telephony/java/android/telephony/ims/feature/MmTelFeature.java
@@ -513,7 +513,7 @@
* @param callProfile The {@link ImsCallProfile} IMS call profile with details.
* This can be null if no call information is available for the rejected call.
* @param reason The {@link ImsReasonInfo} call rejection reason.
- * * @hide
+ * @hide
*/
@SystemApi @TestApi
public final void notifyRejectedCall(@NonNull ImsCallProfile callProfile,
diff --git a/telephony/java/android/telephony/ims/feature/RcsFeature.java b/telephony/java/android/telephony/ims/feature/RcsFeature.java
index 501e0e8..e4efc2043 100644
--- a/telephony/java/android/telephony/ims/feature/RcsFeature.java
+++ b/telephony/java/android/telephony/ims/feature/RcsFeature.java
@@ -349,9 +349,8 @@
*
* @return An instance of {@link RcsSipOptionsImplBase} that implements SIP options exchange if
* it is supported by the device.
- * @hide
*/
- public RcsSipOptionsImplBase getOptionsExchangeImpl() {
+ public @NonNull RcsSipOptionsImplBase getOptionsExchangeImpl() {
// Base Implementation, override to implement functionality
return new RcsSipOptionsImplBase();
}
@@ -365,9 +364,8 @@
*
* @return An instance of {@link RcsPresenceExchangeImplBase} that implements presence
* exchange if it is supported by the device.
- * @hide
*/
- public RcsPresenceExchangeImplBase getPresenceExchangeImpl() {
+ public @NonNull RcsPresenceExchangeImplBase getPresenceExchangeImpl() {
// Base Implementation, override to implement functionality.
return new RcsPresenceExchangeImplBase();
}
diff --git a/telephony/java/android/telephony/ims/stub/ImsCallSessionImplBase.java b/telephony/java/android/telephony/ims/stub/ImsCallSessionImplBase.java
index f4367da..e8f69ea 100644
--- a/telephony/java/android/telephony/ims/stub/ImsCallSessionImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/ImsCallSessionImplBase.java
@@ -410,6 +410,13 @@
* Rejects an incoming call or session update.
*
* @param reason reason code to reject an incoming call, defined in {@link ImsReasonInfo}.
+ * The {@link android.telecom.InCallService} (dialer app) can use the
+ * {@link android.telecom.Call#reject(int)} API to reject a call while specifying
+ * a user-indicated reason for rejecting the call.
+ * Normal call declines ({@link android.telecom.Call#REJECT_REASON_DECLINED}) will
+ * map to {@link ImsReasonInfo#CODE_USER_DECLINE}.
+ * Unwanted calls ({@link android.telecom.Call#REJECT_REASON_UNWANTED}) will map
+ * to {@link ImsReasonInfo#CODE_SIP_USER_MARKED_UNWANTED}.
* {@link ImsCallSession.Listener#callSessionStartFailed}
*/
public void reject(int reason) {
diff --git a/telephony/java/android/telephony/ims/stub/RcsCapabilityExchange.java b/telephony/java/android/telephony/ims/stub/RcsCapabilityExchange.java
index fda295a..a24af2f 100644
--- a/telephony/java/android/telephony/ims/stub/RcsCapabilityExchange.java
+++ b/telephony/java/android/telephony/ims/stub/RcsCapabilityExchange.java
@@ -17,6 +17,8 @@
package android.telephony.ims.stub;
import android.annotation.IntDef;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.os.RemoteException;
import android.telephony.ims.ImsException;
import android.telephony.ims.aidl.IRcsFeatureListener;
@@ -32,6 +34,8 @@
*
* @hide
*/
+@SystemApi
+@TestApi
public class RcsCapabilityExchange {
/** Service is unknown. */
diff --git a/telephony/java/android/telephony/ims/stub/RcsPresenceExchangeImplBase.java b/telephony/java/android/telephony/ims/stub/RcsPresenceExchangeImplBase.java
index bb03448..f200ea2 100644
--- a/telephony/java/android/telephony/ims/stub/RcsPresenceExchangeImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/RcsPresenceExchangeImplBase.java
@@ -18,6 +18,8 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.net.Uri;
import android.os.RemoteException;
import android.telephony.ims.ImsException;
@@ -37,6 +39,8 @@
*
* @hide
*/
+@SystemApi
+@TestApi
public class RcsPresenceExchangeImplBase extends RcsCapabilityExchange {
private static final String LOG_TAG = "RcsPresenceExchangeIB";
diff --git a/telephony/java/android/telephony/ims/stub/RcsSipOptionsImplBase.java b/telephony/java/android/telephony/ims/stub/RcsSipOptionsImplBase.java
index 1c68fc0..355c4dd 100644
--- a/telephony/java/android/telephony/ims/stub/RcsSipOptionsImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/RcsSipOptionsImplBase.java
@@ -19,6 +19,8 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.net.Uri;
import android.os.RemoteException;
import android.telephony.ims.ImsException;
@@ -35,6 +37,8 @@
*
* @hide
*/
+@SystemApi
+@TestApi
public class RcsSipOptionsImplBase extends RcsCapabilityExchange {
private static final String LOG_TAG = "RcsSipOptionsImplBase";
@@ -69,6 +73,11 @@
*/
public static final int RESPONSE_DOES_NOT_EXIST_ANYWHERE = 4;
+ /**
+ * Indicates that the remote user responded with a 400 BAD REQUEST response.
+ */
+ public static final int RESPONSE_BAD_REQUEST = 5;
+
/** @hide*/
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = "RESPONSE_", value = {
@@ -77,7 +86,8 @@
RESPONSE_TEMPORARILY_UNAVAILABLE,
RESPONSE_REQUEST_TIMEOUT,
RESPONSE_NOT_FOUND,
- RESPONSE_DOES_NOT_EXIST_ANYWHERE
+ RESPONSE_DOES_NOT_EXIST_ANYWHERE,
+ RESPONSE_BAD_REQUEST
})
public @interface SipResponseCode {}
@@ -188,7 +198,6 @@
* @param reason A non-null String containing the reason associated with the SIP code.
* @param operationToken The token provided by the framework when
* {@link #onRemoteCapabilityRequest(Uri, RcsContactUceCapability, int)} was called.
- *
*/
public void respondToCapabilityRequestWithError(@NonNull Uri contactUri,
@SipResponseCode int code, @NonNull String reason, int operationToken) {
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index dfb4ee5..f3b467b 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -995,6 +995,11 @@
boolean isManualNetworkSelectionAllowed(int subId);
/**
+ * Enable or disable always reporting signal strength changes from radio.
+ */
+ void setAlwaysReportSignalStrength(int subId, boolean isEnable);
+
+ /**
* Get P-CSCF address from PCO after data connection is established or modified.
* @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN
* @param callingPackage The package making the call.
@@ -2109,6 +2114,11 @@
int getRadioHalVersion();
/**
+ * Get the current calling package name.
+ */
+ String getCurrentPackageName();
+
+ /**
* Returns true if the specified type of application (e.g. {@link #APPTYPE_CSIM} is present
* on the UICC card.
* @hide
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/SeamlessAppRotationTest.java b/tests/FlickerTests/src/com/android/server/wm/flicker/SeamlessAppRotationTest.java
index ae55a75..8559cb9 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/SeamlessAppRotationTest.java
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/SeamlessAppRotationTest.java
@@ -30,10 +30,12 @@
import android.view.Surface;
import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import org.junit.Before;
import org.junit.FixMethodOrder;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
@@ -50,6 +52,8 @@
@LargeTest
@RunWith(Parameterized.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@FlakyTest(bugId = 147659548)
+@Ignore("Waiting bug feedback")
public class SeamlessAppRotationTest extends FlickerTestBase {
private int mBeginRotation;
private int mEndRotation;