[automerger skipped]Finalize STK call control strings
am: f1306727f4 -s ours
Change-Id: I958ece2c89eaa41ded3ff76c04ff9e21e7b0ce94
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d9219e7..d4e4926 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -144,6 +144,7 @@
<uses-permission android:name="com.android.smspush.WAPPUSH_MANAGER_BIND" />
<uses-permission android:name="android.permission.MANAGE_USERS" />
<uses-permission android:name="android.permission.UPDATE_APP_OPS_STATS" />
+ <uses-permission android:name="android.permission.MANAGE_APP_OPS_MODES" />
<uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" />
<uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
<uses-permission android:name="android.permission.READ_SEARCH_INDEXABLES" />
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
index dd47d6a..cce7ebc 100644
--- a/res/values-en-rCA/strings.xml
+++ b/res/values-en-rCA/strings.xml
@@ -176,16 +176,6 @@
<string name="preferred_network_mode_summary" msgid="1434820673166126609">"Change the network operating mode"</string>
<string name="preferred_network_mode_dialogtitle" msgid="4048082093347807230">"Preferred network type"</string>
<string name="forbidden_network" msgid="4384929668343563440">"(forbidden)"</string>
- <!-- no translation found for choose_network_title (4023911977543009350) -->
- <skip />
- <!-- no translation found for network_disconnected (2227251609006103194) -->
- <skip />
- <!-- no translation found for network_connected (1288589103624338857) -->
- <skip />
- <!-- no translation found for network_connecting (4927203097283533783) -->
- <skip />
- <!-- no translation found for network_could_not_connect (8254009365807767243) -->
- <skip />
<string-array name="preferred_network_mode_choices">
<item msgid="3628460389382468528">"GSM/WCDMA preferred"</item>
<item msgid="8442633436636425221">"GSM only"</item>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
index 5b45b64..097e36b 100644
--- a/res/values-en-rXC/strings.xml
+++ b/res/values-en-rXC/strings.xml
@@ -176,11 +176,6 @@
<string name="preferred_network_mode_summary" msgid="1434820673166126609">"Change the network operating mode"</string>
<string name="preferred_network_mode_dialogtitle" msgid="4048082093347807230">"Preferred network type"</string>
<string name="forbidden_network" msgid="4384929668343563440">"(forbidden)"</string>
- <string name="choose_network_title" msgid="4023911977543009350">"Choose network"</string>
- <string name="network_disconnected" msgid="2227251609006103194">"Disconnected"</string>
- <string name="network_connected" msgid="1288589103624338857">"Connected"</string>
- <string name="network_connecting" msgid="4927203097283533783">"Connecting..."</string>
- <string name="network_could_not_connect" msgid="8254009365807767243">"Couldn’t connect"</string>
<string-array name="preferred_network_mode_choices">
<item msgid="3628460389382468528">"GSM/WCDMA preferred"</item>
<item msgid="8442633436636425221">"GSM only"</item>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 1bef191..1a1c4f7 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -176,11 +176,6 @@
<string name="preferred_network_mode_summary" msgid="1434820673166126609">"Changer le mode de fonctionnement du réseau"</string>
<string name="preferred_network_mode_dialogtitle" msgid="4048082093347807230">"Type de réseau préféré"</string>
<string name="forbidden_network" msgid="4384929668343563440">"(interdit)"</string>
- <string name="choose_network_title" msgid="4023911977543009350">"Sélectionner un réseau"</string>
- <string name="network_disconnected" msgid="2227251609006103194">"Déconnecté"</string>
- <string name="network_connected" msgid="1288589103624338857">"Connecté"</string>
- <string name="network_connecting" msgid="4927203097283533783">"Connexion…"</string>
- <string name="network_could_not_connect" msgid="8254009365807767243">"Connexion impossible"</string>
<string-array name="preferred_network_mode_choices">
<item msgid="3628460389382468528">"GSM/WCDMA de préférence"</item>
<item msgid="8442633436636425221">"GSM uniquement"</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6e1f110..e32a6c5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -536,7 +536,9 @@
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
- <string name="roaming_reenable_message">You\'ve lost data connectivity because you left your home network with data roaming turned off.</string>
+ <string name="roaming_reenable_message">Data roaming is turned off. Tap to turn on.</string>
+ <!-- Roaming notification tile, notifying lost of roaming data connection -->
+ <string name="roaming_notification_title">Lost mobile data connection</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">You may incur significant charges.</string>
<!-- Mobile network settings screen, message asking the user to check their pricing with their Carrier, when enabling Data roaming. -->
@@ -1513,111 +1515,111 @@
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="clh_card_title_call_ended_txt">Call ended</string>
<!-- In-call screen: call failure reason (radio is off) -->
- <string name="clh_callFailed_powerOff_txt">Radio off</string>
+ <string name="clh_callFailed_powerOff_txt">Airplane mode is on</string>
<!-- In-call screen: call failure reason (SIM error) -->
- <string name="clh_callFailed_simError_txt">No SIM card or SIM card error</string>
+ <string name="clh_callFailed_simError_txt">Can\'t access SIM card</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="clh_incall_error_out_of_service_txt">Mobile network not available</string>
<!-- See CallFailCause for details on what causes each message -->
<!-- In-call screen: call failure reason (Cause Number 1) -->
- <string name="clh_callFailed_unassigned_number_txt">Unassigned (unallocated) number</string>
+ <string name="clh_callFailed_unassigned_number_txt">Issue with phone number you are trying to dial. Error code 1.</string>
<!-- In-call screen: call failure reason (Cause Number 3) -->
- <string name="clh_callFailed_no_route_to_destination_txt">No route to destination</string>
+ <string name="clh_callFailed_no_route_to_destination_txt">Couldn\'t complete call. Error code 3.</string>
<!-- In-call screen: call failure reason (Cause Number 6) -->
- <string name="clh_callFailed_channel_unacceptable_txt">Channel unacceptable</string>
+ <string name="clh_callFailed_channel_unacceptable_txt">Couldn\'t complete call. Error code 6.</string>
<!-- In-call screen: call failure reason (Cause Number 8) -->
- <string name="clh_callFailed_operator_determined_barring_txt">Operator determined barring</string>
+ <string name="clh_callFailed_operator_determined_barring_txt">Couldn\'t complete call. Error code 8.</string>
<!-- In-call screen: call failure reason (Cause Number 16) -->
- <string name="clh_callFailed_normal_call_clearing_txt">Normal call clearing</string>
+ <string name="clh_callFailed_normal_call_clearing_txt">Couldn\'t complete call. Error code 16.</string>
<!-- In-call screen: call failure reason (Cause Number 17) -->
<string name="clh_callFailed_user_busy_txt">User busy</string>
<!-- In-call screen: call failure reason (Cause Number 18) -->
- <string name="clh_callFailed_no_user_responding_txt">No user responding</string>
+ <string name="clh_callFailed_no_user_responding_txt">User not responding</string>
<!-- In-call screen: call failure reason (Cause Number 19) -->
- <string name="clh_callFailed_user_alerting_txt">User alerting, no answer</string>
+ <string name="clh_callFailed_user_alerting_txt">Couldn\'t complete call. Error code 19.</string>
<!-- In-call screen: call failure reason (Cause Number 21) -->
<string name="clh_callFailed_call_rejected_txt">Call rejected</string>
<!-- In-call screen: call failure reason (Cause Number 22) -->
<string name="clh_callFailed_number_changed_txt">Number changed</string>
<!-- In-call screen: call failure reason (Cause Number 25) -->
- <string name="clh_callFailed_pre_emption_txt">Pre-emption</string>
+ <string name="clh_callFailed_pre_emption_txt">Couldn\'t complete call. Error code 25.</string>
<!-- In-call screen: call failure reason (Cause Number 26) -->
- <string name="clh_callFailed_non_selected_user_clearing_txt">Non selected user clearing</string>
+ <string name="clh_callFailed_non_selected_user_clearing_txt">Couldn\'t complete call. Error code 26.</string>
<!-- In-call screen: call failure reason (Cause Number 27) -->
- <string name="clh_callFailed_destination_out_of_order_txt">Destination out of order</string>
+ <string name="clh_callFailed_destination_out_of_order_txt">Couldn\'t complete call. Error code 27.</string>
<!-- In-call screen: call failure reason (Cause Number 28) -->
<string name="clh_callFailed_invalid_number_format_txt">Invalid number format (incomplete number)</string>
<!-- In-call screen: call failure reason (Cause Number 29) -->
- <string name="clh_callFailed_facility_rejected_txt">Facility rejected</string>
+ <string name="clh_callFailed_facility_rejected_txt">Couldn\'t complete call. Error code 29.</string>
<!-- In-call screen: call failure reason (Cause Number 30) -->
- <string name="clh_callFailed_response_to_STATUS_ENQUIRY_txt">Response to STATUS ENQUIRY</string>
+ <string name="clh_callFailed_response_to_STATUS_ENQUIRY_txt">Couldn\'t complete call. Error code 30.</string>
<!-- In-call screen: call failure reason (Cause Number 31) -->
- <string name="clh_callFailed_normal_unspecified_txt">Normal, unspecified</string>
+ <string name="clh_callFailed_normal_unspecified_txt">Couldn\'t complete call. Error code 31.</string>
<!-- In-call screen: call failure reason (Cause Number 34) -->
- <string name="clh_callFailed_no_circuit_available_txt">No circuit/channel available</string>
+ <string name="clh_callFailed_no_circuit_available_txt">Couldn\'t complete call. Error code 34.</string>
<!-- In-call screen: call failure reason (Cause Number 38) -->
- <string name="clh_callFailed_network_out_of_order_txt">Network out of order</string>
+ <string name="clh_callFailed_network_out_of_order_txt">Couldn\'t complete call. Error code 38.</string>
<!-- In-call screen: call failure reason (Cause Number 41) -->
- <string name="clh_callFailed_temporary_failure_txt">Temporary failure</string>
+ <string name="clh_callFailed_temporary_failure_txt">Couldn\'t complete call. Error code 41.</string>
<!-- In-call screen: call failure reason (Cause Number 42) -->
- <string name="clh_callFailed_switching_equipment_congestion_txt">Switching equipment congestion</string>
+ <string name="clh_callFailed_switching_equipment_congestion_txt">Couldn\'t complete call. Error code 42.</string>
<!-- In-call screen: call failure reason (Cause Number 43) -->
- <string name="clh_callFailed_access_information_discarded_txt">Access information discarded</string>
+ <string name="clh_callFailed_access_information_discarded_txt">Couldn\'t complete call. Error code 43.</string>
<!-- In-call screen: call failure reason (Cause Number 44) -->
- <string name="clh_callFailed_requested_circuit_txt">Requested circuit/channel not available</string>
+ <string name="clh_callFailed_requested_circuit_txt">Couldn\'t complete call. Error code 44.</string>
<!-- In-call screen: call failure reason (Cause Number 47) -->
- <string name="clh_callFailed_resources_unavailable_unspecified_txt">Resources unavailable, unspecified</string>
+ <string name="clh_callFailed_resources_unavailable_unspecified_txt">Couldn\'t complete call. Error code 47.</string>
<!-- In-call screen: call failure reason (Cause Number 49) -->
- <string name="clh_callFailed_quality_of_service_unavailable_txt">Quality of service unavailable</string>
+ <string name="clh_callFailed_quality_of_service_unavailable_txt">Couldn\'t complete call. Error code 49.</string>
<!-- In-call screen: call failure reason (Cause Number 50) -->
- <string name="clh_callFailed_requested_facility_not_subscribed_txt">Requested facility not subscribed</string>
+ <string name="clh_callFailed_requested_facility_not_subscribed_txt">Couldn\'t complete call. Error code 50.</string>
<!-- In-call screen: call failure reason (Cause Number 55) -->
- <string name="clh_callFailed_incoming_calls_barred_within_the_CUG_txt">Incoming calls barred within the CUG</string>
+ <string name="clh_callFailed_incoming_calls_barred_within_the_CUG_txt">Couldn\'t complete call. Error code 55.</string>
<!-- In-call screen: call failure reason (Cause Number 57) -->
- <string name="clh_callFailed_bearer_capability_not_authorized_txt">Bearer capability not authorized</string>
+ <string name="clh_callFailed_bearer_capability_not_authorized_txt">Couldn\'t complete call. Error code 57.</string>
<!-- In-call screen: call failure reason (Cause Number 58) -->
- <string name="clh_callFailed_bearer_capability_not_presently_available_txt">Bearer capability not presently available</string>
+ <string name="clh_callFailed_bearer_capability_not_presently_available_txt">Couldn\'t complete call. Error code 58.</string>
<!-- In-call screen: call failure reason (Cause Number 63) -->
- <string name="clh_callFailed_service_or_option_not_available_unspecified_txt">Service or option not available, unspecified</string>
+ <string name="clh_callFailed_service_or_option_not_available_unspecified_txt">Couldn\'t complete call. Error code 63.</string>
<!-- In-call screen: call failure reason (Cause Number 65) -->
- <string name="clh_callFailed_bearer_service_not_implemented_txt">Bearer service not implemented</string>
+ <string name="clh_callFailed_bearer_service_not_implemented_txt">Couldn\'t complete call. Error code 65.</string>
<!-- In-call screen: call failure reason (Cause Number 68) -->
- <string name="clh_callFailed_ACM_equal_to_or_greater_than_ACMmax_txt">ACM equal to or greater than ACMmax</string>
+ <string name="clh_callFailed_ACM_equal_to_or_greater_than_ACMmax_txt">Couldn\'t complete call. Error code 68.</string>
<!-- In-call screen: call failure reason (Cause Number 69) -->
- <string name="clh_callFailed_requested_facility_not_implemented_txt">Requested facility not implemented</string>
+ <string name="clh_callFailed_requested_facility_not_implemented_txt">Couldn\'t complete call. Error code 69.</string>
<!-- In-call screen: call failure reason (Cause Number 70) -->
- <string name="clh_callFailed_only_restricted_digital_information_bearer_capability_is_available_txt">Only restricted digital information bearer capability is available</string>
+ <string name="clh_callFailed_only_restricted_digital_information_bearer_capability_is_available_txt">Couldn\'t complete call. Error code 70.</string>
<!-- In-call screen: call failure reason (Cause Number 79) -->
- <string name="clh_callFailed_service_or_option_not_implemented_unspecified_txt">Service or option not implemented, unspecified</string>
+ <string name="clh_callFailed_service_or_option_not_implemented_unspecified_txt">Couldn\'t complete call. Error code 79.</string>
<!-- In-call screen: call failure reason (Cause Number 81) -->
- <string name="clh_callFailed_invalid_transaction_identifier_value_txt">Invalid transaction identifier value</string>
+ <string name="clh_callFailed_invalid_transaction_identifier_value_txt">Couldn\'t complete call. Error code 81.</string>
<!-- In-call screen: call failure reason (Cause Number 87) -->
- <string name="clh_callFailed_user_not_member_of_CUG_txt">User not member of CUG</string>
+ <string name="clh_callFailed_user_not_member_of_CUG_txt">Couldn\'t complete call. Error code 87.</string>
<!-- In-call screen: call failure reason (Cause Number 88) -->
- <string name="clh_callFailed_incompatible_destination_txt">Incompatible destination</string>
+ <string name="clh_callFailed_incompatible_destination_txt">Couldn\'t complete call. Error code 88.</string>
<!-- In-call screen: call failure reason (Cause Number 91) -->
- <string name="clh_callFailed_invalid_transit_network_selection_txt">Invalid transit network selection</string>
+ <string name="clh_callFailed_invalid_transit_network_selection_txt">Couldn\'t complete call. Error code 91.</string>
<!-- In-call screen: call failure reason (Cause Number 95) -->
- <string name="clh_callFailed_semantically_incorrect_message_txt">Semantically incorrect message</string>
+ <string name="clh_callFailed_semantically_incorrect_message_txt">Couldn\'t complete call. Error code 95.</string>
<!-- In-call screen: call failure reason (Cause Number 96) -->
- <string name="clh_callFailed_invalid_mandatory_information_txt">Invalid mandatory information</string>
+ <string name="clh_callFailed_invalid_mandatory_information_txt">Couldn\'t complete call. Error code 96.</string>
<!-- In-call screen: call failure reason (Cause Number 97) -->
- <string name="clh_callFailed_message_type_non_existent_or_not_implemented_txt">Message type non-existent or not implemented</string>
+ <string name="clh_callFailed_message_type_non_existent_or_not_implemented_txt">Couldn\'t complete call. Error code 97.</string>
<!-- In-call screen: call failure reason (Cause Number 98) -->
- <string name="clh_callFailed_message_type_not_compatible_with_protocol_state_txt">Message type not compatible with protocol state</string>
+ <string name="clh_callFailed_message_type_not_compatible_with_protocol_state_txt">Couldn\'t complete call. Error code 98.</string>
<!-- In-call screen: call failure reason (Cause Number 99) -->
- <string name="clh_callFailed_information_element_non_existent_or_not_implemented_txt">Information element non-existent or not implemented</string>
+ <string name="clh_callFailed_information_element_non_existent_or_not_implemented_txt">Couldn\'t complete call. Error code 99.</string>
<!-- In-call screen: call failure reason (Cause Number 100) -->
- <string name="clh_callFailed_conditional_IE_error_txt">Conditional IE error</string>
+ <string name="clh_callFailed_conditional_IE_error_txt">Couldn\'t complete call. Error code 100.</string>
<!-- In-call screen: call failure reason (Cause Number 101) -->
- <string name="clh_callFailed_message_not_compatible_with_protocol_state_txt">Message not compatible with protocol state</string>
+ <string name="clh_callFailed_message_not_compatible_with_protocol_state_txt">Couldn\'t complete call. Error code 101.</string>
<!-- In-call screen: call failure reason (Cause Number 102) -->
- <string name="clh_callFailed_recovery_on_timer_expiry_txt">Recovery on timer expiry</string>
+ <string name="clh_callFailed_recovery_on_timer_expiry_txt">Couldn\'t complete call. Error code 102.</string>
<!-- In-call screen: call failure reason (Cause Number 111) -->
- <string name="clh_callFailed_protocol_Error_unspecified_txt">Protocol error, unspecified</string>
+ <string name="clh_callFailed_protocol_Error_unspecified_txt">Couldn\'t complete call. Error code 111.</string>
<!-- In-call screen: call failure reason (Cause Number 127) -->
- <string name="clh_callFailed_interworking_unspecified_txt">Interworking, unspecified</string>
+ <string name="clh_callFailed_interworking_unspecified_txt">Couldn\'t complete call. Error code 127.</string>
<!-- Call settings screen, setting option name -->
<string name="labelCallBarring">Call barring</string>
<!-- Call barring settings screen, setting summary text when a call barring option is activated -->
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 8b37a52..d482811 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -56,6 +56,7 @@
import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
+import com.android.internal.telephony.TelephonyPermissions;
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.IndentingPrintWriter;
@@ -786,12 +787,23 @@
@Override public
@NonNull
PersistableBundle getConfigForSubId(int subId) {
+ // TODO(b/73136824): Migrate to TelephonyPermissions#checkCallingOrSelfReadPhoneState.
try {
mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE, null);
// SKIP checking run-time READ_PHONE_STATE since using PRIVILEGED
} catch (SecurityException e) {
- mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, null);
+ try {
+ mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, null);
+ } catch (SecurityException securityException) {
+ // If we don't have the runtime permission, but do have carrier privileges, that
+ // suffices for reading phone state.
+ if (!SubscriptionManager.isValidSubscriptionId(subId)) {
+ throw securityException;
+ }
+ TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(subId, null);
+ }
}
+
int phoneId = SubscriptionManager.getPhoneId(subId);
PersistableBundle retConfig = CarrierConfigManager.getDefaultConfig();
if (SubscriptionManager.isValidPhoneId(phoneId)) {
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 3a32e50..2a4cced 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -251,6 +251,8 @@
//Information that needs to save into Bundle.
private static final String EXPAND_ADVANCED_FIELDS = "expand_advanced_fields";
+ //Intent extra to indicate expand all fields.
+ private static final String EXPAND_EXTRA = "expandable";
private SubscriptionManager mSubscriptionManager;
private TelephonyManager mTelephonyManager;
@@ -700,6 +702,8 @@
if (icicle != null) {
mExpandAdvancedFields = icicle.getBoolean(EXPAND_ADVANCED_FIELDS, false);
+ } else if (getActivity().getIntent().getBooleanExtra(EXPAND_EXTRA, false)) {
+ mExpandAdvancedFields = true;
}
bindNetworkQueryService();
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 219552a..4e69d34 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -542,7 +542,7 @@
final Notification.Builder builder = new Notification.Builder(mContext)
.setSmallIcon(android.R.drawable.stat_sys_warning)
- .setContentTitle(mContext.getText(R.string.roaming))
+ .setContentTitle(mContext.getText(R.string.roaming_notification_title))
.setColor(mContext.getResources().getColor(R.color.dialer_theme_color))
.setContentText(contentText)
.setChannel(NotificationChannelController.CHANNEL_ID_MOBILE_DATA_STATUS)
@@ -616,24 +616,37 @@
PhoneFactory.getPhone(phoneId) : PhoneFactory.getDefaultPhone();
if (TelephonyCapabilities.supportsNetworkSelection(phone)) {
if (SubscriptionManager.isValidSubscriptionId(subId)) {
- // get the shared preference of network_selection.
- // empty is auto mode, otherwise it is the operator alpha name
- // in case there is no operator name, check the operator numeric
- SharedPreferences sp =
- PreferenceManager.getDefaultSharedPreferences(mContext);
- String networkSelection =
- sp.getString(Phone.NETWORK_SELECTION_NAME_KEY + subId, "");
- if (TextUtils.isEmpty(networkSelection)) {
- networkSelection =
- sp.getString(Phone.NETWORK_SELECTION_KEY + subId, "");
+ // if restoring manual selection is controlled by framework, then get network
+ // selection from shared preference, otherwise get from real network indicators.
+ boolean restoreSelection = !mContext.getResources().getBoolean(
+ com.android.internal.R.bool.skip_restoring_network_selection);
+ String selectedNetworkOperatorName;
+ boolean isManualSelection;
+ if (restoreSelection) {
+ SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
+ selectedNetworkOperatorName =
+ sp.getString(Phone.NETWORK_SELECTION_NAME_KEY + subId, "");
+ // get the shared preference of network_selection.
+ // empty is auto mode, otherwise it is the operator alpha name
+ // in case there is no operator name, check the operator numeric
+ if (TextUtils.isEmpty(selectedNetworkOperatorName)) {
+ selectedNetworkOperatorName =
+ sp.getString(Phone.NETWORK_SELECTION_KEY + subId, "");
+ }
+ isManualSelection = !TextUtils.isEmpty(selectedNetworkOperatorName);
+ } else {
+ selectedNetworkOperatorName = phone.getServiceStateTracker().mSS
+ .getOperatorAlpha();
+ isManualSelection = phone.getServiceStateTracker().mSS.getIsManualSelection();
}
- if (DBG) log("updateNetworkSelection()..." + "state = " +
- serviceState + " new network " + networkSelection);
+ if (DBG) {
+ log("updateNetworkSelection()..." + "state = " + serviceState + " new network "
+ + (isManualSelection ? selectedNetworkOperatorName : ""));
+ }
- if (serviceState == ServiceState.STATE_OUT_OF_SERVICE
- && !TextUtils.isEmpty(networkSelection)) {
- showNetworkSelection(networkSelection, subId);
+ if (serviceState == ServiceState.STATE_OUT_OF_SERVICE && isManualSelection) {
+ showNetworkSelection(selectedNetworkOperatorName, subId);
mSelectedUnavailableNotify = true;
} else {
if (mSelectedUnavailableNotify) {
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 183aa57..ff6ec34 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -42,6 +42,7 @@
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ServiceManager;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.WorkSource;
@@ -196,6 +197,10 @@
private static final int SELECT_P2 = 0;
private static final int SELECT_P3 = 0x10;
+ private static final String DEFAULT_NETWORK_MODE_PROPERTY_NAME = "ro.telephony.default_network";
+ private static final String DEFAULT_DATA_ROAMING_PROPERTY_NAME = "ro.com.android.dataroaming";
+ private static final String DEFAULT_MOBILE_DATA_PROPERTY_NAME = "ro.com.android.mobiledata";
+
/** The singleton instance. */
private static PhoneInterfaceManager sInstance;
@@ -1264,7 +1269,7 @@
@Override
public boolean isOffhookForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "isOffhookForSubscriber")) {
+ mApp, subId, callingPackage, "isOffhookForSubscriber")) {
return false;
}
@@ -1284,7 +1289,7 @@
@Override
public boolean isRingingForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "isRingingForSubscriber")) {
+ mApp, subId, callingPackage, "isRingingForSubscriber")) {
return false;
}
@@ -1304,7 +1309,7 @@
@Override
public boolean isIdleForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "isIdleForSubscriber")) {
+ mApp, subId, callingPackage, "isIdleForSubscriber")) {
return false;
}
@@ -1480,7 +1485,7 @@
@Override
public boolean isRadioOnForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "isRadioOnForSubscriber")) {
+ mApp, subId, callingPackage, "isRadioOnForSubscriber")) {
return false;
}
return isRadioOnForSubscriber(subId);
@@ -1793,32 +1798,44 @@
@Override
public String getImeiForSlot(int slotIndex, String callingPackage) {
- if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getImeiForSlot")) {
+ Phone phone = PhoneFactory.getPhone(slotIndex);
+ if (phone == null) {
return null;
}
- Phone phone = PhoneFactory.getPhone(slotIndex);
- return phone == null ? null : phone.getImei();
+ int subId = phone.getSubId();
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, "getImeiForSlot")) {
+ return null;
+ }
+ return phone.getImei();
}
@Override
public String getMeidForSlot(int slotIndex, String callingPackage) {
- if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getMeidForSlot")) {
+ Phone phone = PhoneFactory.getPhone(slotIndex);
+ if (phone == null) {
return null;
}
- Phone phone = PhoneFactory.getPhone(slotIndex);
- return phone == null ? null : phone.getMeid();
+ int subId = phone.getSubId();
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, "getMeidForSlot")) {
+ return null;
+ }
+ return phone.getMeid();
}
@Override
public String getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage) {
- if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getDeviceSoftwareVersionForSlot")) {
+ Phone phone = PhoneFactory.getPhone(slotIndex);
+ if (phone == null) {
return null;
}
- Phone phone = PhoneFactory.getPhone(slotIndex);
- return phone == null ? null : phone.getDeviceSvn();
+ int subId = phone.getSubId();
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, "getDeviceSoftwareVersionForSlot")) {
+ return null;
+ }
+ return phone.getDeviceSvn();
}
@Override
@@ -1907,7 +1924,7 @@
@Override
public int getCdmaEriIconIndexForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getCdmaEriIconIndexForSubscriber")) {
+ mApp, subId, callingPackage, "getCdmaEriIconIndexForSubscriber")) {
return -1;
}
final Phone phone = getPhone(subId);
@@ -1931,7 +1948,7 @@
@Override
public int getCdmaEriIconModeForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getCdmaEriIconModeForSubscriber")) {
+ mApp, subId, callingPackage, "getCdmaEriIconModeForSubscriber")) {
return -1;
}
final Phone phone = getPhone(subId);
@@ -1953,7 +1970,7 @@
@Override
public String getCdmaEriTextForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getCdmaEriIconTextForSubscriber")) {
+ mApp, subId, callingPackage, "getCdmaEriIconTextForSubscriber")) {
return null;
}
final Phone phone = getPhone(subId);
@@ -2030,10 +2047,16 @@
public String getVisualVoicemailPackageName(String callingPackage, int subId) {
mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getVisualVoicemailPackageName")) {
+ mApp, subId, callingPackage, "getVisualVoicemailPackageName")) {
return null;
}
- return RemoteVvmTaskManager.getRemotePackage(mPhone.getContext(), subId).getPackageName();
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return RemoteVvmTaskManager
+ .getRemotePackage(mPhone.getContext(), subId).getPackageName();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
@Override
@@ -2215,7 +2238,7 @@
@Override
public int getNetworkTypeForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getNetworkTypeForSubscriber")) {
+ mApp, subId, callingPackage, "getNetworkTypeForSubscriber")) {
return TelephonyManager.NETWORK_TYPE_UNKNOWN;
}
@@ -2241,7 +2264,7 @@
@Override
public int getDataNetworkTypeForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getDataNetworkTypeForSubscriber")) {
+ mApp, subId, callingPackage, "getDataNetworkTypeForSubscriber")) {
return TelephonyManager.NETWORK_TYPE_UNKNOWN;
}
@@ -2259,7 +2282,7 @@
@Override
public int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getDataNetworkTypeForSubscriber")) {
+ mApp, subId, callingPackage, "getDataNetworkTypeForSubscriber")) {
return TelephonyManager.NETWORK_TYPE_UNKNOWN;
}
@@ -2310,7 +2333,7 @@
@Override
public int getLteOnCdmaModeForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getLteOnCdmaModeForSubscriber")) {
+ mApp, subId, callingPackage, "getLteOnCdmaModeForSubscriber")) {
return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
}
@@ -2508,9 +2531,11 @@
* Get the forbidden PLMN List from the given app type (ex APPTYPE_USIM)
* on a particular subscription
*/
- public String[] getForbiddenPlmns(int subId, int appType) {
- mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,
- "Requires READ_PHONE_STATE");
+ public String[] getForbiddenPlmns(int subId, int appType, String callingPackage) {
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, "getForbiddenPlmns")) {
+ return null;
+ }
if (appType != TelephonyManager.APPTYPE_USIM && appType != TelephonyManager.APPTYPE_SIM) {
loge("getForbiddenPlmnList(): App Type must be USIM or SIM");
return null;
@@ -2611,18 +2636,9 @@
return success;
}
- /**
- * {@hide}
- * Returns Default sim, 0 in the case of single standby.
- */
- public int getDefaultSim() {
- //TODO Need to get it from Telephony Devcontroller
- return 0;
- }
-
public String[] getPcscfAddress(String apnType, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getPcscfAddress")) {
+ mApp, mPhone.getSubId(), callingPackage, "getPcscfAddress")) {
return new String[0];
}
@@ -2689,11 +2705,12 @@
}
/**
- * @return true if emergency calling is available on IMS, false if it should fallback to CS.
+ * @return true if the IMS resolver is busy resolving a binding and should not be considered
+ * available, false if the IMS resolver is idle.
*/
- public boolean isEmergencyMmTelAvailable(int slotId) {
+ public boolean isResolvingImsBinding() {
enforceModifyPermission();
- return PhoneFactory.getImsResolver().isEmergencyMmTelAvailable(slotId);
+ return PhoneFactory.getImsResolver().isResolvingBinding();
}
public void setImsRegistrationState(boolean registered) {
@@ -2784,7 +2801,7 @@
@Override
public int getCalculatedPreferredNetworkType(String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getCalculatedPreferredNetworkType")) {
+ mApp, mPhone.getSubId(), callingPackage, "getCalculatedPreferredNetworkType")) {
return RILConstants.PREFERRED_NETWORK_MODE;
}
@@ -3129,7 +3146,7 @@
public String getLine1NumberForDisplay(int subId, String callingPackage) {
// This is open to apps with WRITE_SMS.
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
- mApp, callingPackage, "getLine1NumberForDisplay")) {
+ mApp, subId, callingPackage, "getLine1NumberForDisplay")) {
if (DBG_MERGE) log("getLine1NumberForDisplay returning null due to permission");
return null;
}
@@ -3150,7 +3167,7 @@
@Override
public String getLine1AlphaTagForDisplay(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getLine1AlphaTagForDisplay")) {
+ mApp, subId, callingPackage, "getLine1AlphaTagForDisplay")) {
return null;
}
@@ -3164,8 +3181,11 @@
@Override
public String[] getMergedSubscriberIds(String callingPackage) {
+ // This API isn't public, so no need to provide a valid subscription ID - we're not worried
+ // about carrier-privileged callers not having access.
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getMergedSubscriberIds")) {
+ mApp, SubscriptionManager.INVALID_SUBSCRIPTION_ID, callingPackage,
+ "getMergedSubscriberIds")) {
return null;
}
final Context context = mPhone.getContext();
@@ -3268,8 +3288,13 @@
@Override
public int getRadioAccessFamily(int phoneId, String callingPackage) {
+ Phone phone = PhoneFactory.getPhone(phoneId);
+ if (phone == null) {
+ return RadioAccessFamily.RAF_UNKNOWN;
+ }
+ int subId = phone.getSubId();
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getRadioAccessFamily")) {
+ mApp, subId, callingPackage, "getRadioAccessFamily")) {
return RadioAccessFamily.RAF_UNKNOWN;
}
@@ -3285,7 +3310,7 @@
@Override
public boolean isVideoCallingEnabled(String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "isVideoCallingEnabled")) {
+ mApp, mPhone.getSubId(), callingPackage, "isVideoCallingEnabled")) {
return false;
}
@@ -3339,17 +3364,16 @@
*/
@Override
public String getDeviceId(String callingPackage) {
- if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getDeviceId")) {
- return null;
- }
-
final Phone phone = PhoneFactory.getPhone(0);
- if (phone != null) {
- return phone.getDeviceId();
- } else {
+ if (phone == null) {
return null;
}
+ int subId = phone.getSubId();
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, "getDeviceId")) {
+ return null;
+ }
+ return phone.getDeviceId();
}
/**
@@ -3432,15 +3456,10 @@
try {
if (SubscriptionManager.isUsableSubIdValue(subId) && !mUserManager.hasUserRestriction(
UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS)) {
- // Enable data
- setUserDataEnabled(subId, true);
- // Set network selection mode to automatic
+ setUserDataEnabled(subId, getDefaultDataEnabled());
setNetworkSelectionModeAutomatic(subId);
- // Set preferred mobile network type to the best available
- setPreferredNetworkType(subId, Phone.PREFERRED_NT_MODE);
- // Turn off roaming
- mPhone.setDataRoamingEnabled(false);
- // Remove IMSI encryption keys from Carrier DB.
+ setPreferredNetworkType(subId, getDefaultNetworkType(subId));
+ mPhone.setDataRoamingEnabled(getDefaultDataRoamingEnabled(subId));
CarrierInfoManager.deleteAllCarrierKeysForImsiEncryption(mPhone.getContext());
}
} finally {
@@ -3584,7 +3603,7 @@
public ServiceState getServiceStateForSubscriber(int subId, String callingPackage) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getServiceStateForSubscriber")) {
+ mApp, subId, callingPackage, "getServiceStateForSubscriber")) {
return null;
}
@@ -3970,7 +3989,7 @@
@Override
public List<ClientRequestStats> getClientRequestStats(String callingPackage, int subId) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, callingPackage, "getClientRequestStats")) {
+ mApp, subId, callingPackage, "getClientRequestStats")) {
return null;
}
@@ -4087,7 +4106,12 @@
}
infos[i] = new UiccSlotInfo(
- slot.isActive(), slot.isEuicc(), cardId, cardState, slot.getPhoneId());
+ slot.isActive(),
+ slot.isEuicc(),
+ cardId,
+ cardState,
+ slot.getPhoneId(),
+ slot.isExtendedApduSupported());
}
return infos;
}
@@ -4109,4 +4133,39 @@
phone.setRadioIndicationUpdateMode(filters, mode);
}
+
+ /**
+ * Returns false if the mobile data is disabled by default, otherwise return true.
+ */
+ private boolean getDefaultDataEnabled() {
+ return "true".equalsIgnoreCase(
+ SystemProperties.get(DEFAULT_MOBILE_DATA_PROPERTY_NAME, "true"));
+ }
+
+ /**
+ * Returns true if the data roaming is enabled by default, i.e the system property
+ * of {@link #DEFAULT_DATA_ROAMING_PROPERTY_NAME} is true or the config of
+ * {@link CarrierConfigManager#KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL} is true.
+ */
+ private boolean getDefaultDataRoamingEnabled(int subId) {
+ final CarrierConfigManager configMgr = (CarrierConfigManager)
+ mPhone.getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
+ boolean isDataRoamingEnabled = "true".equalsIgnoreCase(
+ SystemProperties.get(DEFAULT_DATA_ROAMING_PROPERTY_NAME, "false"));
+ isDataRoamingEnabled |= configMgr.getConfigForSubId(subId).getBoolean(
+ CarrierConfigManager.KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL);
+ return isDataRoamingEnabled;
+ }
+
+ /**
+ * Returns the default network type for the given {@code subId}, if the default network type is
+ * not set, return {@link Phone#PREFERRED_NT_MODE}.
+ */
+ private int getDefaultNetworkType(int subId) {
+ return Integer.parseInt(
+ TelephonyManager.getTelephonyProperty(
+ mSubscriptionController.getPhoneId(subId),
+ DEFAULT_NETWORK_MODE_PROPERTY_NAME,
+ String.valueOf(Phone.PREFERRED_NT_MODE)));
+ }
}
diff --git a/src/com/android/phone/PhoneSearchIndexablesProvider.java b/src/com/android/phone/PhoneSearchIndexablesProvider.java
index b7f6738..ee79f92 100644
--- a/src/com/android/phone/PhoneSearchIndexablesProvider.java
+++ b/src/com/android/phone/PhoneSearchIndexablesProvider.java
@@ -103,8 +103,7 @@
if (!mUserManager.isAdminUser()) {
final String[] values = new String[]{"preferred_network_mode_key",
- "button_roaming_key",
- "cdma_lte_data_service_key", "enabled_networks_key", "enhanced_4g_lte",
+ "button_roaming_key", "cdma_lte_data_service_key", "enhanced_4g_lte",
"button_apn_key", "button_carrier_sel_key", "carrier_settings_key",
"cdma_system_select_key", "esim_list_profile", "mobile_data_enable",
"data_usage_summary", "wifi_calling_key", "video_calling_key"};
@@ -119,6 +118,12 @@
cursor.addRow(createNonIndexableRow("enhanced_4g_lte" /* key */));
}
}
+
+ // enabled_networks button and preferred_network_mode button share the same title
+ // "Preferred network type"and are mutual exclusive. Thus we remove one from search
+ // result to avoid duplicate search result.
+ // TODO: b/63381516 all hidden buttons should dynamically be removed from search result.
+ cursor.addRow(createNonIndexableRow("enabled_networks_key" /* key */));
cursor.addRow(createNonIndexableRow("carrier_settings_euicc_key" /* key */));
cursor.addRow(createNonIndexableRow("advanced_options" /* key */));
return cursor;
diff --git a/src/com/android/phone/vvm/RemoteVvmTaskManager.java b/src/com/android/phone/vvm/RemoteVvmTaskManager.java
index 3a18c7e..98cb959 100644
--- a/src/com/android/phone/vvm/RemoteVvmTaskManager.java
+++ b/src/com/android/phone/vvm/RemoteVvmTaskManager.java
@@ -139,6 +139,8 @@
TelecomManager telecomManager = context.getSystemService(TelecomManager.class);
List<String> packages = new ArrayList<>();
packages.add(telecomManager.getDefaultDialerPackage());
+ // TODO(b/73136824): Check permissions in the calling function and avoid relying on the
+ // binder caller's permissions to access the carrier config.
PersistableBundle carrierConfig = context
.getSystemService(CarrierConfigManager.class).getConfigForSubId(subId);
packages.add(
diff --git a/src/com/android/services/telephony/ImsConference.java b/src/com/android/services/telephony/ImsConference.java
index c62a7f1..e69bfd0 100644
--- a/src/com/android/services/telephony/ImsConference.java
+++ b/src/com/android/services/telephony/ImsConference.java
@@ -777,7 +777,8 @@
participant.removeConnectionListener(mParticipantListener);
synchronized(mUpdateSyncRoot) {
- mConferenceParticipantConnections.remove(participant.getUserEntity());
+ mConferenceParticipantConnections.remove(new Pair<>(participant.getUserEntity(),
+ participant.getEndpoint()));
}
mTelephonyConnectionService.removeConnection(participant);
}
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 9813ad4..f9aeb7a 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -740,6 +740,9 @@
return;
}
+ Log.i(this, "Setting RTT stream on ImsPhoneConnection in case we need it later");
+ imsOriginalConnection.setCurrentRttTextStream(request.getRttTextStream());
+
if (!imsOriginalConnection.isRttEnabledForCall()) {
if (request.isRequestingRtt()) {
Log.w(this, "Incoming call processed as RTT but did not come in as one. Ignoring");
@@ -747,8 +750,7 @@
return;
}
- Log.i(this, "Setting RTT stream on ImsPhoneConnection");
- imsOriginalConnection.setCurrentRttTextStream(request.getRttTextStream());
+ Log.i(this, "Setting the call to be answered with RTT on.");
imsOriginalConnection.getImsCall().setAnswerWithRtt();
}
diff --git a/testapps/ImsTestService/AndroidManifest.xml b/testapps/ImsTestService/AndroidManifest.xml
index 4d81ffd..f47210e 100644
--- a/testapps/ImsTestService/AndroidManifest.xml
+++ b/testapps/ImsTestService/AndroidManifest.xml
@@ -40,9 +40,8 @@
android:enabled="true"
android:persistent="true"
android:permission="android.permission.BIND_IMS_SERVICE">
- <meta-data android:name="android.telephony.ims.MMTEL_FEATURE" android:value="true"/>
- <!--meta-data android:name="android.telephony.ims.EMERGENCY_MMTEL_FEATURE"
- android:value="true" /-->
+ <!--meta-data android:name="android.telephony.ims.MMTEL_FEATURE" android:value="true"/-->
+ <!-- No features means we will get queried for dynamic config. -->
<intent-filter>
<action android:name="android.telephony.ims.ImsService" />
</intent-filter>
diff --git a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsConfigImpl.java b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsConfigImpl.java
index 4b8842a..3269a5a 100644
--- a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsConfigImpl.java
+++ b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsConfigImpl.java
@@ -55,6 +55,10 @@
return sTestImsConfigImpl;
}
+ private TestImsConfigImpl() {
+ super();
+ }
+
public void setConfigListener(ImsConfigListener listener) {
mListener = listener;
}
diff --git a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsService.java b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsService.java
index 434cdb5..71323d8 100644
--- a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsService.java
+++ b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/TestImsService.java
@@ -17,9 +17,11 @@
package com.android.phone.testapps.imstestapp;
import android.telephony.ims.ImsService;
+import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.feature.RcsFeature;
import android.telephony.ims.stub.ImsConfigImplBase;
+import android.telephony.ims.stub.ImsFeatureConfiguration;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.util.Log;
@@ -54,8 +56,16 @@
}
@Override
+ public ImsFeatureConfiguration querySupportedImsFeatures() {
+ return new ImsFeatureConfiguration.Builder()
+ .addFeature(0, ImsFeature.FEATURE_EMERGENCY_MMTEL)
+ .addFeature(0, ImsFeature.FEATURE_MMTEL)
+ .build();
+ }
+
+ @Override
public MmTelFeature createMmTelFeature(int slotId) {
- Log.i(LOG_TAG, "TestImsService: onCreateEmergencyMMTelImsFeature");
+ Log.i(LOG_TAG, "TestImsService: onCreateMmTelImsFeature");
return mTestMmTelFeature;
}
diff --git a/tests/AndroidTest.xml b/tests/AndroidTest.xml
index e63215a..d078d7c 100644
--- a/tests/AndroidTest.xml
+++ b/tests/AndroidTest.xml
@@ -14,11 +14,13 @@
limitations under the License.
-->
<configuration description="Run Phone application tests.">
- <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-instrumentation" />
+ <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+ <option name="cleanup-apks" value="true" />
<option name="test-file-name" value="TeleServiceTests.apk" />
</target_preparer>
- <option name="test-suite-tag" value="apct" />
<option name="test-tag" value="TeleServiceTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.phone.tests" />
diff --git a/tests/src/com/android/phone/PhoneSearchIndexablesProviderTest.java b/tests/src/com/android/phone/PhoneSearchIndexablesProviderTest.java
index 2176d6b..6b7f825 100644
--- a/tests/src/com/android/phone/PhoneSearchIndexablesProviderTest.java
+++ b/tests/src/com/android/phone/PhoneSearchIndexablesProviderTest.java
@@ -124,16 +124,16 @@
when(mUserManager.isAdminUser()).thenReturn(true);
Cursor cursor2 = mProvider
.queryNonIndexableKeys(SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS);
- assertThat(cursor2.getCount()).isEqualTo(2);
+ assertThat(cursor2.getCount()).isEqualTo(3);
mProvider.setIsEuiccSettingsHidden(true /* isEuiccSettingsHidden */);
Cursor cursor3 = mProvider
.queryNonIndexableKeys(SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS);
- assertThat(cursor3.getCount()).isEqualTo(3);
+ assertThat(cursor3.getCount()).isEqualTo(4);
mProvider.setIsEnhanced4gLteHidden(true /* isEnhanced4gLteHidden */);
Cursor cursor4 = mProvider
.queryNonIndexableKeys(SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS);
- assertThat(cursor4.getCount()).isEqualTo(4);
+ assertThat(cursor4.getCount()).isEqualTo(5);
}
}