summaryrefslogtreecommitdiff
path: root/telephony/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java/android')
-rw-r--r--telephony/java/android/provider/Telephony.java (renamed from telephony/java/android/telephony/Telephony.java)126
-rw-r--r--telephony/java/android/telephony/CarrierConfigManager.java66
-rw-r--r--telephony/java/android/telephony/DataConnectionRealTimeInfo.java12
-rw-r--r--telephony/java/android/telephony/ModemActivityInfo.java36
-rw-r--r--telephony/java/android/telephony/SignalStrength.java15
-rw-r--r--telephony/java/android/telephony/SmsManager.java21
-rw-r--r--telephony/java/android/telephony/SmsMessage.java25
-rw-r--r--telephony/java/android/telephony/SubscriptionManager.java263
-rw-r--r--telephony/java/android/telephony/SubscriptionPlan.java1
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java255
-rw-r--r--telephony/java/android/telephony/VisualVoicemailSmsFilterSettings.java27
-rw-r--r--telephony/java/android/telephony/euicc/EuiccCardManager.java59
-rw-r--r--telephony/java/android/telephony/euicc/EuiccManager.java2
-rw-r--r--telephony/java/android/telephony/ims/ImsCallSession.java1
-rw-r--r--telephony/java/android/telephony/ims/stub/ImsConfigImplBase.java7
-rw-r--r--telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java4
16 files changed, 736 insertions, 184 deletions
diff --git a/telephony/java/android/telephony/Telephony.java b/telephony/java/android/provider/Telephony.java
index 8c4572474e6b..63263bd37206 100644
--- a/telephony/java/android/telephony/Telephony.java
+++ b/telephony/java/android/provider/Telephony.java
@@ -33,6 +33,7 @@ import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.telephony.SmsMessage;
import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Patterns;
@@ -3345,73 +3346,118 @@ public final class Telephony {
}
/**
- * Contains carrier identification information.
- * @hide
+ * Contains carrier identification information for the current subscriptions.
+ * @see SubscriptionManager#getActiveSubscriptionIdList()
*/
public static final class CarrierIdentification implements BaseColumns {
/**
- * Numeric operator ID (as String). {@code MCC + MNC}
- * <P>Type: TEXT </P>
- */
- public static final String MCCMNC = "mccmnc";
-
- /**
- * Group id level 1 (as String).
- * <P>Type: TEXT </P>
- */
- public static final String GID1 = "gid1";
-
- /**
- * Group id level 2 (as String).
- * <P>Type: TEXT </P>
- */
- public static final String GID2 = "gid2";
-
- /**
- * Public Land Mobile Network name.
- * <P>Type: TEXT </P>
+ * Not instantiable.
+ * @hide
*/
- public static final String PLMN = "plmn";
+ private CarrierIdentification() {}
/**
- * Prefix xpattern of IMSI (International Mobile Subscriber Identity).
- * <P>Type: TEXT </P>
+ * The {@code content://} style URI for this provider.
*/
- public static final String IMSI_PREFIX_XPATTERN = "imsi_prefix_xpattern";
+ public static final Uri CONTENT_URI = Uri.parse("content://carrier_identification");
/**
- * Service Provider Name.
- * <P>Type: TEXT </P>
+ * The authority string for the CarrierIdentification Provider
+ * @hide
*/
- public static final String SPN = "spn";
+ public static final String AUTHORITY = "carrier_identification";
- /**
- * Prefer APN name.
- * <P>Type: TEXT </P>
- */
- public static final String APN = "apn";
/**
- * Prefix of Integrated Circuit Card Identifier.
- * <P>Type: TEXT </P>
+ * Generates a content {@link Uri} used to receive updates on carrier identity change
+ * on the given subscriptionId
+ * <p>
+ * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
+ * carrier identity {@link TelephonyManager#getAndroidCarrierIdForSubscription()}
+ * while your app is running. You can also use a {@link JobService} to ensure your app
+ * is notified of changes to the {@link Uri} even when it is not running.
+ * Note, however, that using a {@link JobService} does not guarantee timely delivery of
+ * updates to the {@link Uri}.
+ *
+ * @param subscriptionId the subscriptionId to receive updates on
+ * @return the Uri used to observe carrier identity changes
*/
- public static final String ICCID_PREFIX = "iccid_prefix";
+ public static Uri getUriForSubscriptionId(int subscriptionId) {
+ return CONTENT_URI.buildUpon().appendEncodedPath(
+ String.valueOf(subscriptionId)).build();
+ }
/**
- * User facing carrier name.
+ * A user facing carrier name.
+ * @see TelephonyManager#getAndroidCarrierNameForSubscription()
* <P>Type: TEXT </P>
*/
public static final String NAME = "carrier_name";
/**
* A unique carrier id
+ * @see TelephonyManager#getAndroidCarrierIdForSubscription()
* <P>Type: INTEGER </P>
*/
public static final String CID = "carrier_id";
/**
- * The {@code content://} URI for this table.
+ * Contains mappings between matching rules with carrier id for all carriers.
+ * @hide
*/
- public static final Uri CONTENT_URI = Uri.parse("content://carrier_identification");
+ public static final class All implements BaseColumns {
+ /**
+ * Numeric operator ID (as String). {@code MCC + MNC}
+ * <P>Type: TEXT </P>
+ */
+ public static final String MCCMNC = "mccmnc";
+
+ /**
+ * Group id level 1 (as String).
+ * <P>Type: TEXT </P>
+ */
+ public static final String GID1 = "gid1";
+
+ /**
+ * Group id level 2 (as String).
+ * <P>Type: TEXT </P>
+ */
+ public static final String GID2 = "gid2";
+
+ /**
+ * Public Land Mobile Network name.
+ * <P>Type: TEXT </P>
+ */
+ public static final String PLMN = "plmn";
+
+ /**
+ * Prefix xpattern of IMSI (International Mobile Subscriber Identity).
+ * <P>Type: TEXT </P>
+ */
+ public static final String IMSI_PREFIX_XPATTERN = "imsi_prefix_xpattern";
+
+ /**
+ * Service Provider Name.
+ * <P>Type: TEXT </P>
+ */
+ public static final String SPN = "spn";
+
+ /**
+ * Prefer APN name.
+ * <P>Type: TEXT </P>
+ */
+ public static final String APN = "apn";
+
+ /**
+ * Prefix of Integrated Circuit Card Identifier.
+ * <P>Type: TEXT </P>
+ */
+ public static final String ICCID_PREFIX = "iccid_prefix";
+
+ /**
+ * The {@code content://} URI for this table.
+ */
+ public static final Uri CONTENT_URI = Uri.parse("content://carrier_identification/all");
+ }
}
}
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 97b81184b1c3..c8c898ad37cf 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -308,7 +308,6 @@ public class CarrierConfigManager {
*
* @see SubscriptionManager#getSubscriptionPlans(int)
* @see SubscriptionManager#setSubscriptionPlans(int, java.util.List)
- * @hide
*/
@SystemApi
public static final String KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING =
@@ -795,12 +794,11 @@ public class CarrierConfigManager {
public static final String KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL = "show_iccid_in_sim_status_bool";
/**
- * Flag specifying whether signal strength is hidden in SIM Status screen,
- * default to false.
- * @hide
+ * Flag specifying whether the {@link android.telephony.SignalStrength} is shown in the SIM
+ * Status screen. The default value is true.
*/
- public static final String KEY_HIDE_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL =
- "hide_signal_strength_in_sim_status_bool";
+ public static final String KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL =
+ "show_signal_strength_in_sim_status_bool";
/**
* Flag specifying whether an additional (client initiated) intent needs to be sent on System
@@ -953,8 +951,6 @@ public class CarrierConfigManager {
* If user has explicitly disabled some packages in the list, won't re-enable.
* Other carrier specific apps which are not in this list may be disabled for current carrier,
* and only be re-enabled when this config for another carrier includes it.
- *
- * @hide
*/
public static final String KEY_ENABLE_APPS_STRING_ARRAY = "enable_apps_string_array";
@@ -1298,24 +1294,21 @@ public class CarrierConfigManager {
*/
public static final String KEY_CDMA_3WAYCALL_FLASH_DELAY_INT = "cdma_3waycall_flash_delay_int";
-
/**
- * @hide
- * The default value for preferred CDMA roaming mode (aka CDMA system select.)
- * CDMA_ROAMING_MODE_RADIO_DEFAULT = the default roaming mode from the radio
- * CDMA_ROAMING_MODE_HOME = Home Networks
- * CDMA_ROAMING_MODE_AFFILIATED = Roaming on Affiliated networks
- * CDMA_ROAMING_MODE_ANY = Roaming on any networks
+ * The CDMA roaming mode (aka CDMA system select).
+ *
+ * <p>The value should be one of the CDMA_ROAMING_MODE_ constants in {@link TelephonyManager}.
+ * Values other than {@link TelephonyManager#CDMA_ROAMING_MODE_RADIO_DEFAULT} (which is the
+ * default) will take precedence over user selection.
+ *
+ * @see TelephonyManager#CDMA_ROAMING_MODE_RADIO_DEFAULT
+ * @see TelephonyManager#CDMA_ROAMING_MODE_HOME
+ * @see TelephonyManager#CDMA_ROAMING_MODE_AFFILIATED
+ * @see TelephonyManager#CDMA_ROAMING_MODE_ANY
*/
public static final String KEY_CDMA_ROAMING_MODE_INT = "cdma_roaming_mode_int";
- /** @hide */
- public static final int CDMA_ROAMING_MODE_RADIO_DEFAULT = -1;
- /** @hide */
- public static final int CDMA_ROAMING_MODE_HOME = 0;
- /** @hide */
- public static final int CDMA_ROAMING_MODE_AFFILIATED = 1;
- /** @hide */
- public static final int CDMA_ROAMING_MODE_ANY = 2;
+
+
/**
* Boolean indicating if support is provided for directly dialing FDN number from FDN list.
* If false, this feature is not supported.
@@ -1711,6 +1704,13 @@ public class CarrierConfigManager {
"roaming_operator_string_array";
/**
+ * Controls whether Assisted Dialing is enabled and the preference is shown. This feature
+ * transforms numbers when the user is roaming.
+ */
+ public static final String KEY_ASSISTED_DIALING_ENABLED_BOOL =
+ "assisted_dialing_enabled_bool";
+
+ /**
* URL from which the proto containing the public key of the Carrier used for
* IMSI encryption will be downloaded.
* @hide
@@ -1813,6 +1813,15 @@ public class CarrierConfigManager {
public static final String KEY_CARRIER_CONFIG_APPLIED_BOOL = "carrier_config_applied_bool";
/**
+ * Determines whether we should show a warning asking the user to check with their carrier
+ * on pricing when the user enabled data roaming.
+ * default to false.
+ * @hide
+ */
+ public static final String KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL =
+ "check_pricing_with_carrier_data_roaming_bool";
+
+ /**
* List of thresholds of RSRP for determining the display level of LTE signal bar.
* @hide
*/
@@ -1874,10 +1883,10 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_CARRIER_IMS_GBA_REQUIRED_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_INSTANT_LETTERING_AVAILABLE_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_USE_IMS_FIRST_FOR_EMERGENCY_BOOL, true);
- sDefaults.putString(KEY_CARRIER_DATA_SERVICE_WWAN_PACKAGE_OVERRIDE_STRING, "");
- sDefaults.putString(KEY_CARRIER_DATA_SERVICE_WLAN_PACKAGE_OVERRIDE_STRING, "");
sDefaults.putString(KEY_CARRIER_NETWORK_SERVICE_WWAN_PACKAGE_OVERRIDE_STRING, "");
sDefaults.putString(KEY_CARRIER_NETWORK_SERVICE_WLAN_PACKAGE_OVERRIDE_STRING, "");
+ sDefaults.putString(KEY_CARRIER_DATA_SERVICE_WWAN_PACKAGE_OVERRIDE_STRING, "");
+ sDefaults.putString(KEY_CARRIER_DATA_SERVICE_WLAN_PACKAGE_OVERRIDE_STRING, "");
sDefaults.putString(KEY_CARRIER_INSTANT_LETTERING_INVALID_CHARS_STRING, "");
sDefaults.putString(KEY_CARRIER_INSTANT_LETTERING_ESCAPED_CHARS_STRING, "");
sDefaults.putString(KEY_CARRIER_INSTANT_LETTERING_ENCODING_STRING, "");
@@ -1926,7 +1935,7 @@ public class CarrierConfigManager {
sDefaults.putString(KEY_CARRIER_VVM_PACKAGE_NAME_STRING, "");
sDefaults.putStringArray(KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY, null);
sDefaults.putBoolean(KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL, false);
- sDefaults.putBoolean(KEY_HIDE_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL, false);
+ sDefaults.putBoolean(KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL, true);
sDefaults.putBoolean(KEY_CI_ACTION_ON_SYS_UPDATE_BOOL, false);
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING, "");
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING, "");
@@ -2041,7 +2050,8 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_ALLOW_NON_EMERGENCY_CALLS_IN_ECM_BOOL, true);
sDefaults.putBoolean(KEY_USE_RCS_PRESENCE_BOOL, false);
sDefaults.putBoolean(KEY_FORCE_IMEI_BOOL, false);
- sDefaults.putInt(KEY_CDMA_ROAMING_MODE_INT, CDMA_ROAMING_MODE_RADIO_DEFAULT);
+ sDefaults.putInt(
+ KEY_CDMA_ROAMING_MODE_INT, TelephonyManager.CDMA_ROAMING_MODE_RADIO_DEFAULT);
sDefaults.putString(KEY_RCS_CONFIG_SERVER_URL_STRING, "");
// Carrier Signalling Receivers
@@ -2121,6 +2131,7 @@ public class CarrierConfigManager {
false);
sDefaults.putStringArray(KEY_NON_ROAMING_OPERATOR_STRING_ARRAY, null);
sDefaults.putStringArray(KEY_ROAMING_OPERATOR_STRING_ARRAY, null);
+ sDefaults.putBoolean(KEY_ASSISTED_DIALING_ENABLED_BOOL, true);
sDefaults.putBoolean(KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false);
sDefaults.putBoolean(KEY_RTT_SUPPORTED_BOOL, false);
sDefaults.putBoolean(KEY_DISABLE_CHARGE_INDICATION_BOOL, false);
@@ -2130,6 +2141,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_SPN_DISPLAY_RULE_USE_ROAMING_FROM_SERVICE_STATE_BOOL, false);
sDefaults.putBoolean(KEY_ALWAYS_SHOW_DATA_RAT_ICON_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_CONFIG_APPLIED_BOOL, false);
+ sDefaults.putBoolean(KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL, false);
sDefaults.putIntArray(KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY,
new int[] {
-140, /* SIGNAL_STRENGTH_NONE_OR_UNKNOWN */
diff --git a/telephony/java/android/telephony/DataConnectionRealTimeInfo.java b/telephony/java/android/telephony/DataConnectionRealTimeInfo.java
index f71f58d01ea8..fc4e17aa6f00 100644
--- a/telephony/java/android/telephony/DataConnectionRealTimeInfo.java
+++ b/telephony/java/android/telephony/DataConnectionRealTimeInfo.java
@@ -28,10 +28,14 @@ import android.os.Parcelable;
public class DataConnectionRealTimeInfo implements Parcelable {
private long mTime; // Time the info was collected since boot in nanos;
- public static final int DC_POWER_STATE_LOW = 1;
- public static final int DC_POWER_STATE_MEDIUM = 2;
- public static final int DC_POWER_STATE_HIGH = 3;
- public static final int DC_POWER_STATE_UNKNOWN = Integer.MAX_VALUE;
+ public static final int DC_POWER_STATE_LOW
+ = TelephonyProtoEnums.DATA_CONNECTION_POWER_STATE_LOW ; // = 1
+ public static final int DC_POWER_STATE_MEDIUM
+ = TelephonyProtoEnums.DATA_CONNECTION_POWER_STATE_MEDIUM; // = 2
+ public static final int DC_POWER_STATE_HIGH
+ = TelephonyProtoEnums.DATA_CONNECTION_POWER_STATE_HIGH; // = 3
+ public static final int DC_POWER_STATE_UNKNOWN
+ = TelephonyProtoEnums.DATA_CONNECTION_POWER_STATE_UNKNOWN; // = Integer.MAX_VALUE
private int mDcPowerState; // DC_POWER_STATE_[LOW | MEDIUM | HIGH | UNKNOWN]
diff --git a/telephony/java/android/telephony/ModemActivityInfo.java b/telephony/java/android/telephony/ModemActivityInfo.java
index 03ce2d8e6f6d..521adef8497f 100644
--- a/telephony/java/android/telephony/ModemActivityInfo.java
+++ b/telephony/java/android/telephony/ModemActivityInfo.java
@@ -36,12 +36,12 @@ public class ModemActivityInfo implements Parcelable {
*/
public static final int TX_POWER_LEVELS = 5;
- private final long mTimestamp;
- private final int mSleepTimeMs;
- private final int mIdleTimeMs;
- private final int [] mTxTimeMs = new int[TX_POWER_LEVELS];
- private final int mRxTimeMs;
- private final int mEnergyUsed;
+ private long mTimestamp;
+ private int mSleepTimeMs;
+ private int mIdleTimeMs;
+ private int [] mTxTimeMs = new int[TX_POWER_LEVELS];
+ private int mRxTimeMs;
+ private int mEnergyUsed;
public ModemActivityInfo(long timestamp, int sleepTimeMs, int idleTimeMs,
int[] txTimeMs, int rxTimeMs, int energyUsed) {
@@ -110,6 +110,10 @@ public class ModemActivityInfo implements Parcelable {
return mTimestamp;
}
+ public void setTimestamp(long timestamp) {
+ mTimestamp = timestamp;
+ }
+
/**
* @return tx time in ms. It's an array of tx times
* with each index...
@@ -118,6 +122,10 @@ public class ModemActivityInfo implements Parcelable {
return mTxTimeMs;
}
+ public void setTxTimeMillis(int[] txTimeMs) {
+ mTxTimeMs = txTimeMs;
+ }
+
/**
* @return sleep time in ms.
*/
@@ -125,6 +133,10 @@ public class ModemActivityInfo implements Parcelable {
return mSleepTimeMs;
}
+ public void setSleepTimeMillis(int sleepTimeMillis) {
+ mSleepTimeMs = sleepTimeMillis;
+ }
+
/**
* @return idle time in ms.
*/
@@ -132,6 +144,10 @@ public class ModemActivityInfo implements Parcelable {
return mIdleTimeMs;
}
+ public void setIdleTimeMillis(int idleTimeMillis) {
+ mIdleTimeMs = idleTimeMillis;
+ }
+
/**
* @return rx time in ms.
*/
@@ -139,6 +155,10 @@ public class ModemActivityInfo implements Parcelable {
return mRxTimeMs;
}
+ public void setRxTimeMillis(int rxTimeMillis) {
+ mRxTimeMs = rxTimeMillis;
+ }
+
/**
* product of current(mA), voltage(V) and time(ms)
* @return energy used
@@ -147,6 +167,10 @@ public class ModemActivityInfo implements Parcelable {
return mEnergyUsed;
}
+ public void setEnergyUsed(int energyUsed) {
+ mEnergyUsed = energyUsed;
+ }
+
/**
* @return if the record is valid
*/
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java
index fc2ef2782b78..778ca77662ab 100644
--- a/telephony/java/android/telephony/SignalStrength.java
+++ b/telephony/java/android/telephony/SignalStrength.java
@@ -35,15 +35,20 @@ public class SignalStrength implements Parcelable {
private static final boolean DBG = false;
/** @hide */
- public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0;
+ public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN
+ = TelephonyProtoEnums.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; // = 0
/** @hide */
- public static final int SIGNAL_STRENGTH_POOR = 1;
+ public static final int SIGNAL_STRENGTH_POOR
+ = TelephonyProtoEnums.SIGNAL_STRENGTH_POOR; // = 1
/** @hide */
- public static final int SIGNAL_STRENGTH_MODERATE = 2;
+ public static final int SIGNAL_STRENGTH_MODERATE
+ = TelephonyProtoEnums.SIGNAL_STRENGTH_MODERATE; // = 2
/** @hide */
- public static final int SIGNAL_STRENGTH_GOOD = 3;
+ public static final int SIGNAL_STRENGTH_GOOD
+ = TelephonyProtoEnums.SIGNAL_STRENGTH_GOOD; // = 3
/** @hide */
- public static final int SIGNAL_STRENGTH_GREAT = 4;
+ public static final int SIGNAL_STRENGTH_GREAT
+ = TelephonyProtoEnums.SIGNAL_STRENGTH_GREAT; // = 4
/** @hide */
public static final int NUM_SIGNAL_STRENGTH_BINS = 5;
/** @hide */
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index 9a45e7b9cc36..0874b86494e6 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -338,6 +338,11 @@ public final class SmsManager {
/**
* Send a text based SMS without writing it into the SMS Provider.
*
+ * <p>
+ * The message will be sent directly over the network and will not be visible in SMS
+ * applications. Intended for internal carrier use only.
+ * </p>
+ *
* <p>Requires Permission:
* {@link android.Manifest.permission#SEND_SMS} and
* {@link android.Manifest.permission#MODIFY_PHONE_STATE} or the calling app has carrier
@@ -345,7 +350,6 @@ public final class SmsManager {
* </p>
*
* @see #sendTextMessage(String, String, String, PendingIntent, PendingIntent)
- * @hide
*/
@SystemApi
@RequiresPermission(allOf = {
@@ -394,20 +398,23 @@ public final class SmsManager {
* Inject an SMS PDU into the android application framework.
*
* <p>Requires permission: {@link android.Manifest.permission#MODIFY_PHONE_STATE} or carrier
- * privileges. @see android.telephony.TelephonyManager#hasCarrierPrivileges
+ * privileges per {@link android.telephony.TelephonyManager#hasCarrierPrivileges}.
*
* @param pdu is the byte array of pdu to be injected into android application framework
- * @param format is the format of SMS pdu (3gpp or 3gpp2)
+ * @param format is the format of SMS pdu ({@link SmsMessage#FORMAT_3GPP} or
+ * {@link SmsMessage#FORMAT_3GPP2})
* @param receivedIntent if not NULL this <code>PendingIntent</code> is
* broadcast when the message is successfully received by the
* android application framework, or failed. This intent is broadcasted at
* the same time an SMS received from radio is acknowledged back.
- * The result code will be <code>RESULT_SMS_HANDLED</code> for success, or
- * <code>RESULT_SMS_GENERIC_ERROR</code> for error.
+ * The result code will be {@link android.provider.Telephony.Sms.Intents#RESULT_SMS_HANDLED}
+ * for success, or {@link android.provider.Telephony.Sms.Intents#RESULT_SMS_GENERIC_ERROR} for
+ * error.
*
- * @throws IllegalArgumentException if format is not one of 3gpp and 3gpp2.
+ * @throws IllegalArgumentException if the format is invalid.
*/
- public void injectSmsPdu(byte[] pdu, String format, PendingIntent receivedIntent) {
+ public void injectSmsPdu(
+ byte[] pdu, @SmsMessage.Format String format, PendingIntent receivedIntent) {
if (!format.equals(SmsMessage.FORMAT_3GPP) && !format.equals(SmsMessage.FORMAT_3GPP2)) {
// Format must be either 3gpp or 3gpp2.
throw new IllegalArgumentException(
diff --git a/telephony/java/android/telephony/SmsMessage.java b/telephony/java/android/telephony/SmsMessage.java
index 6e083c21cd5b..577ea7dfc004 100644
--- a/telephony/java/android/telephony/SmsMessage.java
+++ b/telephony/java/android/telephony/SmsMessage.java
@@ -16,25 +16,26 @@
package android.telephony;
+import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA;
+
import android.annotation.Nullable;
-import android.os.Binder;
-import android.os.Parcel;
+import android.annotation.StringDef;
import android.content.res.Resources;
+import android.os.Binder;
import android.text.TextUtils;
import com.android.internal.telephony.GsmAlphabet;
import com.android.internal.telephony.GsmAlphabet.TextEncodingDetails;
+import com.android.internal.telephony.Sms7BitEncodingTranslator;
import com.android.internal.telephony.SmsConstants;
import com.android.internal.telephony.SmsMessageBase;
import com.android.internal.telephony.SmsMessageBase.SubmitPduBase;
-import com.android.internal.telephony.Sms7BitEncodingTranslator;
-import java.lang.Math;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
-import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA;
-
/**
* A Short Message Service message.
@@ -82,15 +83,23 @@ public class SmsMessage {
*/
public static final int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153;
+ /** @hide */
+ @StringDef(prefix = { "FORMAT_" }, value = {
+ FORMAT_3GPP,
+ FORMAT_3GPP2
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Format {}
+
/**
* Indicates a 3GPP format SMS message.
- * @hide pending API council approval
+ * @see SmsManager#injectSmsPdu(byte[], String, PendingIntent)
*/
public static final String FORMAT_3GPP = "3gpp";
/**
* Indicates a 3GPP2 format SMS message.
- * @hide pending API council approval
+ * @see SmsManager#injectSmsPdu(byte[], String, PendingIntent)
*/
public static final String FORMAT_3GPP2 = "3gpp2";
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 30e75b9bed91..11a1984e8934 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -16,11 +16,18 @@
package android.telephony;
+import static android.net.NetworkPolicyManager.OVERRIDE_CONGESTED;
+import static android.net.NetworkPolicyManager.OVERRIDE_UNMETERED;
+
+import android.annotation.DurationMillisLong;
import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
-import android.annotation.SystemApi;
import android.annotation.SdkConstant.SdkConstantType;
+import android.annotation.SystemApi;
import android.annotation.SystemService;
+import android.app.BroadcastOptions;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
@@ -28,21 +35,26 @@ import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.INetworkPolicyManager;
+import android.net.NetworkCapabilities;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.ServiceManager.ServiceNotFoundException;
import android.util.DisplayMetrics;
+
import com.android.internal.telephony.IOnSubscriptionsChangedListener;
import com.android.internal.telephony.ISub;
import com.android.internal.telephony.ITelephonyRegistry;
import com.android.internal.telephony.PhoneConstants;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.TimeUnit;
/**
* SubscriptionManager is the application interface to SubscriptionController
@@ -372,6 +384,9 @@ public class SubscriptionManager {
/**
* TelephonyProvider column name for enable Volte.
+ *
+ * If this setting is not initialized (set to -1) then we use the Carrier Config value
+ * {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
*@hide
*/
public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
@@ -437,6 +452,55 @@ public class SubscriptionManager {
= "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED";
/**
+ * Activity Action: Display UI for managing the billing relationship plans
+ * between a carrier and a specific subscriber.
+ * <p>
+ * Carrier apps are encouraged to implement this activity, and the OS will
+ * provide an affordance to quickly enter this activity, typically via
+ * Settings. This affordance will only be shown when the carrier app is
+ * actively providing subscription plan information via
+ * {@link #setSubscriptionPlans(int, List)}.
+ * <p>
+ * Contains {@link #EXTRA_SUBSCRIPTION_INDEX} to indicate which subscription
+ * the user is interested in.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ @SystemApi
+ public static final String ACTION_MANAGE_SUBSCRIPTION_PLANS
+ = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS";
+
+ /**
+ * Broadcast Action: Request a refresh of the billing relationship plans
+ * between a carrier and a specific subscriber.
+ * <p>
+ * Carrier apps are encouraged to implement this receiver, and the OS will
+ * provide an affordance to request a refresh. This affordance will only be
+ * shown when the carrier app is actively providing subscription plan
+ * information via {@link #setSubscriptionPlans(int, List)}.
+ * <p>
+ * Contains {@link #EXTRA_SUBSCRIPTION_INDEX} to indicate which subscription
+ * the user is interested in.
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ @SystemApi
+ public static final String ACTION_REFRESH_SUBSCRIPTION_PLANS
+ = "android.telephony.action.REFRESH_SUBSCRIPTION_PLANS";
+
+ /**
+ * Broadcast Action: The billing relationship plans between a carrier and a
+ * specific subscriber has changed.
+ * <p>
+ * Contains {@link #EXTRA_SUBSCRIPTION_INDEX} to indicate which subscription
+ * changed.
+ *
+ * @hide
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS)
+ public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED
+ = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED";
+
+ /**
* Integer extra used with {@link #ACTION_DEFAULT_SUBSCRIPTION_CHANGED} and
* {@link #ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} to indicate the subscription
* which has changed.
@@ -444,6 +508,7 @@ public class SubscriptionManager {
public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
private final Context mContext;
+ private INetworkPolicyManager mNetworkPolicy;
/**
* A listener class for monitoring changes to {@link SubscriptionInfo} records.
@@ -522,16 +587,21 @@ public class SubscriptionManager {
}
/**
- * Get an instance of the SubscriptionManager from the Context.
- * This invokes {@link android.content.Context#getSystemService
- * Context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)}.
- *
- * @param context to use.
- * @return SubscriptionManager instance
+ * @deprecated developers should always obtain references directly from
+ * {@link Context#getSystemService(Class)}.
*/
+ @Deprecated
public static SubscriptionManager from(Context context) {
- return (SubscriptionManager) context.getSystemService(
- Context.TELEPHONY_SUBSCRIPTION_SERVICE);
+ return (SubscriptionManager) context
+ .getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
+ }
+
+ private final INetworkPolicyManager getNetworkPolicy() {
+ if (mNetworkPolicy == null) {
+ mNetworkPolicy = INetworkPolicyManager.Stub
+ .asInterface(ServiceManager.getService(Context.NETWORK_POLICY_SERVICE));
+ }
+ return mNetworkPolicy;
}
/**
@@ -1618,21 +1688,18 @@ public class SubscriptionManager {
* This method is only accessible to the following narrow set of apps:
* <ul>
* <li>The carrier app for this subscriberId, as determined by
- * {@link TelephonyManager#hasCarrierPrivileges(int)}.
+ * {@link TelephonyManager#hasCarrierPrivileges()}.
* <li>The carrier app explicitly delegated access through
* {@link CarrierConfigManager#KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING}.
* </ul>
*
* @param subId the subscriber this relationship applies to
- * @hide
*/
@SystemApi
public @NonNull List<SubscriptionPlan> getSubscriptionPlans(int subId) {
- final INetworkPolicyManager npm = INetworkPolicyManager.Stub
- .asInterface(ServiceManager.getService(Context.NETWORK_POLICY_SERVICE));
try {
SubscriptionPlan[] subscriptionPlans =
- npm.getSubscriptionPlans(subId, mContext.getOpPackageName());
+ getNetworkPolicy().getSubscriptionPlans(subId, mContext.getOpPackageName());
return subscriptionPlans == null
? Collections.emptyList() : Arrays.asList(subscriptionPlans);
} catch (RemoteException e) {
@@ -1647,7 +1714,7 @@ public class SubscriptionManager {
* This method is only accessible to the following narrow set of apps:
* <ul>
* <li>The carrier app for this subscriberId, as determined by
- * {@link TelephonyManager#hasCarrierPrivileges(int)}.
+ * {@link TelephonyManager#hasCarrierPrivileges()}.
* <li>The carrier app explicitly delegated access through
* {@link CarrierConfigManager#KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING}.
* </ul>
@@ -1656,21 +1723,177 @@ public class SubscriptionManager {
* @param plans the list of plans. The first plan is always the primary and
* most important plan. Any additional plans are secondary and
* may not be displayed or used by decision making logic.
- * @hide
*/
@SystemApi
public void setSubscriptionPlans(int subId, @NonNull List<SubscriptionPlan> plans) {
- final INetworkPolicyManager npm = INetworkPolicyManager.Stub
- .asInterface(ServiceManager.getService(Context.NETWORK_POLICY_SERVICE));
try {
- npm.setSubscriptionPlans(subId, plans.toArray(new SubscriptionPlan[plans.size()]),
- mContext.getOpPackageName());
+ getNetworkPolicy().setSubscriptionPlans(subId,
+ plans.toArray(new SubscriptionPlan[plans.size()]), mContext.getOpPackageName());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /** @hide */
+ private String getSubscriptionPlansOwner(int subId) {
+ try {
+ return getNetworkPolicy().getSubscriptionPlansOwner(subId);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
/**
+ * Temporarily override the billing relationship plan between a carrier and
+ * a specific subscriber to be considered unmetered. This will be reflected
+ * to apps via {@link NetworkCapabilities#NET_CAPABILITY_NOT_METERED}.
+ * <p>
+ * This method is only accessible to the following narrow set of apps:
+ * <ul>
+ * <li>The carrier app for this subscriberId, as determined by
+ * {@link TelephonyManager#hasCarrierPrivileges()}.
+ * <li>The carrier app explicitly delegated access through
+ * {@link CarrierConfigManager#KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING}.
+ * </ul>
+ *
+ * @param subId the subscriber this override applies to.
+ * @param overrideUnmetered set if the billing relationship should be
+ * considered unmetered.
+ * @param timeoutMillis the timeout after which the requested override will
+ * be automatically cleared, or {@code 0} to leave in the
+ * requested state until explicitly cleared, or the next reboot,
+ * whichever happens first.
+ */
+ @SystemApi
+ public void setSubscriptionOverrideUnmetered(int subId, boolean overrideUnmetered,
+ @DurationMillisLong long timeoutMillis) {
+ try {
+ final int overrideValue = overrideUnmetered ? OVERRIDE_UNMETERED : 0;
+ mNetworkPolicy.setSubscriptionOverride(subId, OVERRIDE_UNMETERED, overrideValue,
+ timeoutMillis, mContext.getOpPackageName());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Temporarily override the billing relationship plan between a carrier and
+ * a specific subscriber to be considered congested. This will cause the
+ * device to delay certain network requests when possible, such as developer
+ * jobs that are willing to run in a flexible time window.
+ * <p>
+ * This method is only accessible to the following narrow set of apps:
+ * <ul>
+ * <li>The carrier app for this subscriberId, as determined by
+ * {@link TelephonyManager#hasCarrierPrivileges()}.
+ * <li>The carrier app explicitly delegated access through
+ * {@link CarrierConfigManager#KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING}.
+ * </ul>
+ *
+ * @param subId the subscriber this override applies to.
+ * @param overrideCongested set if the subscription should be considered
+ * congested.
+ * @param timeoutMillis the timeout after which the requested override will
+ * be automatically cleared, or {@code 0} to leave in the
+ * requested state until explicitly cleared, or the next reboot,
+ * whichever happens first.
+ */
+ @SystemApi
+ public void setSubscriptionOverrideCongested(int subId, boolean overrideCongested,
+ @DurationMillisLong long timeoutMillis) {
+ try {
+ final int overrideValue = overrideCongested ? OVERRIDE_CONGESTED : 0;
+ mNetworkPolicy.setSubscriptionOverride(subId, OVERRIDE_CONGESTED, overrideValue,
+ timeoutMillis, mContext.getOpPackageName());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Create an {@link Intent} that can be launched towards the carrier app
+ * that is currently defining the billing relationship plan through
+ * {@link #setSubscriptionPlans(int, List)}.
+ *
+ * @return ready to launch Intent targeted towards the carrier app, or
+ * {@code null} if no carrier app is defined, or if the defined
+ * carrier app provides no management activity.
+ * @hide
+ */
+ public @Nullable Intent createManageSubscriptionIntent(int subId) {
+ // Bail if no owner
+ final String owner = getSubscriptionPlansOwner(subId);
+ if (owner == null) return null;
+
+ // Bail if no plans
+ final List<SubscriptionPlan> plans = getSubscriptionPlans(subId);
+ if (plans.isEmpty()) return null;
+
+ final Intent intent = new Intent(ACTION_MANAGE_SUBSCRIPTION_PLANS);
+ intent.setPackage(owner);
+ intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
+
+ // Bail if not implemented
+ if (mContext.getPackageManager().queryIntentActivities(intent,
+ PackageManager.MATCH_DEFAULT_ONLY).isEmpty()) {
+ return null;
+ }
+
+ return intent;
+ }
+
+ /** @hide */
+ private @Nullable Intent createRefreshSubscriptionIntent(int subId) {
+ // Bail if no owner
+ final String owner = getSubscriptionPlansOwner(subId);
+ if (owner == null) return null;
+
+ // Bail if no plans
+ final List<SubscriptionPlan> plans = getSubscriptionPlans(subId);
+ if (plans.isEmpty()) return null;
+
+ final Intent intent = new Intent(ACTION_REFRESH_SUBSCRIPTION_PLANS);
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+ intent.setPackage(owner);
+ intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
+
+ // Bail if not implemented
+ if (mContext.getPackageManager().queryBroadcastReceivers(intent, 0).isEmpty()) {
+ return null;
+ }
+
+ return intent;
+ }
+
+ /**
+ * Check if there is a carrier app that is currently defining the billing
+ * relationship plan through {@link #setSubscriptionPlans(int, List)} that
+ * supports refreshing of subscription plans.
+ *
+ * @hide
+ */
+ public boolean isSubscriptionPlansRefreshSupported(int subId) {
+ return createRefreshSubscriptionIntent(subId) != null;
+ }
+
+ /**
+ * Request that the carrier app that is currently defining the billing
+ * relationship plan through {@link #setSubscriptionPlans(int, List)}
+ * refresh its subscription plans.
+ * <p>
+ * If the app is able to successfully update the plans, you'll expect to
+ * receive the {@link #ACTION_SUBSCRIPTION_PLANS_CHANGED} broadcast.
+ *
+ * @hide
+ */
+ public void requestSubscriptionPlansRefresh(int subId) {
+ final Intent intent = createRefreshSubscriptionIntent(subId);
+ final BroadcastOptions options = BroadcastOptions.makeBasic();
+ options.setTemporaryAppWhitelistDuration(TimeUnit.MINUTES.toMillis(1));
+ mContext.sendBroadcast(intent, null, options.toBundle());
+ }
+
+ /**
* Checks whether the app with the given context is authorized to manage the given subscription
* according to its metadata. Only supported for embedded subscriptions (if
* {@code SubscriptionInfo#isEmbedded} returns true).
diff --git a/telephony/java/android/telephony/SubscriptionPlan.java b/telephony/java/android/telephony/SubscriptionPlan.java
index 265e3e7c8a01..941165212aa7 100644
--- a/telephony/java/android/telephony/SubscriptionPlan.java
+++ b/telephony/java/android/telephony/SubscriptionPlan.java
@@ -43,7 +43,6 @@ import java.util.Iterator;
*
* @see SubscriptionManager#setSubscriptionPlans(int, java.util.List)
* @see SubscriptionManager#getSubscriptionPlans(int)
- * @hide
*/
@SystemApi
public final class SubscriptionPlan implements Parcelable {
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index a9cb4a8d2756..7afd28ce181f 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -46,6 +46,7 @@ import android.provider.Settings.SettingNotFoundException;
import android.service.carrier.CarrierIdentifier;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
+import android.telecom.TelecomManager;
import android.telephony.VisualVoicemailService.VisualVoicemailTask;
import android.telephony.ims.aidl.IImsConfig;
import android.telephony.ims.aidl.IImsMmTelFeature;
@@ -1023,6 +1024,27 @@ public class TelephonyManager {
public static final int USSD_ERROR_SERVICE_UNAVAIL = -2;
/**
+ * Value for {@link CarrierConfigManager#KEY_CDMA_ROAMING_MODE_INT} which leaves the roaming
+ * mode set to the radio default or to the user's preference if they've indicated one.
+ */
+ public static final int CDMA_ROAMING_MODE_RADIO_DEFAULT = -1;
+ /**
+ * Value for {@link CarrierConfigManager#KEY_CDMA_ROAMING_MODE_INT} which only permits
+ * connections on home networks.
+ */
+ public static final int CDMA_ROAMING_MODE_HOME = 0;
+ /**
+ * Value for {@link CarrierConfigManager#KEY_CDMA_ROAMING_MODE_INT} which permits roaming on
+ * affiliated networks.
+ */
+ public static final int CDMA_ROAMING_MODE_AFFILIATED = 1;
+ /**
+ * Value for {@link CarrierConfigManager#KEY_CDMA_ROAMING_MODE_INT} which permits roaming on
+ * any network.
+ */
+ public static final int CDMA_ROAMING_MODE_ANY = 2;
+
+ /**
* An unknown carrier id. It could either be subscription unavailable or the subscription
* carrier cannot be recognized. Unrecognized carriers here means
* {@link #getSimOperator() MCC+MNC} cannot be identified.
@@ -1079,7 +1101,6 @@ public class TelephonyManager {
*/
public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.extra.SUBSCRIPTION_ID";
-
//
//
// Device Info
@@ -1801,11 +1822,10 @@ public class TelephonyManager {
public String getNetworkCountryIsoForPhone(int phoneId) {
try {
ITelephony telephony = getITelephony();
- if (telephony == null)
- return "";
+ if (telephony == null) return "";
return telephony.getNetworkCountryIsoForPhone(phoneId);
} catch (RemoteException ex) {
- return "";
+ return "";
}
}
@@ -2768,6 +2788,33 @@ public class TelephonyManager {
}
}
+ /**
+ * Resets the Carrier Keys in the database. This involves 2 steps:
+ * 1. Delete the keys from the database.
+ * 2. Send an intent to download new Certificates.
+ * <p>
+ * Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * @hide
+ */
+ public void resetCarrierKeysForImsiEncryption() {
+ try {
+ IPhoneSubInfo info = getSubscriberInfo();
+ if (info == null) {
+ throw new RuntimeException("IMSI error: Subscriber Info is null");
+ }
+ int subId = getSubId(SubscriptionManager.getDefaultDataSubscriptionId());
+ info.resetCarrierKeysForImsiEncryption(subId, mContext.getOpPackageName());
+ } catch (RemoteException ex) {
+ Rlog.e(TAG, "getCarrierInfoForImsiEncryption RemoteException" + ex);
+ throw new RuntimeException("IMSI error: Remote Exception");
+ } catch (NullPointerException ex) {
+ // This could happen before phone restarts due to crashing
+ Rlog.e(TAG, "getCarrierInfoForImsiEncryption NullPointerException" + ex);
+ throw new RuntimeException("IMSI error: Null Pointer exception");
+ }
+ }
+
/**
* @param keyAvailability bitmask that defines the availabilty of keys for a type.
* @param keyType the key type which is being checked. (WLAN, EPDG)
@@ -2803,7 +2850,7 @@ public class TelephonyManager {
* device keystore.
* <p>
* Requires Permission:
- * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
* @param imsiEncryptionInfo which includes the Key Type, the Public Key
* (java.security.PublicKey) and the Key Identifier.and the Key Identifier.
* The keyIdentifier Attribute value pair that helps a server locate
@@ -3420,6 +3467,7 @@ public class TelephonyManager {
* Initial SIM activation state, unknown. Not set by any carrier apps.
* @hide
*/
+ @SystemApi
public static final int SIM_ACTIVATION_STATE_UNKNOWN = 0;
/**
@@ -3430,12 +3478,14 @@ public class TelephonyManager {
* @see #SIM_ACTIVATION_STATE_RESTRICTED
* @hide
*/
+ @SystemApi
public static final int SIM_ACTIVATION_STATE_ACTIVATING = 1;
/**
* Indicate SIM has been successfully activated with full service
* @hide
*/
+ @SystemApi
public static final int SIM_ACTIVATION_STATE_ACTIVATED = 2;
/**
@@ -3445,6 +3495,7 @@ public class TelephonyManager {
* deactivated sim state and set it back to activated after successfully run activation service.
* @hide
*/
+ @SystemApi
public static final int SIM_ACTIVATION_STATE_DEACTIVATED = 3;
/**
@@ -3452,14 +3503,47 @@ public class TelephonyManager {
* note this is currently available for data activation state. For example out of byte sim.
* @hide
*/
+ @SystemApi
public static final int SIM_ACTIVATION_STATE_RESTRICTED = 4;
+ /** @hide */
+ @IntDef({
+ SIM_ACTIVATION_STATE_UNKNOWN,
+ SIM_ACTIVATION_STATE_ACTIVATING,
+ SIM_ACTIVATION_STATE_ACTIVATED,
+ SIM_ACTIVATION_STATE_DEACTIVATED,
+ SIM_ACTIVATION_STATE_RESTRICTED
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface SimActivationState{}
+
+ /**
+ * Sets the voice activation state
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * Or the calling app has carrier privileges.
+ *
+ * @param activationState The voice activation state
+ * @see #SIM_ACTIVATION_STATE_UNKNOWN
+ * @see #SIM_ACTIVATION_STATE_ACTIVATING
+ * @see #SIM_ACTIVATION_STATE_ACTIVATED
+ * @see #SIM_ACTIVATION_STATE_DEACTIVATED
+ * @see #hasCarrierPrivileges
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setVoiceActivationState(@SimActivationState int activationState) {
+ setVoiceActivationState(getSubId(), activationState);
+ }
+
/**
* Sets the voice activation state for the given subscriber.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
- * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
+ * Or the calling app has carrier privileges.
*
* @param subId The subscription id.
* @param activationState The voice activation state of the given subscriber.
@@ -3467,24 +3551,48 @@ public class TelephonyManager {
* @see #SIM_ACTIVATION_STATE_ACTIVATING
* @see #SIM_ACTIVATION_STATE_ACTIVATED
* @see #SIM_ACTIVATION_STATE_DEACTIVATED
+ * @see #hasCarrierPrivileges
* @hide
*/
- public void setVoiceActivationState(int subId, int activationState) {
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setVoiceActivationState(int subId, @SimActivationState int activationState) {
try {
- ITelephony telephony = getITelephony();
- if (telephony != null)
- telephony.setVoiceActivationState(subId, activationState);
- } catch (RemoteException ex) {
- } catch (NullPointerException ex) {
- }
+ ITelephony telephony = getITelephony();
+ if (telephony != null)
+ telephony.setVoiceActivationState(subId, activationState);
+ } catch (RemoteException ex) {
+ } catch (NullPointerException ex) {
+ }
+ }
+
+ /**
+ * Sets the data activation state
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * Or the calling app has carrier privileges.
+ *
+ * @param activationState The data activation state
+ * @see #SIM_ACTIVATION_STATE_UNKNOWN
+ * @see #SIM_ACTIVATION_STATE_ACTIVATING
+ * @see #SIM_ACTIVATION_STATE_ACTIVATED
+ * @see #SIM_ACTIVATION_STATE_DEACTIVATED
+ * @see #SIM_ACTIVATION_STATE_RESTRICTED
+ * @see #hasCarrierPrivileges
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setDataActivationState(@SimActivationState int activationState) {
+ setDataActivationState(getSubId(), activationState);
}
/**
* Sets the data activation state for the given subscriber.
*
* <p>Requires Permission:
- * {@link android.Manifest.permission#MODIFY_PHONE_STATE}
- * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * Or the calling app has carrier privileges.
*
* @param subId The subscription id.
* @param activationState The data activation state of the given subscriber.
@@ -3493,9 +3601,11 @@ public class TelephonyManager {
* @see #SIM_ACTIVATION_STATE_ACTIVATED
* @see #SIM_ACTIVATION_STATE_DEACTIVATED
* @see #SIM_ACTIVATION_STATE_RESTRICTED
+ * @see #hasCarrierPrivileges
* @hide
*/
- public void setDataActivationState(int subId, int activationState) {
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setDataActivationState(int subId, @SimActivationState int activationState) {
try {
ITelephony telephony = getITelephony();
if (telephony != null)
@@ -3506,8 +3616,33 @@ public class TelephonyManager {
}
/**
+ * Returns the voice activation state
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
+ * Or the calling app has carrier privileges.
+ *
+ * @return voiceActivationState
+ * @see #SIM_ACTIVATION_STATE_UNKNOWN
+ * @see #SIM_ACTIVATION_STATE_ACTIVATING
+ * @see #SIM_ACTIVATION_STATE_ACTIVATED
+ * @see #SIM_ACTIVATION_STATE_DEACTIVATED
+ * @see #hasCarrierPrivileges
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @SimActivationState int getVoiceActivationState() {
+ return getVoiceActivationState(getSubId());
+ }
+
+ /**
* Returns the voice activation state for the given subscriber.
*
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
+ * Or the calling app has carrier privileges.
+ *
* @param subId The subscription id.
*
* @return voiceActivationState for the given subscriber
@@ -3515,10 +3650,11 @@ public class TelephonyManager {
* @see #SIM_ACTIVATION_STATE_ACTIVATING
* @see #SIM_ACTIVATION_STATE_ACTIVATED
* @see #SIM_ACTIVATION_STATE_DEACTIVATED
+ * @see #hasCarrierPrivileges
* @hide
*/
- @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
- public int getVoiceActivationState(int subId) {
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @SimActivationState int getVoiceActivationState(int subId) {
try {
ITelephony telephony = getITelephony();
if (telephony != null)
@@ -3530,8 +3666,34 @@ public class TelephonyManager {
}
/**
+ * Returns the data activation state
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
+ * Or the calling app has carrier privileges.
+ *
+ * @return dataActivationState for the given subscriber
+ * @see #SIM_ACTIVATION_STATE_UNKNOWN
+ * @see #SIM_ACTIVATION_STATE_ACTIVATING
+ * @see #SIM_ACTIVATION_STATE_ACTIVATED
+ * @see #SIM_ACTIVATION_STATE_DEACTIVATED
+ * @see #SIM_ACTIVATION_STATE_RESTRICTED
+ * @see #hasCarrierPrivileges
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @SimActivationState int getDataActivationState() {
+ return getDataActivationState(getSubId());
+ }
+
+ /**
* Returns the data activation state for the given subscriber.
*
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
+ * Or the calling app has carrier privileges.
+ *
* @param subId The subscription id.
*
* @return dataActivationState for the given subscriber
@@ -3540,10 +3702,11 @@ public class TelephonyManager {
* @see #SIM_ACTIVATION_STATE_ACTIVATED
* @see #SIM_ACTIVATION_STATE_DEACTIVATED
* @see #SIM_ACTIVATION_STATE_RESTRICTED
+ * @see #hasCarrierPrivileges
* @hide
*/
- @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
- public int getDataActivationState(int subId) {
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @SimActivationState int getDataActivationState(int subId) {
try {
ITelephony telephony = getITelephony();
if (telephony != null)
@@ -6206,7 +6369,7 @@ public class TelephonyManager {
}
/**
- * @deprecated Use {link@ android.telecom.TelecomManager#isTtySupported} instead
+ * @deprecated Use {@link TelecomManager#isTtySupported()} instead
* Whether the phone supports TTY mode.
*
* @return {@code true} if the device supports TTY mode, and {@code false} otherwise.
@@ -6448,8 +6611,10 @@ public class TelephonyManager {
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
*
- * @hide
+ * {@hide}
**/
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setSimPowerState(int state) {
setSimPowerStateForSlot(getSlotIndex(), state);
}
@@ -6468,8 +6633,10 @@ public class TelephonyManager {
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
*
- * @hide
+ * {@hide}
**/
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setSimPowerStateForSlot(int slotIndex, int state) {
try {
ITelephony telephony = getITelephony();
@@ -6502,11 +6669,48 @@ public class TelephonyManager {
* @hide
*/
public void setBasebandVersionForPhone(int phoneId, String version) {
+ setTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_BASEBAND_VERSION, version);
+ }
+
+ /**
+ * Get baseband version for the default phone.
+ *
+ * @return baseband version.
+ * @hide
+ */
+ public String getBasebandVersion() {
+ int phoneId = getPhoneId();
+ return getBasebandVersionForPhone(phoneId);
+ }
+
+ /**
+ * Get baseband version for the default phone using the legacy approach.
+ * This change was added in P, to ensure backward compatiblity.
+ *
+ * @return baseband version.
+ * @hide
+ */
+ private String getBasebandVersionLegacy(int phoneId) {
if (SubscriptionManager.isValidPhoneId(phoneId)) {
String prop = TelephonyProperties.PROPERTY_BASEBAND_VERSION +
((phoneId == 0) ? "" : Integer.toString(phoneId));
- SystemProperties.set(prop, version);
+ return SystemProperties.get(prop);
+ }
+ return null;
+ }
+
+ /**
+ * Get baseband version by phone id.
+ *
+ * @return baseband version.
+ * @hide
+ */
+ public String getBasebandVersionForPhone(int phoneId) {
+ String version = getBasebandVersionLegacy(phoneId);
+ if (version != null && !version.isEmpty()) {
+ setBasebandVersionForPhone(phoneId, version);
}
+ return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_BASEBAND_VERSION, "");
}
/**
@@ -7074,6 +7278,7 @@ public class TelephonyManager {
* @return PRLVersion or null if error.
* @hide
*/
+ @SystemApi
public String getCdmaPrlVersion() {
return getCdmaPrlVersion(getSubId());
}
@@ -7299,6 +7504,8 @@ public class TelephonyManager {
* @return true if phone is in emergency callback mode
* @hide
*/
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public boolean getEmergencyCallbackMode() {
return getEmergencyCallbackMode(getSubId());
}
diff --git a/telephony/java/android/telephony/VisualVoicemailSmsFilterSettings.java b/telephony/java/android/telephony/VisualVoicemailSmsFilterSettings.java
index 8ed96a3a4f36..7eeb1ce7991c 100644
--- a/telephony/java/android/telephony/VisualVoicemailSmsFilterSettings.java
+++ b/telephony/java/android/telephony/VisualVoicemailSmsFilterSettings.java
@@ -15,12 +15,10 @@
*/
package android.telephony;
-import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
-
-import android.telecom.PhoneAccountHandle;
import android.telephony.VisualVoicemailService.VisualVoicemailTask;
+
import java.util.Collections;
import java.util.List;
@@ -75,6 +73,7 @@ public final class VisualVoicemailSmsFilterSettings implements Parcelable {
private String mClientPrefix = DEFAULT_CLIENT_PREFIX;
private List<String> mOriginatingNumbers = DEFAULT_ORIGINATING_NUMBERS;
private int mDestinationPort = DEFAULT_DESTINATION_PORT;
+ private String mPackageName;
public VisualVoicemailSmsFilterSettings build() {
return new VisualVoicemailSmsFilterSettings(this);
@@ -116,6 +115,15 @@ public final class VisualVoicemailSmsFilterSettings implements Parcelable {
return this;
}
+ /**
+ * The package that registered this filter.
+ *
+ * @hide
+ */
+ public Builder setPackageName(String packageName) {
+ mPackageName = packageName;
+ return this;
+ }
}
/**
@@ -138,12 +146,20 @@ public final class VisualVoicemailSmsFilterSettings implements Parcelable {
public final int destinationPort;
/**
+ * The package that registered this filter.
+ *
+ * @hide
+ */
+ public final String packageName;
+
+ /**
* Use {@link Builder} to construct
*/
private VisualVoicemailSmsFilterSettings(Builder builder) {
clientPrefix = builder.mClientPrefix;
originatingNumbers = builder.mOriginatingNumbers;
destinationPort = builder.mDestinationPort;
+ packageName = builder.mPackageName;
}
public static final Creator<VisualVoicemailSmsFilterSettings> CREATOR =
@@ -154,7 +170,7 @@ public final class VisualVoicemailSmsFilterSettings implements Parcelable {
builder.setClientPrefix(in.readString());
builder.setOriginatingNumbers(in.createStringArrayList());
builder.setDestinationPort(in.readInt());
-
+ builder.setPackageName(in.readString());
return builder.build();
}
@@ -174,10 +190,11 @@ public final class VisualVoicemailSmsFilterSettings implements Parcelable {
dest.writeString(clientPrefix);
dest.writeStringList(originatingNumbers);
dest.writeInt(destinationPort);
+ dest.writeString(packageName);
}
@Override
- public String toString(){
+ public String toString() {
return "[VisualVoicemailSmsFilterSettings "
+ "clientPrefix=" + clientPrefix
+ ", originatingNumbers=" + originatingNumbers
diff --git a/telephony/java/android/telephony/euicc/EuiccCardManager.java b/telephony/java/android/telephony/euicc/EuiccCardManager.java
index 6be77250996e..c3f40074308b 100644
--- a/telephony/java/android/telephony/euicc/EuiccCardManager.java
+++ b/telephony/java/android/telephony/euicc/EuiccCardManager.java
@@ -50,6 +50,7 @@ import com.android.internal.telephony.euicc.ISwitchToProfileCallback;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import android.annotation.CallbackExecutor;
import java.util.concurrent.Executor;
/**
@@ -151,7 +152,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and all the profiles.
*/
- public void requestAllProfiles(String cardId, Executor executor,
+ public void requestAllProfiles(String cardId, @CallbackExecutor Executor executor,
ResultCallback<EuiccProfileInfo[]> callback) {
try {
getIEuiccCardController().getAllProfiles(mContext.getOpPackageName(), cardId,
@@ -175,7 +176,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and profile.
*/
- public void requestProfile(String cardId, String iccid, Executor executor,
+ public void requestProfile(String cardId, String iccid, @CallbackExecutor Executor executor,
ResultCallback<EuiccProfileInfo> callback) {
try {
getIEuiccCardController().getProfile(mContext.getOpPackageName(), cardId, iccid,
@@ -200,8 +201,8 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void disableProfile(String cardId, String iccid, boolean refresh, Executor executor,
- ResultCallback<Void> callback) {
+ public void disableProfile(String cardId, String iccid, boolean refresh,
+ @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
try {
getIEuiccCardController().disableProfile(mContext.getOpPackageName(), cardId, iccid,
refresh, new IDisableProfileCallback.Stub() {
@@ -226,8 +227,8 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and the EuiccProfileInfo enabled.
*/
- public void switchToProfile(String cardId, String iccid, boolean refresh, Executor executor,
- ResultCallback<EuiccProfileInfo> callback) {
+ public void switchToProfile(String cardId, String iccid, boolean refresh,
+ @CallbackExecutor Executor executor, ResultCallback<EuiccProfileInfo> callback) {
try {
getIEuiccCardController().switchToProfile(mContext.getOpPackageName(), cardId, iccid,
refresh, new ISwitchToProfileCallback.Stub() {
@@ -251,8 +252,8 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void setNickname(String cardId, String iccid, String nickname, Executor executor,
- ResultCallback<Void> callback) {
+ public void setNickname(String cardId, String iccid, String nickname,
+ @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
try {
getIEuiccCardController().setNickname(mContext.getOpPackageName(), cardId, iccid,
nickname, new ISetNicknameCallback.Stub() {
@@ -275,7 +276,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void deleteProfile(String cardId, String iccid, Executor executor,
+ public void deleteProfile(String cardId, String iccid, @CallbackExecutor Executor executor,
ResultCallback<Void> callback) {
try {
getIEuiccCardController().deleteProfile(mContext.getOpPackageName(), cardId, iccid,
@@ -300,8 +301,8 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void resetMemory(String cardId, @ResetOption int options, Executor executor,
- ResultCallback<Void> callback) {
+ public void resetMemory(String cardId, @ResetOption int options,
+ @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
try {
getIEuiccCardController().resetMemory(mContext.getOpPackageName(), cardId, options,
new IResetMemoryCallback.Stub() {
@@ -323,7 +324,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and the default SM-DP+ address.
*/
- public void requestDefaultSmdpAddress(String cardId, Executor executor,
+ public void requestDefaultSmdpAddress(String cardId, @CallbackExecutor Executor executor,
ResultCallback<String> callback) {
try {
getIEuiccCardController().getDefaultSmdpAddress(mContext.getOpPackageName(), cardId,
@@ -346,7 +347,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and the SM-DS address.
*/
- public void requestSmdsAddress(String cardId, Executor executor,
+ public void requestSmdsAddress(String cardId, @CallbackExecutor Executor executor,
ResultCallback<String> callback) {
try {
getIEuiccCardController().getSmdsAddress(mContext.getOpPackageName(), cardId,
@@ -370,8 +371,8 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void setDefaultSmdpAddress(String cardId, String defaultSmdpAddress, Executor executor,
- ResultCallback<Void> callback) {
+ public void setDefaultSmdpAddress(String cardId, String defaultSmdpAddress,
+ @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
try {
getIEuiccCardController().setDefaultSmdpAddress(mContext.getOpPackageName(), cardId,
defaultSmdpAddress,
@@ -394,7 +395,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the rule authorisation table.
*/
- public void requestRulesAuthTable(String cardId, Executor executor,
+ public void requestRulesAuthTable(String cardId, @CallbackExecutor Executor executor,
ResultCallback<EuiccRulesAuthTable> callback) {
try {
getIEuiccCardController().getRulesAuthTable(mContext.getOpPackageName(), cardId,
@@ -417,7 +418,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the challenge.
*/
- public void requestEuiccChallenge(String cardId, Executor executor,
+ public void requestEuiccChallenge(String cardId, @CallbackExecutor Executor executor,
ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().getEuiccChallenge(mContext.getOpPackageName(), cardId,
@@ -440,7 +441,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the info1.
*/
- public void requestEuiccInfo1(String cardId, Executor executor,
+ public void requestEuiccInfo1(String cardId, @CallbackExecutor Executor executor,
ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().getEuiccInfo1(mContext.getOpPackageName(), cardId,
@@ -463,7 +464,7 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the info2.
*/
- public void requestEuiccInfo2(String cardId, Executor executor,
+ public void requestEuiccInfo2(String cardId, @CallbackExecutor Executor executor,
ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().getEuiccInfo2(mContext.getOpPackageName(), cardId,
@@ -499,7 +500,7 @@ public class EuiccCardManager {
*/
public void authenticateServer(String cardId, String matchingId, byte[] serverSigned1,
byte[] serverSignature1, byte[] euiccCiPkIdToBeUsed, byte[] serverCertificate,
- Executor executor, ResultCallback<byte[]> callback) {
+ @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().authenticateServer(
mContext.getOpPackageName(),
@@ -538,7 +539,7 @@ public class EuiccCardManager {
* {@code PrepareDownloadResponse} defined in GSMA RSP v2.0+
*/
public void prepareDownload(String cardId, @Nullable byte[] hashCc, byte[] smdpSigned2,
- byte[] smdpSignature2, byte[] smdpCertificate, Executor executor,
+ byte[] smdpSignature2, byte[] smdpCertificate, @CallbackExecutor Executor executor,
ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().prepareDownload(
@@ -570,7 +571,7 @@ public class EuiccCardManager {
* {@code LoadBoundProfilePackageResponse} defined in GSMA RSP v2.0+.
*/
public void loadBoundProfilePackage(String cardId, byte[] boundProfilePackage,
- Executor executor, ResultCallback<byte[]> callback) {
+ @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().loadBoundProfilePackage(
mContext.getOpPackageName(),
@@ -599,7 +600,7 @@ public class EuiccCardManager {
* {@code CancelSessionResponse} defined in GSMA RSP v2.0+.
*/
public void cancelSession(String cardId, byte[] transactionId, @CancelReason int reason,
- Executor executor, ResultCallback<byte[]> callback) {
+ @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().cancelSession(
mContext.getOpPackageName(),
@@ -627,7 +628,7 @@ public class EuiccCardManager {
* @param callback the callback to get the result code and the list of notifications.
*/
public void listNotifications(String cardId, @EuiccNotification.Event int events,
- Executor executor, ResultCallback<EuiccNotification[]> callback) {
+ @CallbackExecutor Executor executor, ResultCallback<EuiccNotification[]> callback) {
try {
getIEuiccCardController().listNotifications(mContext.getOpPackageName(), cardId, events,
new IListNotificationsCallback.Stub() {
@@ -651,7 +652,7 @@ public class EuiccCardManager {
* @param callback the callback to get the result code and the list of notifications.
*/
public void retrieveNotificationList(String cardId, @EuiccNotification.Event int events,
- Executor executor, ResultCallback<EuiccNotification[]> callback) {
+ @CallbackExecutor Executor executor, ResultCallback<EuiccNotification[]> callback) {
try {
getIEuiccCardController().retrieveNotificationList(mContext.getOpPackageName(), cardId,
events, new IRetrieveNotificationListCallback.Stub() {
@@ -674,8 +675,8 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the notification.
*/
- public void retrieveNotification(String cardId, int seqNumber, Executor executor,
- ResultCallback<EuiccNotification> callback) {
+ public void retrieveNotification(String cardId, int seqNumber,
+ @CallbackExecutor Executor executor, ResultCallback<EuiccNotification> callback) {
try {
getIEuiccCardController().retrieveNotification(mContext.getOpPackageName(), cardId,
seqNumber, new IRetrieveNotificationCallback.Stub() {
@@ -698,8 +699,8 @@ public class EuiccCardManager {
* @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code.
*/
- public void removeNotificationFromList(String cardId, int seqNumber, Executor executor,
- ResultCallback<Void> callback) {
+ public void removeNotificationFromList(String cardId, int seqNumber,
+ @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
try {
getIEuiccCardController().removeNotificationFromList(
mContext.getOpPackageName(),
diff --git a/telephony/java/android/telephony/euicc/EuiccManager.java b/telephony/java/android/telephony/euicc/EuiccManager.java
index 71ef5de92e7b..1637c55c0adf 100644
--- a/telephony/java/android/telephony/euicc/EuiccManager.java
+++ b/telephony/java/android/telephony/euicc/EuiccManager.java
@@ -92,7 +92,7 @@ public class EuiccManager {
* embedded SIM.
*
* <p>The activity will immediately finish with {@link android.app.Activity#RESULT_CANCELED} if
- * {@link #isEnabled} is false or if the device is already provisioned.
+ * {@link #isEnabled} is false.
*
* @hide
*/
diff --git a/telephony/java/android/telephony/ims/ImsCallSession.java b/telephony/java/android/telephony/ims/ImsCallSession.java
index da322114d993..a20d4f5ad27b 100644
--- a/telephony/java/android/telephony/ims/ImsCallSession.java
+++ b/telephony/java/android/telephony/ims/ImsCallSession.java
@@ -16,6 +16,7 @@
package android.telephony.ims;
+import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Message;
diff --git a/telephony/java/android/telephony/ims/stub/ImsConfigImplBase.java b/telephony/java/android/telephony/ims/stub/ImsConfigImplBase.java
index c6e5ddb52489..dcd7ea714f8c 100644
--- a/telephony/java/android/telephony/ims/stub/ImsConfigImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/ImsConfigImplBase.java
@@ -18,6 +18,7 @@ package android.telephony.ims.stub;
import android.annotation.SystemApi;
import android.content.Context;
+import android.content.Intent;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.telephony.ims.aidl.IImsConfig;
@@ -197,7 +198,7 @@ public class ImsConfigImplBase {
}
protected synchronized void updateCachedValue(int item, int value, boolean notifyChange)
- throws RemoteException {
+ throws RemoteException {
mProvisionedIntValue.put(item, value);
if (notifyChange) {
notifyImsConfigChanged(item, value);
@@ -358,7 +359,7 @@ public class ImsConfigImplBase {
*/
public final void notifyProvisionedValueChanged(int item, String value) {
try {
- mImsConfigStub.updateCachedValue(item, value, true);
+ mImsConfigStub.updateCachedValue(item, value, true);
} catch (RemoteException e) {
Log.w(TAG, "notifyProvisionedValueChanged(string): Framework connection is dead.");
}
@@ -412,4 +413,4 @@ public class ImsConfigImplBase {
// Base Implementation - To be overridden.
return null;
}
-} \ No newline at end of file
+}
diff --git a/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java b/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java
index bf8953386e49..0673a3845383 100644
--- a/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java
@@ -184,8 +184,6 @@ public class ImsSmsImplBase {
* platform will deliver the message to the messages database and notify the IMS provider of the
* result by calling {@link #acknowledgeSms(int, int, int)}.
*
- * This method must not be called before {@link #onReady()} is called.
- *
* @param token unique token generated by IMS providers that the platform will use to trigger
* callbacks for this message.
* @param format the format of the message. Valid values are {@link SmsMessage#FORMAT_3GPP} and
@@ -211,8 +209,6 @@ public class ImsSmsImplBase {
* This method should be triggered by the IMS providers to pass the result of the sent message
* to the platform.
*
- * This method must not be called before {@link #onReady()} is called.
- *
* @param token token provided in {@link #sendSms(int, int, String, String, boolean, byte[])}
* @param messageRef the message reference. Should be between 0 and 255 per TS.123.040
* @param status result of sending the SMS. Valid values are: