diff options
Diffstat (limited to 'telephony')
3 files changed, 81 insertions, 17 deletions
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 6781cce6448b..4d2e00785d49 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -963,6 +963,21 @@ public class CarrierConfigManager { = "carrier_use_ims_first_for_emergency_bool"; /** + * When {@code true}, the determination of whether to place a call as an emergency call will be + * based on the known {@link android.telephony.emergency.EmergencyNumber}s for the SIM on which + * the call is being placed. In a dual SIM scenario, if Sim A has the emergency numbers + * 123, 456 and Sim B has the emergency numbers 789, and the user places a call on SIM A to 789, + * it will not be treated as an emergency call in this case. + * When {@code false}, the determination is based on the emergency numbers from all device SIMs, + * regardless of which SIM the call is being placed on. If Sim A has the emergency numbers + * 123, 456 and Sim B has the emergency numbers 789, and the user places a call on SIM A to 789, + * the call will be dialed as an emergency number, but with an unspecified routing. + * @hide + */ + public static final String KEY_USE_ONLY_DIALED_SIM_ECC_LIST_BOOL = + "use_only_dialed_sim_ecc_list_bool"; + + /** * When IMS instant lettering is available for a carrier (see * {@link #KEY_CARRIER_INSTANT_LETTERING_AVAILABLE_BOOL}), determines the list of characters * which may not be contained in messages. Should be specified as a regular expression suitable @@ -1874,6 +1889,20 @@ public class CarrierConfigManager { "lte_plus_threshold_bandwidth_khz_int"; /** + * The combined channel bandwidth threshold (non-inclusive) in KHz required to display the + * NR advanced (i.e. 5G+) data icon. It is 0 by default, meaning minimum bandwidth check is + * not enabled. Other factors like bands or frequency can also determine whether the NR + * advanced data icon is shown or not. + * + * @see #KEY_ADDITIONAL_NR_ADVANCED_BANDS_INT_ARRAY + * @see #KEY_NR_ADVANCED_CAPABLE_PCO_ID_INT + * + * @hide + */ + public static final String KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT = + "nr_advanced_threshold_bandwidth_khz_int"; + + /** * The string is used to filter redundant string from PLMN Network Name that's supplied by * specific carrier. * @@ -3538,6 +3567,17 @@ public class CarrierConfigManager { "nr_advanced_capable_pco_id_int"; /** + * Enabled NR advanced (i.e. 5G+) icon while roaming. The default value is {@code true}, meaming + * the same NR advanced logic used for home network will be used for roaming network as well. + * Set this to {@code false} will disable NR advanced icon while the device is roaming, + * regardless meeting NR advanced criteria or not. + * + * @hide + */ + public static final String KEY_ENABLE_NR_ADVANCED_WHILE_ROAMING_BOOL = + "enable_nr_advanced_for_roaming_bool"; + + /** * This configuration allows the framework to use user data communication to detect Idle state, * and this is used on the 5G icon. * @@ -5195,6 +5235,16 @@ public class CarrierConfigManager { public static final String KEY_VONR_SETTING_VISIBILITY_BOOL = "vonr_setting_visibility_bool"; /** + * Flag specifying whether VoNR should be enabled for carrier. + * If true, VoNr will be enabled. If false, hard disabled. + * + * Disabled by default. + * + * @hide + */ + public static final String KEY_VONR_ENABLED_BOOL = "vonr_enabled_bool"; + + /** * Determine whether unthrottle data retry when tracking area code (TAC/LAC) from cell changes * * @hide @@ -5254,6 +5304,7 @@ 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.putBoolean(KEY_USE_ONLY_DIALED_SIM_ECC_LIST_BOOL, false); sDefaults.putString(KEY_CARRIER_NETWORK_SERVICE_WWAN_PACKAGE_OVERRIDE_STRING, ""); sDefaults.putString(KEY_CARRIER_NETWORK_SERVICE_WLAN_PACKAGE_OVERRIDE_STRING, ""); sDefaults.putString(KEY_CARRIER_QUALIFIED_NETWORKS_SERVICE_PACKAGE_OVERRIDE_STRING, ""); @@ -5589,6 +5640,7 @@ public class CarrierConfigManager { sDefaults.putString(KEY_SHOW_CARRIER_DATA_ICON_PATTERN_STRING, ""); sDefaults.putBoolean(KEY_HIDE_LTE_PLUS_DATA_ICON_BOOL, true); sDefaults.putInt(KEY_LTE_PLUS_THRESHOLD_BANDWIDTH_KHZ_INT, 20000); + sDefaults.putInt(KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT, 0); sDefaults.putIntArray(KEY_CARRIER_NR_AVAILABILITIES_INT_ARRAY, new int[]{CARRIER_NR_AVAILABILITY_NSA, CARRIER_NR_AVAILABILITY_SA}); sDefaults.putBoolean(KEY_LTE_ENABLED_BOOL, true); @@ -5684,6 +5736,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_ENABLE_NR_ADVANCED_WHILE_ROAMING_BOOL, true); 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); @@ -5813,6 +5866,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_DISPLAY_NO_DATA_NOTIFICATION_ON_PERMANENT_FAILURE_BOOL, false); sDefaults.putBoolean(KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL, false); sDefaults.putBoolean(KEY_VONR_SETTING_VISIBILITY_BOOL, false); + sDefaults.putBoolean(KEY_VONR_ENABLED_BOOL, false); } /** diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 114c90bbd87a..1be1f2f8de30 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -949,6 +949,15 @@ public class SubscriptionManager { public static final String VOIMS_OPT_IN_STATUS = SimInfo.COLUMN_VOIMS_OPT_IN_STATUS; /** + * TelephonyProvider column name for NR Advanced calling + * Determines if the user has enabled VoNR settings for this subscription. + * + * @hide + */ + public static final String NR_ADVANCED_CALLING_ENABLED = + SimInfo.COLUMN_NR_ADVANCED_CALLING_ENABLED; + + /** * Profile class of the subscription * @hide */ diff --git a/telephony/java/android/telephony/TelephonyScanManager.java b/telephony/java/android/telephony/TelephonyScanManager.java index e890acb36b48..9572154ec773 100644 --- a/telephony/java/android/telephony/TelephonyScanManager.java +++ b/telephony/java/android/telephony/TelephonyScanManager.java @@ -36,6 +36,7 @@ import com.android.telephony.Rlog; import java.util.Arrays; import java.util.List; +import java.util.Objects; import java.util.concurrent.Executor; /** @@ -152,16 +153,9 @@ public final class TelephonyScanManager { throw new RuntimeException( "Failed to find NetworkScanInfo with id " + message.arg2); } - NetworkScanCallback callback = nsi.mCallback; - Executor executor = nsi.mExecutor; - if (callback == null) { - throw new RuntimeException( - "Failed to find NetworkScanCallback with id " + message.arg2); - } - if (executor == null) { - throw new RuntimeException( - "Failed to find Executor with id " + message.arg2); - } + + final NetworkScanCallback callback = nsi.mCallback; + final Executor executor = nsi.mExecutor; switch (message.what) { case CALLBACK_RESTRICTED_SCAN_RESULTS: @@ -246,17 +240,24 @@ public final class TelephonyScanManager { NetworkScanRequest request, Executor executor, NetworkScanCallback callback, String callingPackage, @Nullable String callingFeatureId) { try { + Objects.requireNonNull(request, "Request was null"); + Objects.requireNonNull(callback, "Callback was null"); + Objects.requireNonNull(executor, "Executor was null"); final ITelephony telephony = getITelephony(); if (telephony == null) return null; - int scanId = telephony.requestNetworkScan( - subId, request, mMessenger, new Binder(), callingPackage, - callingFeatureId); - if (scanId == INVALID_SCAN_ID) { - Rlog.e(TAG, "Failed to initiate network scan"); - return null; - } + // The lock must be taken before calling requestNetworkScan because the resulting + // scanId can be invoked asynchronously on another thread at any time after + // requestNetworkScan invoked, leaving a critical section between that call and adding + // the record to the ScanInfo cache. synchronized (mScanInfo) { + int scanId = telephony.requestNetworkScan( + subId, request, mMessenger, new Binder(), callingPackage, + callingFeatureId); + if (scanId == INVALID_SCAN_ID) { + Rlog.e(TAG, "Failed to initiate network scan"); + return null; + } // We link to death whenever a scan is started to ensure that we are linked // at the point that phone process death might matter. // We never unlink because: |