From 78733ad48f12860727475b5c9e805c1caa8c34a6 Mon Sep 17 00:00:00 2001 From: "James.cf Lin" Date: Tue, 29 Jun 2021 04:06:23 +0800 Subject: [UCE] Fix NPE in the RcsContactUceCapability When get the RcsContactPresenceTuple from the RcsContactUceCapability, it should check whether the servier ID is null or not Bug: 191836903 Test: atest RcsContactUceCapabilityTest Change-Id: I987c6f1fbcabfe64688f1d71210c83b6c4d8d9e0 --- telephony/java/android/telephony/ims/RcsContactUceCapability.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/ims/RcsContactUceCapability.java b/telephony/java/android/telephony/ims/RcsContactUceCapability.java index 530003d6350a..91121187a19a 100644 --- a/telephony/java/android/telephony/ims/RcsContactUceCapability.java +++ b/telephony/java/android/telephony/ims/RcsContactUceCapability.java @@ -331,7 +331,7 @@ public final class RcsContactUceCapability implements Parcelable { return null; } for (RcsContactPresenceTuple tuple : mPresenceTuples) { - if (tuple.getServiceId().equals(serviceId)) { + if (tuple.getServiceId() != null && tuple.getServiceId().equals(serviceId)) { return tuple; } } -- cgit v1.2.3 From bd4bd964f442a41bbbfbf3604c0c9f7f0d467871 Mon Sep 17 00:00:00 2001 From: Jayachandran C Date: Fri, 25 Jun 2021 18:07:54 -0700 Subject: QOS: Check for portRange validity before filter matching Bug: 191810683 Test: Manual atest com.android.internal.telephony.dataconnection.QosCallbackTrackerTest Change-Id: Iaad16f7efe4bfaea3abd296547b5c53426a29854 --- telephony/java/android/telephony/data/QosBearerFilter.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/data/QosBearerFilter.java b/telephony/java/android/telephony/data/QosBearerFilter.java index 5642549d7313..54930d0266b7 100644 --- a/telephony/java/android/telephony/data/QosBearerFilter.java +++ b/telephony/java/android/telephony/data/QosBearerFilter.java @@ -57,6 +57,12 @@ public final class QosBearerFilter implements Parcelable { public static final int QOS_PROTOCOL_UDP = android.hardware.radio.V1_6.QosProtocol.UDP; public static final int QOS_PROTOCOL_ESP = android.hardware.radio.V1_6.QosProtocol.ESP; public static final int QOS_PROTOCOL_AH = android.hardware.radio.V1_6.QosProtocol.AH; + public static final int QOS_MIN_PORT = android.hardware.radio.V1_6.QosPortRange.MIN; + /** + * Hardcoded inplace of android.hardware.radio.V1_6.QosPortRange.MAX as it + * returns -1 due to uint16_t to int conversion in java. (TODO: Fix the HAL) + */ + public static final int QOS_MAX_PORT = 65535; // android.hardware.radio.V1_6.QosPortRange.MIN; @QosProtocol private int protocol; @@ -229,6 +235,12 @@ public final class QosBearerFilter implements Parcelable { return end; } + public boolean isValid() { + return start >= QOS_MIN_PORT && start <= QOS_MAX_PORT + && end >= QOS_MIN_PORT && end <= QOS_MAX_PORT + && start <= end; + } + @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(start); -- cgit v1.2.3 From 6d33beea884dca811857aff7262f20d19c87aa68 Mon Sep 17 00:00:00 2001 From: Zoey Chen Date: Thu, 27 May 2021 20:16:35 +0800 Subject: [Telephony] Add description about location permission - Hold ACCESS_FINE_LOCATION: full service state - Hold ACCESS_COARSE_LOCATION: set cellIdentity is null - No local permission: set cellIdentity, mOperatorAlphaLong, mOperatorAlphaShort and mOperatorNumeric are null Bug: 165014401 Test: make Change-Id: I9ada08a530d9b8bc8483edfad783ff3b7434faa3 --- .../android/telephony/NetworkRegistrationInfo.java | 2 + telephony/java/android/telephony/ServiceState.java | 50 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/NetworkRegistrationInfo.java b/telephony/java/android/telephony/NetworkRegistrationInfo.java index 5fb60d7599ea..6a807665a103 100644 --- a/telephony/java/android/telephony/NetworkRegistrationInfo.java +++ b/telephony/java/android/telephony/NetworkRegistrationInfo.java @@ -506,6 +506,8 @@ public final class NetworkRegistrationInfo implements Parcelable { } /** + * Require {@link android.Manifest.permission#ACCESS_FINE_LOCATION}, otherwise return null. + * * @return The cell information. */ @Nullable diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 6da61b712916..d745dc215f34 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -758,6 +758,11 @@ public class ServiceState implements Parcelable { * In GSM/UMTS, long format can be up to 16 characters long. * In CDMA, returns the ERI text, if set. Otherwise, returns the ONS. * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not hold neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return long name of operator, null if unregistered or unknown */ public String getOperatorAlphaLong() { @@ -766,6 +771,12 @@ public class ServiceState implements Parcelable { /** * Get current registered voice network operator name in long alphanumeric format. + * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not hold neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return long name of operator * @hide */ @@ -780,6 +791,11 @@ public class ServiceState implements Parcelable { * * In GSM/UMTS, short format can be up to 8 characters long. * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not hold neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return short name of operator, null if unregistered or unknown */ public String getOperatorAlphaShort() { @@ -788,6 +804,12 @@ public class ServiceState implements Parcelable { /** * Get current registered voice network operator name in short alphanumeric format. + * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not have neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return short name of operator, null if unregistered or unknown * @hide */ @@ -799,6 +821,12 @@ public class ServiceState implements Parcelable { /** * Get current registered data network operator name in short alphanumeric format. + * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not have neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return short name of operator, null if unregistered or unknown * @hide */ @@ -812,6 +840,11 @@ public class ServiceState implements Parcelable { * Get current registered operator name in long alphanumeric format if * available or short otherwise. * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not hold neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @see #getOperatorAlphaLong * @see #getOperatorAlphaShort * @@ -832,6 +865,11 @@ public class ServiceState implements Parcelable { * In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit * network code. * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not hold neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return numeric format of operator, null if unregistered or unknown */ /* @@ -844,6 +882,12 @@ public class ServiceState implements Parcelable { /** * Get current registered voice network operator numeric id. + * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not hold neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return numeric format of operator, null if unregistered or unknown * @hide */ @@ -854,6 +898,12 @@ public class ServiceState implements Parcelable { /** * Get current registered data network operator numeric id. + * + * Require at least {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. Otherwise return null if the + * caller does not hold neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. + * * @return numeric format of operator, null if unregistered or unknown * @hide */ -- cgit v1.2.3 From 5b001197d86e616405abd1578e97bb86d9cb55ee Mon Sep 17 00:00:00 2001 From: "James.cf Lin" Date: Wed, 30 Jun 2021 02:03:15 +0800 Subject: [UCE] Set the default value of the list subscribe to false Set the default value of the list subscribe to false because there are not many carriers support the list subscription Bug: 190683278 Test: atest RcsUceAdapterTest Change-Id: I146637fda050a74f593c1b221364c18a03d2da5e --- telephony/java/android/telephony/CarrierConfigManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 7f1ea8fa9614..e03e74c7fdad 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -4370,7 +4370,7 @@ public class CarrierConfigManager { new String[] {}); defaults.putBoolean(KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL, false); defaults.putBoolean(KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL, false); - defaults.putBoolean(KEY_ENABLE_PRESENCE_GROUP_SUBSCRIBE_BOOL, true); + defaults.putBoolean(KEY_ENABLE_PRESENCE_GROUP_SUBSCRIBE_BOOL, false); defaults.putInt(KEY_NON_RCS_CAPABILITIES_CACHE_EXPIRATION_SEC_INT, 30 * 24 * 60 * 60); defaults.putBoolean(KEY_RCS_REQUEST_FORBIDDEN_BY_SIP_489_BOOL, false); defaults.putLong(KEY_RCS_REQUEST_RETRY_INTERVAL_MILLIS_LONG, 20 * 60 * 1000); -- cgit v1.2.3 From bc9ef4c8da115f9b6efd317cf6c983ba650e75a3 Mon Sep 17 00:00:00 2001 From: Jack Nudelman Date: Mon, 28 Jun 2021 07:08:04 -0700 Subject: Update documentation outlining results during voice calls. Test: Just comment change, test not necessary Bug: 192446339 Change-Id: I7fe0efdaa0b28f8d8a4389d7249f20d06ab258d0 --- telephony/java/android/telephony/TelephonyManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 64aa299411ff..e0ab0a368a4f 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -15104,8 +15104,8 @@ public class TelephonyManager { /** * Indicates that the thermal mitigation request could not power off the radio due to the device - * either being in an active voice call, device pending an emergency call, or any other state - * that would dissallow powering off of radio. + * either being in an active emergency voice call, device pending an emergency call, or any + * other state that would disallow powering off of radio. * * @hide */ -- cgit v1.2.3 From af6fd22efb657ee47189363ed52be86dba60452e Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Sat, 3 Jul 2021 01:06:09 +0800 Subject: Add carrier config for using user data to detect RRC state This configuration allows the framework to use user data communication to detect RRC state. Bug: 191321871 Test: build pass and no phone crash. atest NetworkTypeControllerTest (pass) Change-Id: Ieffabd25a74faf2038b2e08e956fa16c9efdd3ca --- .../android/telephony/CarrierConfigManager.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 7f1ea8fa9614..6c755cfb89b9 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -3522,6 +3522,30 @@ public class CarrierConfigManager { public static final String KEY_NR_ADVANCED_CAPABLE_PCO_ID_INT = "nr_advanced_capable_pco_id_int"; + /** + * This configuration allows the framework to use user data communication to detect RRC state, + * and this is used on the 5G icon. + * + * There is a new way for for RRC state detection at Android 12. If + * {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}( + * {@link TelephonyManager#CAPABILITY_PHYSICAL_CHANNEL_CONFIG_1_6_SUPPORTED}) returns true, + * then framework can use PHYSICAL_CHANNEL_CONFIG for RRC state detection. Based on this + * condition, some carriers want to use the legacy behavior that way is using user data + * communication to detect the RRC state. Therefore, this configuration allows the framework + * to use user data communication to detect RRC state. + * + * The precondition is + * {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}( + * {@link TelephonyManager#CAPABILITY_PHYSICAL_CHANNEL_CONFIG_1_6_SUPPORTED}) returns true, + * otherwise this config is not working. + * If this is true, framework uses the user data communication for RRC state detection. + * If this is false, framework uses the PHYSICAL_CHANNEL_CONFIG for RRC state detection. + * + * @hide + */ + public static final String KEY_LTE_ENDC_USING_USER_DATA_FOR_RRC_DETECTION_BOOL = + "lte_endc_using_user_data_for_rrc_detection_bool"; + /** * Controls time in milliseconds until DcTracker reevaluates 5G connection state. * @hide @@ -5500,6 +5524,7 @@ public class CarrierConfigManager { sDefaults.putLong(KEY_5G_WATCHDOG_TIME_MS_LONG, 3600000); sDefaults.putIntArray(KEY_ADDITIONAL_NR_ADVANCED_BANDS_INT_ARRAY, new int[0]); sDefaults.putInt(KEY_NR_ADVANCED_CAPABLE_PCO_ID_INT, 0); + sDefaults.putBoolean(KEY_LTE_ENDC_USING_USER_DATA_FOR_RRC_DETECTION_BOOL, false); sDefaults.putBoolean(KEY_UNMETERED_NR_NSA_BOOL, false); sDefaults.putBoolean(KEY_UNMETERED_NR_NSA_MMWAVE_BOOL, false); sDefaults.putBoolean(KEY_UNMETERED_NR_NSA_SUB6_BOOL, false); -- cgit v1.2.3