summaryrefslogtreecommitdiff
path: root/telephony/java
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/AccessNetworkUtils.java129
-rw-r--r--telephony/java/android/telephony/CarrierConfigManager.java13
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java78
-rw-r--r--telephony/java/android/telephony/data/ApnThrottleStatus.aidl20
-rw-r--r--telephony/java/android/telephony/data/ApnThrottleStatus.java383
-rw-r--r--telephony/java/android/telephony/data/DataCallResponse.java33
-rw-r--r--telephony/java/android/telephony/data/DataService.java83
-rw-r--r--telephony/java/android/telephony/data/DataServiceCallback.java20
-rw-r--r--telephony/java/android/telephony/data/IDataService.aidl2
-rw-r--r--telephony/java/android/telephony/data/IDataServiceCallback.aidl1
-rw-r--r--telephony/java/android/telephony/data/IQualifiedNetworksService.aidl2
-rw-r--r--telephony/java/android/telephony/data/QualifiedNetworksService.java26
-rw-r--r--telephony/java/android/telephony/ims/ImsCallProfile.java76
-rwxr-xr-xtelephony/java/android/telephony/ims/ImsCallSession.java39
-rw-r--r--telephony/java/android/telephony/ims/ImsCallSessionListener.java49
-rw-r--r--telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl2
-rw-r--r--telephony/java/android/telephony/ims/feature/MmTelFeature.java15
-rw-r--r--telephony/java/com/android/internal/telephony/DctConstants.java1
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl6
19 files changed, 939 insertions, 39 deletions
diff --git a/telephony/java/android/telephony/AccessNetworkUtils.java b/telephony/java/android/telephony/AccessNetworkUtils.java
index 981ed450004a..7661a32f6d5b 100644
--- a/telephony/java/android/telephony/AccessNetworkUtils.java
+++ b/telephony/java/android/telephony/AccessNetworkUtils.java
@@ -5,8 +5,11 @@ import static android.telephony.ServiceState.DUPLEX_MODE_TDD;
import static android.telephony.ServiceState.DUPLEX_MODE_UNKNOWN;
import android.telephony.AccessNetworkConstants.EutranBand;
+import android.telephony.AccessNetworkConstants.GeranBand;
+import android.telephony.AccessNetworkConstants.UtranBand;
import android.telephony.ServiceState.DuplexMode;
+import java.util.Arrays;
/**
* Utilities to map between radio constants.
@@ -20,6 +23,9 @@ public class AccessNetworkUtils {
public static final int INVALID_BAND = -1;
+ /** ISO country code of Japan. */
+ private static final String JAPAN_ISO_COUNTRY_CODE = "jp";
+
/**
* Gets the duplex mode for the given EUTRAN operating band.
*
@@ -50,7 +56,7 @@ public class AccessNetworkUtils {
/**
* Gets the EUTRAN Operating band for a given downlink EARFCN.
*
- * <p>See 3GPP 36.101 sec 5.7.3-1 for calculation.
+ * <p>See 3GPP TS 36.101 clause 5.7.3-1 for calculation.
*
* @param earfcn The downlink EARFCN
* @return Operating band number, or {@link #INVALID_BAND} if no corresponding band exists
@@ -198,4 +204,125 @@ public class AccessNetworkUtils {
return INVALID_BAND;
}
+
+ /**
+ * Gets the GERAN Operating band for a given ARFCN.
+ *
+ * <p>See 3GPP TS 45.005 clause 2 for calculation.
+ *
+ * @param arfcn The ARFCN
+ * @return Operating band number, or {@link #INVALID_BAND} if no corresponding band exists
+ */
+ public static int getOperatingBandForArfcn(int arfcn) {
+ if (arfcn >= 0 && arfcn <= 124) {
+ return GeranBand.BAND_E900;
+ } else if (arfcn >= 128 && arfcn <= 251) {
+ return GeranBand.BAND_850;
+ } else if (arfcn >= 259 && arfcn <= 293) {
+ return GeranBand.BAND_450;
+ } else if (arfcn >= 306 && arfcn <= 340) {
+ return GeranBand.BAND_480;
+ } else if (arfcn >= 438 && arfcn <= 511) {
+ return GeranBand.BAND_750;
+ } else if (arfcn >= 512 && arfcn <= 885) {
+ // ARFCN between 512 and 810 are also part of BAND_PCS1900.
+ // Returning BAND_DCS1800 in both cases.
+ return GeranBand.BAND_DCS1800;
+ } else if (arfcn >= 940 && arfcn <= 974) {
+ return GeranBand.BAND_ER900;
+ } else if (arfcn >= 975 && arfcn <= 1023) {
+ return GeranBand.BAND_E900;
+ }
+ return INVALID_BAND;
+ }
+
+ /**
+ * Gets the UTRAN Operating band for a given downlink UARFCN.
+ *
+ * <p>See 3GPP TS 25.101 clause 5.4.4 for calculation.
+ *
+ * @param uarfcn The downlink UARFCN
+ * @return Operating band number, or {@link #INVALID_BAND} if no corresponding band exists
+ */
+ public static int getOperatingBandForUarfcn(int uarfcn) {
+ // List of additional bands defined in TS 25.101.
+ int[] addlBand2 = {412, 437, 462, 487, 512, 537, 562, 587, 612, 637, 662, 687};
+ int[] addlBand4 = {1887, 1912, 1937, 1962, 1987, 2012, 2037, 2062, 2087};
+ int[] addlBand5 = {1007, 1012, 1032, 1037, 1062, 1087};
+ int[] addlBand6 = {1037, 1062};
+ int[] addlBand7 =
+ {2587, 2612, 2637, 2662, 2687, 2712, 2737, 2762, 2787, 2812, 2837, 2862,
+ 2887, 2912};
+ int[] addlBand10 =
+ {3412, 3437, 3462, 3487, 3512, 3537, 3562, 3587, 3612, 3637, 3662, 3687};
+ int[] addlBand12 = {3932, 3957, 3962, 3987, 3992};
+ int[] addlBand13 = {4067, 4092};
+ int[] addlBand14 = {4167, 4192};
+ int[] addlBand19 = {787, 812, 837};
+ int[] addlBand25 =
+ {6292, 6317, 6342, 6367, 6392, 6417, 6442, 6467, 6492, 6517, 6542, 6567, 6592};
+ int[] addlBand26 = {5937, 5962, 5987, 5992, 6012, 6017, 6037, 6042, 6062, 6067, 6087};
+
+ if (uarfcn >= 10562 && uarfcn <= 10838) {
+ return UtranBand.BAND_1;
+ } else if ((uarfcn >= 9662 && uarfcn <= 9938)
+ || Arrays.binarySearch(addlBand2, uarfcn) >= 0) {
+ return UtranBand.BAND_2;
+ } else if (uarfcn >= 1162 && uarfcn <= 1513) {
+ return UtranBand.BAND_3;
+ } else if ((uarfcn >= 1537 && uarfcn <= 1738)
+ || Arrays.binarySearch(addlBand4, uarfcn) >= 0) {
+ return UtranBand.BAND_4;
+ } else if (uarfcn >= 4387 && uarfcn <= 4413) {
+ // Band 6 is a subset of band 5. Only Japan uses band 6 and Japan does not have band 5.
+ String country = TelephonyManager.getDefault().getNetworkCountryIso();
+ if (JAPAN_ISO_COUNTRY_CODE.compareToIgnoreCase(country) == 0) {
+ return UtranBand.BAND_6;
+ } else {
+ return UtranBand.BAND_5;
+ }
+ } else if ((uarfcn >= 4357 && uarfcn <= 4458)
+ || Arrays.binarySearch(addlBand5, uarfcn) >= 0) {
+ return UtranBand.BAND_5;
+ } else if (Arrays.binarySearch(addlBand6, uarfcn) >= 0) {
+ return UtranBand.BAND_6;
+ } else if ((uarfcn >= 2237 && uarfcn <= 2563)
+ || Arrays.binarySearch(addlBand7, uarfcn) >= 0) {
+ return UtranBand.BAND_7;
+ } else if (uarfcn >= 2937 && uarfcn <= 3088) {
+ return UtranBand.BAND_8;
+ } else if (uarfcn >= 9237 && uarfcn <= 9387) {
+ return UtranBand.BAND_9;
+ } else if ((uarfcn >= 3112 && uarfcn <= 3388)
+ || Arrays.binarySearch(addlBand10, uarfcn) >= 0) {
+ return UtranBand.BAND_10;
+ } else if (uarfcn >= 3712 && uarfcn <= 3787) {
+ return UtranBand.BAND_11;
+ } else if ((uarfcn >= 3842 && uarfcn <= 3903)
+ || Arrays.binarySearch(addlBand12, uarfcn) >= 0) {
+ return UtranBand.BAND_12;
+ } else if ((uarfcn >= 4017 && uarfcn <= 4043)
+ || Arrays.binarySearch(addlBand13, uarfcn) >= 0) {
+ return UtranBand.BAND_13;
+ } else if ((uarfcn >= 4117 && uarfcn <= 4143)
+ || Arrays.binarySearch(addlBand14, uarfcn) >= 0) {
+ return UtranBand.BAND_14;
+ } else if ((uarfcn >= 712 && uarfcn <= 763)
+ || Arrays.binarySearch(addlBand19, uarfcn) >= 0) {
+ return UtranBand.BAND_19;
+ } else if (uarfcn >= 4512 && uarfcn <= 4638) {
+ return UtranBand.BAND_20;
+ } else if (uarfcn >= 862 && uarfcn <= 912) {
+ return UtranBand.BAND_21;
+ } else if (uarfcn >= 4662 && uarfcn <= 5038) {
+ return UtranBand.BAND_22;
+ } else if ((uarfcn >= 5112 && uarfcn <= 5413)
+ || Arrays.binarySearch(addlBand25, uarfcn) >= 0) {
+ return UtranBand.BAND_25;
+ } else if ((uarfcn >= 5762 && uarfcn <= 5913)
+ || Arrays.binarySearch(addlBand26, uarfcn) >= 0) {
+ return UtranBand.BAND_26;
+ }
+ return INVALID_BAND;
+ }
}
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 4e9e6a8440a9..74b2aad5293e 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -4056,6 +4056,17 @@ public class CarrierConfigManager {
"default_preferred_apn_name_string";
/**
+ * Indicates if the carrier supports call composer.
+ */
+ public static final String KEY_SUPPORTS_CALL_COMPOSER_BOOL = "supports_call_composer_bool";
+
+ /**
+ * Indicates the carrier server url that serves the call composer picture.
+ */
+ public static final String KEY_CALL_COMPOSER_PICTURE_SERVER_URL_STRING =
+ "call_composer_picture_server_url_string";
+
+ /**
* For Android 11, provide a temporary solution for OEMs to use the lower of the two MTU values
* for IPv4 and IPv6 if both are sent.
* TODO: remove in later release
@@ -4613,6 +4624,8 @@ public class CarrierConfigManager {
sDefaults.putStringArray(KEY_MISSED_INCOMING_CALL_SMS_PATTERN_STRING_ARRAY, new String[0]);
sDefaults.putBoolean(KEY_DISABLE_DUN_APN_WHILE_ROAMING_WITH_PRESET_APN_BOOL, false);
sDefaults.putString(KEY_DEFAULT_PREFERRED_APN_NAME_STRING, "");
+ sDefaults.putBoolean(KEY_SUPPORTS_CALL_COMPOSER_BOOL, false);
+ sDefaults.putString(KEY_CALL_COMPOSER_PICTURE_SERVER_URL_STRING, "");
sDefaults.putBoolean(KEY_USE_LOWER_MTU_VALUE_IF_BOTH_RECEIVED, false);
sDefaults.putBoolean(KEY_USE_ACS_FOR_RCS_BOOL, false);
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index f8ec054784e2..c05e90b28fa8 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -9346,6 +9346,35 @@ public class TelephonyManager {
}
/**
+ * Get the mobile provisioning url that is used to launch a browser to allow users to manage
+ * their mobile plan.
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE}.
+ *
+ * TODO: The legacy design only supports single sim design. Ideally, this should support
+ * multi-sim design in current world.
+ *
+ * {@hide}
+ */
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @Nullable String getMobileProvisioningUrl() {
+ try {
+ final ITelephony service = getITelephony();
+ if (service != null) {
+ return service.getMobileProvisioningUrl();
+ } else {
+ throw new IllegalStateException("telephony service is null.");
+ }
+ } catch (RemoteException ex) {
+ if (!isSystemProcess()) {
+ ex.rethrowAsRuntimeException();
+ }
+ }
+ return null;
+ }
+
+ /**
* Turns mobile data on or off.
* If this object has been created with {@link #createForSubscriptionId}, applies to the given
* subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()}
@@ -12371,23 +12400,15 @@ public class TelephonyManager {
@NonNull
public Map<Integer, List<EmergencyNumber>> getEmergencyNumberList(
@EmergencyServiceCategories int categories) {
- Map<Integer, List<EmergencyNumber>> emergencyNumberList = new HashMap<>();
+ Map<Integer, List<EmergencyNumber>> emergencyNumberListForCategories = new HashMap<>();
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
- emergencyNumberList = telephony.getEmergencyNumberList(
- mContext.getOpPackageName(), mContext.getAttributionTag());
- if (emergencyNumberList != null) {
- for (Integer subscriptionId : emergencyNumberList.keySet()) {
- List<EmergencyNumber> numberList = emergencyNumberList.get(subscriptionId);
- for (EmergencyNumber number : numberList) {
- if (!number.isInEmergencyServiceCategories(categories)) {
- numberList.remove(number);
- }
- }
- }
- }
- return emergencyNumberList;
+ Map<Integer, List<EmergencyNumber>> emergencyNumberList =
+ telephony.getEmergencyNumberList(mContext.getOpPackageName(),
+ mContext.getAttributionTag());
+ emergencyNumberListForCategories =
+ filterEmergencyNumbersByCategories(emergencyNumberList, categories);
} else {
throw new IllegalStateException("telephony service is null.");
}
@@ -12395,7 +12416,34 @@ public class TelephonyManager {
Log.e(TAG, "getEmergencyNumberList with Categories RemoteException", ex);
ex.rethrowAsRuntimeException();
}
- return emergencyNumberList;
+ return emergencyNumberListForCategories;
+ }
+
+ /**
+ * Filter emergency numbers with categories.
+ *
+ * @hide
+ */
+ @VisibleForTesting
+ public Map<Integer, List<EmergencyNumber>> filterEmergencyNumbersByCategories(
+ Map<Integer, List<EmergencyNumber>> emergencyNumberList,
+ @EmergencyServiceCategories int categories) {
+ Map<Integer, List<EmergencyNumber>> emergencyNumberListForCategories = new HashMap<>();
+ if (emergencyNumberList != null) {
+ for (Integer subscriptionId : emergencyNumberList.keySet()) {
+ List<EmergencyNumber> allNumbersForSub = emergencyNumberList.get(
+ subscriptionId);
+ List<EmergencyNumber> numbersForCategoriesPerSub = new ArrayList<>();
+ for (EmergencyNumber number : allNumbersForSub) {
+ if (number.isInEmergencyServiceCategories(categories)) {
+ numbersForCategoriesPerSub.add(number);
+ }
+ }
+ emergencyNumberListForCategories.put(
+ subscriptionId, numbersForCategoriesPerSub);
+ }
+ }
+ return emergencyNumberListForCategories;
}
/**
diff --git a/telephony/java/android/telephony/data/ApnThrottleStatus.aidl b/telephony/java/android/telephony/data/ApnThrottleStatus.aidl
new file mode 100644
index 000000000000..46bc4abde159
--- /dev/null
+++ b/telephony/java/android/telephony/data/ApnThrottleStatus.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** @hide */
+package android.telephony.data;
+
+parcelable ApnThrottleStatus;
diff --git a/telephony/java/android/telephony/data/ApnThrottleStatus.java b/telephony/java/android/telephony/data/ApnThrottleStatus.java
new file mode 100644
index 000000000000..51461d17690a
--- /dev/null
+++ b/telephony/java/android/telephony/data/ApnThrottleStatus.java
@@ -0,0 +1,383 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.telephony.data;
+
+import android.annotation.ElapsedRealtimeLong;
+import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.SuppressLint;
+import android.annotation.SystemApi;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.os.SystemClock;
+import android.telephony.AccessNetworkConstants;
+import android.telephony.Annotation;
+
+import java.util.Objects;
+
+/**
+ * Status information regarding the throttle status of an APN type.
+ *
+ * @hide
+ */
+@SystemApi
+public final class ApnThrottleStatus implements Parcelable {
+ /**
+ * The APN type is not throttled.
+ */
+ public static final int THROTTLE_TYPE_NONE = 1;
+
+ /**
+ * The APN type is throttled until {@link android.os.SystemClock#elapsedRealtime()}
+ * has reached {@link ApnThrottleStatus#getThrottleExpiryTimeMillis}
+ */
+ public static final int THROTTLE_TYPE_ELAPSED_TIME = 2;
+
+ /** {@hide} */
+ @IntDef(flag = true, prefix = {"THROTTLE_TYPE_"}, value = {
+ ApnThrottleStatus.THROTTLE_TYPE_NONE,
+ ApnThrottleStatus.THROTTLE_TYPE_ELAPSED_TIME,
+ })
+ public @interface ThrottleType {
+ }
+
+ /**
+ * The framework will not retry the APN type.
+ */
+ public static final int RETRY_TYPE_NONE = 1;
+
+ /**
+ * The next time the framework retries, it will attempt to establish a new connection.
+ */
+ public static final int RETRY_TYPE_NEW_CONNECTION = 2;
+
+ /**
+ * The next time the framework retires, it will retry to handover.
+ */
+ public static final int RETRY_TYPE_HANDOVER = 3;
+
+ /** {@hide} */
+ @IntDef(flag = true, prefix = {"RETRY_TYPE_"}, value = {
+ ApnThrottleStatus.RETRY_TYPE_NONE,
+ ApnThrottleStatus.RETRY_TYPE_NEW_CONNECTION,
+ ApnThrottleStatus.RETRY_TYPE_HANDOVER,
+ })
+ public @interface RetryType {
+ }
+
+ private final int mSlotIndex;
+ private final @AccessNetworkConstants.TransportType int mTransportType;
+ private final @Annotation.ApnType int mApnType;
+ private final long mThrottleExpiryTimeMillis;
+ private final @RetryType int mRetryType;
+ private final @ThrottleType int mThrottleType;
+
+ /**
+ * The slot index that the status applies to.
+ *
+ * @return the slot index
+ */
+ public int getSlotIndex() {
+ return mSlotIndex;
+ }
+
+ /**
+ * The type of transport that the status applies to.
+ *
+ * @return the transport type
+ */
+ @AccessNetworkConstants.TransportType
+ public int getTransportType() {
+ return mTransportType;
+ }
+
+ /**
+ * The APN type that the status applies to.
+ *
+ * @return the apn type
+ */
+ @Annotation.ApnType
+ public int getApnType() {
+ return mApnType;
+ }
+
+ /**
+ * The type of throttle applied to the APN type.
+ *
+ * @return the throttle type
+ */
+ @ThrottleType
+ public int getThrottleType() {
+ return mThrottleType;
+ }
+
+ /**
+ * Indicates the type of request that the framework will make the next time it retries
+ * to call {@link IDataService#setupDataCall}.
+ *
+ * @return the retry type
+ */
+ @RetryType
+ public int getRetryType() {
+ return mRetryType;
+ }
+
+ /**
+ * Gets the time at which the throttle expires. The value is based off of
+ * {@link SystemClock#elapsedRealtime}.
+ *
+ * This value only applies when the throttle type is set to
+ * {@link ApnThrottleStatus#THROTTLE_TYPE_ELAPSED_TIME}.
+ *
+ * A value of {@link Long#MAX_VALUE} implies that the APN type is throttled indefinitely.
+ *
+ * @return the time at which the throttle expires
+ */
+ @ElapsedRealtimeLong
+ public long getThrottleExpiryTimeMillis() {
+ return mThrottleExpiryTimeMillis;
+ }
+
+ private ApnThrottleStatus(int slotIndex,
+ @AccessNetworkConstants.TransportType int transportType,
+ @Annotation.ApnType int apnTypes,
+ @ThrottleType int throttleType,
+ long throttleExpiryTimeMillis,
+ @RetryType int retryType) {
+ mSlotIndex = slotIndex;
+ mTransportType = transportType;
+ mApnType = apnTypes;
+ mThrottleType = throttleType;
+ mThrottleExpiryTimeMillis = throttleExpiryTimeMillis;
+ mRetryType = retryType;
+ }
+
+ private ApnThrottleStatus(@NonNull Parcel source) {
+ mSlotIndex = source.readInt();
+ mTransportType = source.readInt();
+ mApnType = source.readInt();
+ mThrottleExpiryTimeMillis = source.readLong();
+ mRetryType = source.readInt();
+ mThrottleType = source.readInt();
+ }
+
+ @Override
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
+ dest.writeInt(mSlotIndex);
+ dest.writeInt(mTransportType);
+ dest.writeInt(mApnType);
+ dest.writeLong(mThrottleExpiryTimeMillis);
+ dest.writeInt(mRetryType);
+ dest.writeInt(mThrottleType);
+ }
+
+ public static final @NonNull Parcelable.Creator<ApnThrottleStatus> CREATOR =
+ new Parcelable.Creator<ApnThrottleStatus>() {
+ @Override
+ public ApnThrottleStatus createFromParcel(@NonNull Parcel source) {
+ return new ApnThrottleStatus(source);
+ }
+
+ @Override
+ public ApnThrottleStatus[] newArray(int size) {
+ return new ApnThrottleStatus[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mSlotIndex, mApnType, mRetryType, mThrottleType,
+ mThrottleExpiryTimeMillis, mTransportType);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ } else if (obj instanceof ApnThrottleStatus) {
+ ApnThrottleStatus other = (ApnThrottleStatus) obj;
+ return this.mSlotIndex == other.mSlotIndex
+ && this.mApnType == other.mApnType
+ && this.mRetryType == other.mRetryType
+ && this.mThrottleType == other.mThrottleType
+ && this.mThrottleExpiryTimeMillis == other.mThrottleExpiryTimeMillis
+ && this.mTransportType == other.mTransportType;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "ApnThrottleStatus{"
+ + "mSlotIndex=" + mSlotIndex
+ + ", mTransportType=" + mTransportType
+ + ", mApnType=" + ApnSetting.getApnTypeString(mApnType)
+ + ", mThrottleExpiryTimeMillis=" + mThrottleExpiryTimeMillis
+ + ", mRetryType=" + mRetryType
+ + ", mThrottleType=" + mThrottleType
+ + '}';
+ }
+
+ /**
+ * Provides a convenient way to set the fields of an {@link ApnThrottleStatus} when creating a
+ * new instance.
+ *
+ * <p>The example below shows how you might create a new {@code ApnThrottleStatus}:
+ *
+ * <pre><code>
+ *
+ * DataCallResponseApnThrottleStatus = new ApnThrottleStatus.Builder()
+ * .setSlotIndex(1)
+ * .setApnType({@link ApnSetting#TYPE_EMERGENCY})
+ * .setNoThrottle()
+ * .setRetryType({@link ApnThrottleStatus#RETRY_TYPE_NEW_CONNECTION})
+ * .build();
+ * </code></pre>
+ */
+ public static final class Builder {
+ private int mSlotIndex;
+ private @AccessNetworkConstants.TransportType int mTransportType;
+ private @Annotation.ApnType int mApnType;
+ private long mThrottleExpiryTimeMillis;
+ private @RetryType int mRetryType;
+ private @ThrottleType int mThrottleType;
+ public static final long NO_THROTTLE_EXPIRY_TIME =
+ DataCallResponse.RETRY_DURATION_UNDEFINED;
+
+ /**
+ * Default constructor for the Builder.
+ */
+ public Builder() {
+ }
+
+ /**
+ * Set the slot index.
+ *
+ * @param slotIndex the slot index.
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setSlotIndex(int slotIndex) {
+ this.mSlotIndex = slotIndex;
+ return this;
+ }
+
+ /**
+ * Set the transport type.
+ *
+ * @param transportType the transport type.
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setTransportType(@AccessNetworkConstants.TransportType
+ int transportType) {
+ this.mTransportType = transportType;
+ return this;
+ }
+
+ /**
+ * Set the APN type.
+ *
+ * @param apnType the APN type.
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setApnType(@Annotation.ApnType int apnType) {
+ this.mApnType = apnType;
+ return this;
+ }
+
+ /**
+ * Sets the time at which the throttle will expire. The value is based off of
+ * {@link SystemClock#elapsedRealtime}.
+ *
+ * When setting this value, the throttle type is set to
+ * {@link ApnThrottleStatus#THROTTLE_TYPE_ELAPSED_TIME}.
+ *
+ * A value of {@link Long#MAX_VALUE} implies that the APN type is throttled indefinitely.
+ *
+ * @param throttleExpiryTimeMillis The elapsed time at which the throttle expires.
+ * Throws {@link IllegalArgumentException} for values less
+ * than 0.
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setThrottleExpiryTimeMillis(
+ @ElapsedRealtimeLong long throttleExpiryTimeMillis) {
+ if (throttleExpiryTimeMillis >= 0) {
+ this.mThrottleExpiryTimeMillis = throttleExpiryTimeMillis;
+ this.mThrottleType = THROTTLE_TYPE_ELAPSED_TIME;
+ } else {
+ throw new IllegalArgumentException("throttleExpiryTimeMillis must be greater than "
+ + "or equal to 0");
+ }
+ return this;
+ }
+
+ /**
+ * Sets the status of the APN type as not being throttled.
+ *
+ * When setting this value, the throttle type is set to
+ * {@link ApnThrottleStatus#THROTTLE_TYPE_NONE} and the expiry time is set to
+ * {@link Builder#NO_THROTTLE_EXPIRY_TIME}.
+ *
+ * @return The same instance of the builder.
+ */
+ @SuppressLint("MissingGetterMatchingBuilder")
+ @NonNull
+ public Builder setNoThrottle() {
+ mThrottleType = THROTTLE_TYPE_NONE;
+ mThrottleExpiryTimeMillis = NO_THROTTLE_EXPIRY_TIME;
+ return this;
+ }
+
+ /**
+ * Set the type of request that the framework will make the next time it retries
+ * to call {@link IDataService#setupDataCall}.
+ *
+ * @param retryType the type of request
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setRetryType(@RetryType int retryType) {
+ this.mRetryType = retryType;
+ return this;
+ }
+
+ /**
+ * Build the {@link ApnThrottleStatus}
+ *
+ * @return the {@link ApnThrottleStatus} object
+ */
+ @NonNull
+ public ApnThrottleStatus build() {
+ return new ApnThrottleStatus(
+ mSlotIndex,
+ mTransportType,
+ mApnType,
+ mThrottleType,
+ mThrottleExpiryTimeMillis,
+ mRetryType);
+ }
+ }
+}
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index f0088b913d4e..8348502586a5 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -109,10 +109,10 @@ public final class DataCallResponse implements Parcelable {
public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3;
/**
- * Indicates that data retry interval is not specified. Platform can determine when to
+ * Indicates that data retry duration is not specified. Platform can determine when to
* perform data setup appropriately.
*/
- public static final int RETRY_INTERVAL_UNDEFINED = -1;
+ public static final int RETRY_DURATION_UNDEFINED = -1;
/**
* Indicates that the pdu session id is not set.
@@ -254,19 +254,26 @@ public final class DataCallResponse implements Parcelable {
/**
* @return The suggested data retry time in milliseconds.
*
- * @deprecated Use {@link #getRetryIntervalMillis()} instead.
+ * @deprecated Use {@link #getRetryDurationMillis()} instead.
*/
@Deprecated
public int getSuggestedRetryTime() {
+
+ // To match the pre-deprecated getSuggestedRetryTime() behavior.
+ if (mSuggestedRetryTime == RETRY_DURATION_UNDEFINED) {
+ return 0;
+ } else if (mSuggestedRetryTime > Integer.MAX_VALUE) {
+ return Integer.MAX_VALUE;
+ }
return (int) mSuggestedRetryTime;
}
/**
- * @return The network suggested data retry interval in milliseconds. {@code Long.MAX_VALUE}
- * indicates data retry should not occur. {@link #RETRY_INTERVAL_UNDEFINED} indicates network
- * did not suggest any retry interval.
+ * @return The network suggested data retry duration in milliseconds. {@code Long.MAX_VALUE}
+ * indicates data retry should not occur. {@link #RETRY_DURATION_UNDEFINED} indicates network
+ * did not suggest any retry duration.
*/
- public long getRetryIntervalMillis() {
+ public long getRetryDurationMillis() {
return mSuggestedRetryTime;
}
@@ -537,7 +544,7 @@ public final class DataCallResponse implements Parcelable {
public static final class Builder {
private @DataFailureCause int mCause;
- private long mSuggestedRetryTime = RETRY_INTERVAL_UNDEFINED;
+ private long mSuggestedRetryTime = RETRY_DURATION_UNDEFINED;
private int mId;
@@ -592,7 +599,7 @@ public final class DataCallResponse implements Parcelable {
* @param suggestedRetryTime The suggested data retry time in milliseconds.
* @return The same instance of the builder.
*
- * @deprecated Use {@link #setRetryIntervalMillis(long)} instead.
+ * @deprecated Use {@link #setRetryDurationMillis(long)} instead.
*/
@Deprecated
public @NonNull Builder setSuggestedRetryTime(int suggestedRetryTime) {
@@ -601,13 +608,13 @@ public final class DataCallResponse implements Parcelable {
}
/**
- * Set the network suggested data retry interval.
+ * Set the network suggested data retry duration.
*
- * @param retryIntervalMillis The suggested data retry interval in milliseconds.
+ * @param retryDurationMillis The suggested data retry duration in milliseconds.
* @return The same instance of the builder.
*/
- public @NonNull Builder setRetryIntervalMillis(long retryIntervalMillis) {
- mSuggestedRetryTime = retryIntervalMillis;
+ public @NonNull Builder setRetryDurationMillis(long retryDurationMillis) {
+ mSuggestedRetryTime = retryDurationMillis;
return this;
}
diff --git a/telephony/java/android/telephony/data/DataService.java b/telephony/java/android/telephony/data/DataService.java
index 77685971c138..2ec965101930 100644
--- a/telephony/java/android/telephony/data/DataService.java
+++ b/telephony/java/android/telephony/data/DataService.java
@@ -107,6 +107,9 @@ public abstract class DataService extends Service {
private static final int DATA_SERVICE_INDICATION_DATA_CALL_LIST_CHANGED = 11;
private static final int DATA_SERVICE_REQUEST_START_HANDOVER = 12;
private static final int DATA_SERVICE_REQUEST_CANCEL_HANDOVER = 13;
+ private static final int DATA_SERVICE_REQUEST_REGISTER_APN_UNTHROTTLED = 14;
+ private static final int DATA_SERVICE_REQUEST_UNREGISTER_APN_UNTHROTTLED = 15;
+ private static final int DATA_SERVICE_INDICATION_APN_UNTHROTTLED = 16;
private final HandlerThread mHandlerThread;
@@ -129,6 +132,8 @@ public abstract class DataService extends Service {
private final List<IDataServiceCallback> mDataCallListChangedCallbacks = new ArrayList<>();
+ private final List<IDataServiceCallback> mApnUnthrottledCallbacks = new ArrayList<>();
+
/**
* Constructor
* @param slotIndex SIM slot index the data service provider associated with.
@@ -326,6 +331,19 @@ public abstract class DataService extends Service {
}
}
+ private void registerForApnUnthrottled(IDataServiceCallback callback) {
+ synchronized (mApnUnthrottledCallbacks) {
+ mApnUnthrottledCallbacks.add(callback);
+ }
+ }
+
+ private void unregisterForApnUnthrottled(IDataServiceCallback callback) {
+ synchronized (mApnUnthrottledCallbacks) {
+ mApnUnthrottledCallbacks.remove(callback);
+ }
+ }
+
+
/**
* Notify the system that current data call list changed. Data service must invoke this
* method whenever there is any data call status changed.
@@ -343,6 +361,21 @@ public abstract class DataService extends Service {
}
/**
+ * Notify the system that a given APN was unthrottled.
+ *
+ * @param apn Access Point Name defined by the carrier.
+ */
+ public final void notifyApnUnthrottled(@NonNull String apn) {
+ synchronized (mApnUnthrottledCallbacks) {
+ for (IDataServiceCallback callback : mApnUnthrottledCallbacks) {
+ mHandler.obtainMessage(DATA_SERVICE_INDICATION_APN_UNTHROTTLED,
+ mSlotIndex, 0, new ApnUnthrottledIndication(apn,
+ callback)).sendToTarget();
+ }
+ }
+ }
+
+ /**
* Called when the instance of data service is destroyed (e.g. got unbind or binder died)
* or when the data service provider is removed. The extended class should implement this
* method to perform cleanup works.
@@ -429,6 +462,16 @@ public abstract class DataService extends Service {
}
}
+ private static final class ApnUnthrottledIndication {
+ public final String apn;
+ public final IDataServiceCallback callback;
+ ApnUnthrottledIndication(String apn,
+ IDataServiceCallback callback) {
+ this.apn = apn;
+ this.callback = callback;
+ }
+ }
+
private class DataServiceHandler extends Handler {
DataServiceHandler(Looper looper) {
@@ -544,6 +587,26 @@ public abstract class DataService extends Service {
(cReq.callback != null)
? new DataServiceCallback(cReq.callback) : null);
break;
+ case DATA_SERVICE_REQUEST_REGISTER_APN_UNTHROTTLED:
+ if (serviceProvider == null) break;
+ serviceProvider.registerForApnUnthrottled((IDataServiceCallback) message.obj);
+ break;
+ case DATA_SERVICE_REQUEST_UNREGISTER_APN_UNTHROTTLED:
+ if (serviceProvider == null) break;
+ callback = (IDataServiceCallback) message.obj;
+ serviceProvider.unregisterForApnUnthrottled(callback);
+ break;
+ case DATA_SERVICE_INDICATION_APN_UNTHROTTLED:
+ if (serviceProvider == null) break;
+ ApnUnthrottledIndication apnUnthrottledIndication =
+ (ApnUnthrottledIndication) message.obj;
+ try {
+ apnUnthrottledIndication.callback
+ .onApnUnthrottled(apnUnthrottledIndication.apn);
+ } catch (RemoteException e) {
+ loge("Failed to call onApnUnthrottled. " + e);
+ }
+ break;
}
}
}
@@ -695,6 +758,26 @@ public abstract class DataService extends Service {
mHandler.obtainMessage(DATA_SERVICE_REQUEST_CANCEL_HANDOVER,
slotIndex, 0, req).sendToTarget();
}
+
+ @Override
+ public void registerForUnthrottleApn(int slotIndex, IDataServiceCallback callback) {
+ if (callback == null) {
+ loge("registerForUnthrottleApn: callback is null");
+ return;
+ }
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_REGISTER_APN_UNTHROTTLED, slotIndex,
+ 0, callback).sendToTarget();
+ }
+
+ @Override
+ public void unregisterForUnthrottleApn(int slotIndex, IDataServiceCallback callback) {
+ if (callback == null) {
+ loge("uregisterForUnthrottleApn: callback is null");
+ return;
+ }
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_UNREGISTER_APN_UNTHROTTLED,
+ slotIndex, 0, callback).sendToTarget();
+ }
}
private void log(String s) {
diff --git a/telephony/java/android/telephony/data/DataServiceCallback.java b/telephony/java/android/telephony/data/DataServiceCallback.java
index eef0e017f998..52bf15fd16c3 100644
--- a/telephony/java/android/telephony/data/DataServiceCallback.java
+++ b/telephony/java/android/telephony/data/DataServiceCallback.java
@@ -233,7 +233,7 @@ public class DataServiceCallback {
*/
@NonNull
public static String resultCodeToString(@DataServiceCallback.ResultCode int resultCode) {
- switch(resultCode) {
+ switch (resultCode) {
case RESULT_SUCCESS:
return "RESULT_SUCCESS";
case RESULT_ERROR_UNSUPPORTED:
@@ -248,4 +248,22 @@ public class DataServiceCallback {
return "Missing case for result code=" + resultCode;
}
}
+
+ /**
+ * Indicates that the specified APN is no longer throttled.
+ *
+ * @param apn Access Point Name defined by the carrier.
+ */
+ public void onApnUnthrottled(@NonNull String apn) {
+ if (mCallback != null) {
+ try {
+ if (DBG) Rlog.d(TAG, "onApnUnthrottled");
+ mCallback.onApnUnthrottled(apn);
+ } catch (RemoteException e) {
+ Rlog.e(TAG, "onApnUnthrottled: remote exception", e);
+ }
+ } else {
+ Rlog.e(TAG, "onApnUnthrottled: callback is null!");
+ }
+ }
}
diff --git a/telephony/java/android/telephony/data/IDataService.aidl b/telephony/java/android/telephony/data/IDataService.aidl
index 33226feb0e35..3f1f033d6f11 100644
--- a/telephony/java/android/telephony/data/IDataService.aidl
+++ b/telephony/java/android/telephony/data/IDataService.aidl
@@ -40,4 +40,6 @@ oneway interface IDataService
void unregisterForDataCallListChanged(int slotId, IDataServiceCallback callback);
void startHandover(int slotId, int cid, IDataServiceCallback callback);
void cancelHandover(int slotId, int cid, IDataServiceCallback callback);
+ void registerForUnthrottleApn(int slotIndex, IDataServiceCallback callback);
+ void unregisterForUnthrottleApn(int slotIndex, IDataServiceCallback callback);
}
diff --git a/telephony/java/android/telephony/data/IDataServiceCallback.aidl b/telephony/java/android/telephony/data/IDataServiceCallback.aidl
index d296e7b19be8..9cc2feac331a 100644
--- a/telephony/java/android/telephony/data/IDataServiceCallback.aidl
+++ b/telephony/java/android/telephony/data/IDataServiceCallback.aidl
@@ -32,4 +32,5 @@ oneway interface IDataServiceCallback
void onDataCallListChanged(in List<DataCallResponse> dataCallList);
void onHandoverStarted(int result);
void onHandoverCancelled(int result);
+ void onApnUnthrottled(in String apn);
}
diff --git a/telephony/java/android/telephony/data/IQualifiedNetworksService.aidl b/telephony/java/android/telephony/data/IQualifiedNetworksService.aidl
index 3bf09bc19788..2904082616e7 100644
--- a/telephony/java/android/telephony/data/IQualifiedNetworksService.aidl
+++ b/telephony/java/android/telephony/data/IQualifiedNetworksService.aidl
@@ -17,6 +17,7 @@
package android.telephony.data;
import android.telephony.data.IQualifiedNetworksServiceCallback;
+import android.telephony.data.ApnThrottleStatus;
/**
* {@hide}
@@ -25,4 +26,5 @@ interface IQualifiedNetworksService
{
oneway void createNetworkAvailabilityProvider(int slotId, IQualifiedNetworksServiceCallback callback);
oneway void removeNetworkAvailabilityProvider(int slotId);
+ oneway void reportApnThrottleStatusChanged(int slotId, in List<ApnThrottleStatus> statuses);
}
diff --git a/telephony/java/android/telephony/data/QualifiedNetworksService.java b/telephony/java/android/telephony/data/QualifiedNetworksService.java
index 05971c4d2e70..4af63b4cf981 100644
--- a/telephony/java/android/telephony/data/QualifiedNetworksService.java
+++ b/telephony/java/android/telephony/data/QualifiedNetworksService.java
@@ -28,6 +28,7 @@ import android.os.Message;
import android.os.RemoteException;
import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.Annotation.ApnType;
+import android.util.Log;
import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
@@ -65,6 +66,7 @@ public abstract class QualifiedNetworksService extends Service {
private static final int QNS_REMOVE_NETWORK_AVAILABILITY_PROVIDER = 2;
private static final int QNS_REMOVE_ALL_NETWORK_AVAILABILITY_PROVIDERS = 3;
private static final int QNS_UPDATE_QUALIFIED_NETWORKS = 4;
+ private static final int QNS_APN_THROTTLE_STATUS_CHANGED = 5;
private final HandlerThread mHandlerThread;
@@ -160,6 +162,17 @@ public abstract class QualifiedNetworksService extends Service {
}
/**
+ * The framework calls this method when the throttle status of an APN changes.
+ *
+ * This method is meant to be overridden.
+ *
+ * @param statuses the statuses that have changed
+ */
+ public void reportApnThrottleStatusChanged(@NonNull List<ApnThrottleStatus> statuses) {
+ Log.d(TAG, "reportApnThrottleStatusChanged: statuses size=" + statuses.size());
+ }
+
+ /**
* Called when the qualified networks provider is removed. The extended class should
* implement this method to perform cleanup works.
*/
@@ -197,6 +210,12 @@ public abstract class QualifiedNetworksService extends Service {
+ slotIndex);
}
break;
+ case QNS_APN_THROTTLE_STATUS_CHANGED:
+ if (provider != null) {
+ List<ApnThrottleStatus> statuses = (List<ApnThrottleStatus>) message.obj;
+ provider.reportApnThrottleStatusChanged(statuses);
+ }
+ break;
case QNS_REMOVE_NETWORK_AVAILABILITY_PROVIDER:
if (provider != null) {
@@ -286,6 +305,13 @@ public abstract class QualifiedNetworksService extends Service {
mHandler.obtainMessage(QNS_REMOVE_NETWORK_AVAILABILITY_PROVIDER, slotIndex, 0)
.sendToTarget();
}
+
+ @Override
+ public void reportApnThrottleStatusChanged(int slotIndex,
+ List<ApnThrottleStatus> statuses) {
+ mHandler.obtainMessage(QNS_APN_THROTTLE_STATUS_CHANGED, slotIndex, 0, statuses)
+ .sendToTarget();
+ }
}
private void log(String s) {
diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java
index 1b51936e873b..aaa68d6f7d57 100644
--- a/telephony/java/android/telephony/ims/ImsCallProfile.java
+++ b/telephony/java/android/telephony/ims/ImsCallProfile.java
@@ -18,6 +18,7 @@ package android.telephony.ims;
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
@@ -207,6 +208,42 @@ public final class ImsCallProfile implements Parcelable {
"android.telephony.ims.extra.RETRY_CALL_FAIL_NETWORKTYPE";
/**
+ * Extra for the call composer call priority, either {@link ImsCallProfile#PRIORITY_NORMAL} or
+ * {@link ImsCallProfile#PRIORITY_URGENT}. It can be set via
+ * {@link #setCallExtraInt(String, int)}.
+ *
+ * Reference: RCC.20 Section 2.4.4.2
+ */
+ public static final String EXTRA_PRIORITY = "android.telephony.ims.extra.PRIORITY";
+
+ // TODO(hallliu) remove the reference to the maximum length and update it later.
+ /**
+ * Extra for the call composer call subject, a string of maximum length 60 characters.
+ * It can be set via {@link #setCallExtra(String, String)}.
+ *
+ * Reference: RCC.20 Section 2.4.3.2
+ */
+ public static final String EXTRA_CALL_SUBJECT = "android.telephony.ims.extra.CALL_SUBJECT";
+
+ /**
+ * Extra for the call composer call location, an {@Link android.location.Location} parcelable
+ * class to represent the geolocation as a latitude and longitude pair. It can be set via
+ * {@link #setCallExtraParcelable(String, Parcelable)}.
+ *
+ * Reference: RCC.20 Section 2.4.3.2
+ */
+ public static final String EXTRA_LOCATION = "android.telephony.ims.extra.LOCATION";
+
+ /**
+ * Extra for the call composer picture URL, a String that indicates the URL on the carrier’s
+ * server infrastructure to get the picture. It can be set via
+ * {@link #setCallExtra(String, String)}.
+ *
+ * Reference: RCC.20 Section 2.4.3.2
+ */
+ public static final String EXTRA_PICTURE_URL = "android.telephony.ims.extra.PICTURE_URL";
+
+ /**
* Values for EXTRA_OIR / EXTRA_CNAP
*/
/**
@@ -244,6 +281,21 @@ public final class ImsCallProfile implements Parcelable {
*/
public static final int DIALSTRING_USSD = 2;
+ // Values for EXTRA_PRIORITY
+ /**
+ * Indicates the call composer call priority is normal.
+ *
+ * Reference: RCC.20 Section 2.4.4.2
+ */
+ public static final int PRIORITY_NORMAL = 0;
+
+ /**
+ * Indicates the call composer call priority is urgent.
+ *
+ * Reference: RCC.20 Section 2.4.4.2
+ */
+ public static final int PRIORITY_URGENT = 1;
+
/**
* Call is not restricted on peer side and High Definition media is supported
*/
@@ -588,6 +640,19 @@ public final class ImsCallProfile implements Parcelable {
return mCallExtras.getInt(name, defaultValue);
}
+ /**
+ * Get the call extras (Parcelable), given the extra name.
+ * @param name call extra name
+ * @return the corresponding call extra Parcelable or null if not applicable
+ */
+ @Nullable
+ public <T extends Parcelable> T getCallExtraParcelable(@Nullable String name) {
+ if (mCallExtras != null) {
+ return mCallExtras.getParcelable(name);
+ }
+ return null;
+ }
+
public void setCallExtra(String name, String value) {
if (mCallExtras != null) {
mCallExtras.putString(name, value);
@@ -607,6 +672,17 @@ public final class ImsCallProfile implements Parcelable {
}
/**
+ * Set the call extra value (Parcelable), given the call extra name.
+ * @param name call extra name
+ * @param parcelable call extra value
+ */
+ public void setCallExtraParcelable(@NonNull String name, @NonNull Parcelable parcelable) {
+ if (mCallExtras != null) {
+ mCallExtras.putParcelable(name, parcelable);
+ }
+ }
+
+ /**
* Set the call restrict cause, which provides the reason why a call has been restricted from
* using High Definition media.
*/
diff --git a/telephony/java/android/telephony/ims/ImsCallSession.java b/telephony/java/android/telephony/ims/ImsCallSession.java
index a3efb799029a..0aff99709a52 100755
--- a/telephony/java/android/telephony/ims/ImsCallSession.java
+++ b/telephony/java/android/telephony/ims/ImsCallSession.java
@@ -101,10 +101,29 @@ public class ImsCallSession {
*/
public static class Listener {
/**
- * Called when a request is sent out to initiate a new session
- * and 1xx response is received from the network.
+ * Called when the session is initiating.
*
- * @param session the session object that carries out the IMS session
+ * see: {@link ImsCallSessionListener#callSessionInitiating(ImsCallProfile)}
+ */
+ public void callSessionInitiating(ImsCallSession session,
+ ImsCallProfile profile) {
+ // no-op
+ }
+
+ /**
+ * Called when the session failed before initiating was called.
+ *
+ * see: {@link ImsCallSessionListener#callSessionInitiatingFailed(ImsReasonInfo)}
+ */
+ public void callSessionInitiatingFailed(ImsCallSession session,
+ ImsReasonInfo reasonInfo) {
+ // no-op
+ }
+
+ /**
+ * Called when the session is progressing.
+ *
+ * see: {@link ImsCallSessionListener#callSessionProgressing(ImsStreamMediaProfile)}
*/
public void callSessionProgressing(ImsCallSession session,
ImsStreamMediaProfile profile) {
@@ -1179,6 +1198,13 @@ public class ImsCallSession {
* Notifies the result of the basic session operation (setup / terminate).
*/
@Override
+ public void callSessionInitiating(ImsCallProfile profile) {
+ if (mListener != null) {
+ mListener.callSessionInitiating(ImsCallSession.this, profile);
+ }
+ }
+
+ @Override
public void callSessionProgressing(ImsStreamMediaProfile profile) {
if (mListener != null) {
mListener.callSessionProgressing(ImsCallSession.this, profile);
@@ -1193,6 +1219,13 @@ public class ImsCallSession {
}
@Override
+ public void callSessionInitiatingFailed(ImsReasonInfo reasonInfo) {
+ if (mListener != null) {
+ mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
+ }
+ }
+
+ @Override
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
if (mListener != null) {
mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
diff --git a/telephony/java/android/telephony/ims/ImsCallSessionListener.java b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
index 86bb5d9f0b09..db99acfd9a35 100644
--- a/telephony/java/android/telephony/ims/ImsCallSessionListener.java
+++ b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
@@ -53,8 +53,45 @@ public class ImsCallSessionListener {
}
/**
- * A request has been sent out to initiate a new IMS call session and a 1xx response has been
- * received from the network.
+ * Called when the network first begins to establish the call session and is now connecting
+ * to the remote party. This must be called once after {@link ImsCallSessionImplBase#start} and
+ * before any other method on this listener. After this is called,
+ * {@link #callSessionProgressing(ImsStreamMediaProfile)} must be called to communicate any
+ * further updates.
+ * <p/>
+ * Once this is called, {@link #callSessionTerminated} must be called
+ * to end the call session. In the event that the session failed before the remote party
+ * was contacted, {@link #callSessionInitiatingFailed} must be called.
+ *
+ * @param profile the associated {@link ImsCallProfile}.
+ */
+ public void callSessionInitiating(@NonNull ImsCallProfile profile) {
+ try {
+ mListener.callSessionInitiating(profile);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * The IMS call session establishment has failed while initiating.
+ *
+ * @param reasonInfo {@link ImsReasonInfo} detailing the reason of the IMS call session
+ * establishment failure.
+ */
+ public void callSessionInitiatingFailed(@NonNull ImsReasonInfo reasonInfo) {
+ try {
+ mListener.callSessionInitiatingFailed(reasonInfo);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Called after the network has contacted the remote party and the call state should move to
+ * ALERTING.
+ *
+ * @param profile the associated {@link ImsCallProfile}.
*/
public void callSessionProgressing(ImsStreamMediaProfile profile) {
try {
@@ -65,7 +102,8 @@ public class ImsCallSessionListener {
}
/**
- * The IMS call session has been initiated.
+ * Called once the outgoing IMS call session has been begun between the local and remote party.
+ * The call state should move to ACTIVE.
*
* @param profile the associated {@link ImsCallProfile}.
*/
@@ -82,7 +120,12 @@ public class ImsCallSessionListener {
*
* @param reasonInfo {@link ImsReasonInfo} detailing the reason of the IMS call session
* establishment failure.
+ * @deprecated {@link #callSessionInitiated(ImsCallProfile)} is called immediately after
+ * the session is first started which meant that there was no time in which a call to this
+ * method was technically valid. This method is replaced starting Android S in favor of
+ * {@link #callSessionInitiatingFailed(ImsReasonInfo)}.
*/
+ @Deprecated
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
try {
mListener.callSessionInitiatedFailed(reasonInfo);
diff --git a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
index ed895b77a164..ed0375251ffb 100644
--- a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
+++ b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
@@ -37,6 +37,8 @@ oneway interface IImsCallSessionListener {
/**
* Notifies the result of the basic session operation (setup / terminate).
*/
+ void callSessionInitiating(in ImsCallProfile profile);
+ void callSessionInitiatingFailed(in ImsReasonInfo reasonInfo);
void callSessionProgressing(in ImsStreamMediaProfile profile);
void callSessionInitiated(in ImsCallProfile profile);
void callSessionInitiatedFailed(in ImsReasonInfo reasonInfo);
diff --git a/telephony/java/android/telephony/ims/feature/MmTelFeature.java b/telephony/java/android/telephony/ims/feature/MmTelFeature.java
index e570fb6f5612..0b2c6d974980 100644
--- a/telephony/java/android/telephony/ims/feature/MmTelFeature.java
+++ b/telephony/java/android/telephony/ims/feature/MmTelFeature.java
@@ -231,8 +231,9 @@ public class MmTelFeature extends ImsFeature {
* The capabilities that are used in MmTelFeature are defined as
* {@link MmTelCapabilities#CAPABILITY_TYPE_VOICE},
* {@link MmTelCapabilities#CAPABILITY_TYPE_VIDEO},
- * {@link MmTelCapabilities#CAPABILITY_TYPE_UT}, and
- * {@link MmTelCapabilities#CAPABILITY_TYPE_SMS}.
+ * {@link MmTelCapabilities#CAPABILITY_TYPE_UT},
+ * {@link MmTelCapabilities#CAPABILITY_TYPE_SMS}, and
+ * {@link MmTelCapabilities#CAPABILITY_TYPE_CALL_COMPOSER}.
*
* The capabilities of this MmTelFeature will be set by the framework.
*/
@@ -275,7 +276,8 @@ public class MmTelFeature extends ImsFeature {
CAPABILITY_TYPE_VOICE,
CAPABILITY_TYPE_VIDEO,
CAPABILITY_TYPE_UT,
- CAPABILITY_TYPE_SMS
+ CAPABILITY_TYPE_SMS,
+ CAPABILITY_TYPE_CALL_COMPOSER
})
@Retention(RetentionPolicy.SOURCE)
public @interface MmTelCapability {}
@@ -301,6 +303,11 @@ public class MmTelFeature extends ImsFeature {
public static final int CAPABILITY_TYPE_SMS = 1 << 3;
/**
+ * This MmTelFeature supports Call Composer (section 2.4 of RC.20)
+ */
+ public static final int CAPABILITY_TYPE_CALL_COMPOSER = 1 << 4;
+
+ /**
* @hide
*/
@Override
@@ -343,6 +350,8 @@ public class MmTelFeature extends ImsFeature {
builder.append(isCapable(CAPABILITY_TYPE_UT));
builder.append(" SMS: ");
builder.append(isCapable(CAPABILITY_TYPE_SMS));
+ builder.append(" CALL_COMPOSER: ");
+ builder.append(isCapable(CAPABILITY_TYPE_CALL_COMPOSER));
builder.append("]");
return builder.toString();
}
diff --git a/telephony/java/com/android/internal/telephony/DctConstants.java b/telephony/java/com/android/internal/telephony/DctConstants.java
index 76fc4f7d0519..6fbde503c3a0 100644
--- a/telephony/java/com/android/internal/telephony/DctConstants.java
+++ b/telephony/java/com/android/internal/telephony/DctConstants.java
@@ -113,6 +113,7 @@ public class DctConstants {
public static final int EVENT_NR_TIMER_WATCHDOG = BASE + 53;
public static final int EVENT_CARRIER_CONFIG_CHANGED = BASE + 54;
public static final int EVENT_SIM_STATE_UPDATED = BASE + 55;
+ public static final int EVENT_APN_UNTHROTTLED = BASE + 56;
/***** Constants *****/
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index a40988b3348b..c60a44c3803a 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -2361,4 +2361,10 @@ interface ITelephony {
* Gets the config of RCS VoLTE single registration enabled for the carrier/subscription.
*/
boolean getCarrierSingleRegistrationEnabled(int subId);
+
+ /**
+ * Return the mobile provisioning url that is used to launch a browser to allow users to manage
+ * their mobile plan.
+ */
+ String getMobileProvisioningUrl();
}