[automerged blank] Import translations. DO NOT MERGE ANYWHERE 2p: a47dc67c66
Blank merge reason: commit message contains skip directive
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telephony/+/16938771
Change-Id: I2aa450ea79b905055b723d2e60ab07d313cf8b4a
diff --git a/OWNERS b/OWNERS
index 1ea2d9e..b4ef543 100644
--- a/OWNERS
+++ b/OWNERS
@@ -6,12 +6,12 @@
tgunn@google.com
jminjie@google.com
shuoq@google.com
-nazaninb@google.com
sarahchin@google.com
xiaotonj@google.com
huiwang@google.com
jayachandranc@google.com
chinmayd@google.com
amruthr@google.com
+sasindran@google.com
per-file *SimPhonebookProvider* = file:platform/packages/apps/Contacts:/OWNERS
diff --git a/res/values-b+sr+Latn/strings.xml b/res/values-b+sr+Latn/strings.xml
index d56f319..bf39f18 100644
--- a/res/values-b+sr+Latn/strings.xml
+++ b/res/values-b+sr+Latn/strings.xml
@@ -615,7 +615,7 @@
<string name="ota_title_activate" msgid="4049645324841263423">"Aktivirajte telefon"</string>
<string name="ota_touch_activate" msgid="838764494319694754">"Potrebno je da uputite poseban poziv da biste aktivirali uslugu svoj telefona. \n\nNakon što pritisnete dugme „Aktiviraj“, slušajte data uputstva da biste da biste aktivirali svoj telefon."</string>
<string name="ota_hfa_activation_title" msgid="3300556778212729671">"Aktiviranje..."</string>
- <string name="ota_hfa_activation_dialog_message" msgid="7921718445773342996">"Telefon aktivira uslugu mobilnih podataka.\n\nTo može da potraje i do 5 minuta."</string>
+ <string name="ota_hfa_activation_dialog_message" msgid="7921718445773342996">"Telefon aktivira uslugu mobilnog prenosa podataka.\n\nTo može da potraje i do 5 minuta."</string>
<string name="ota_skip_activation_dialog_title" msgid="7666611236789203797">"Želite li da preskočite aktivaciju?"</string>
<string name="ota_skip_activation_dialog_message" msgid="6691722887019708713">"Ako preskočite aktivaciju, ne možete da upućujete pozive ili da se povezujete sa mrežama za mobilni prenos podataka (iako možete da se povežete sa WiFi mrežama). Sve dok ne aktivirate svoj telefon, bićete upitani da to učinite svaki put kada ga uključite."</string>
<string name="ota_skip_activation_dialog_skip_label" msgid="5908029466817825633">"Preskoči"</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 7e62fee..6d65ce7 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -44,10 +44,10 @@
<string name="pause_prompt_yes" msgid="8184132073048369575">"はい"</string>
<string name="pause_prompt_no" msgid="2145264674774138579">"いいえ"</string>
<string name="wild_prompt_str" msgid="5858910969703305375">"ワイルド文字を置換:"</string>
- <string name="no_vm_number" msgid="6623853880546176930">"留守番電話の番号がありません"</string>
- <string name="no_vm_number_msg" msgid="5165161462411372504">"SIMカードに留守番電話の番号がありません。"</string>
+ <string name="no_vm_number" msgid="6623853880546176930">"ボイスメール番号がありません"</string>
+ <string name="no_vm_number_msg" msgid="5165161462411372504">"SIMカードにボイスメールの番号がありません。"</string>
<string name="add_vm_number_str" msgid="7368168964435881637">"番号を追加"</string>
- <string name="voice_number_setting_primary_user_only" msgid="3394706575741912843">"留守番電話の設定を変更できるのはメインユーザーのみに限られています。"</string>
+ <string name="voice_number_setting_primary_user_only" msgid="3394706575741912843">"ボイスメール設定を変更できるのはメインユーザーのみに限られています。"</string>
<string name="puk_unlocked" msgid="4627340655215746511">"SIMカードロックを解除しました。デバイスのロックを解除しています..."</string>
<string name="label_ndp" msgid="7617392683877410341">"SIM のネットワーク ロック解除 PIN"</string>
<string name="label_phoneid" msgid="8775611434123577808">"携帯通信会社の SIM ロックがかかっています"</string>
@@ -77,8 +77,8 @@
<string name="phone_accounts_all_calling_accounts_summary" msgid="2214134955430107240">"通話できるアカウントを選択"</string>
<string name="wifi_calling" msgid="3650509202851355742">"Wi-Fi 通話"</string>
<string name="connection_service_default_label" msgid="7332739049855715584">"組み込みの接続サービス"</string>
- <string name="voicemail" msgid="7697769412804195032">"留守番電話"</string>
- <string name="voicemail_settings_with_label" msgid="4228431668214894138">"留守番電話(<xliff:g id="SUBSCRIPTIONLABEL">%s</xliff:g>)"</string>
+ <string name="voicemail" msgid="7697769412804195032">"ボイスメール"</string>
+ <string name="voicemail_settings_with_label" msgid="4228431668214894138">"ボイスメール(<xliff:g id="SUBSCRIPTIONLABEL">%s</xliff:g>)"</string>
<string name="voicemail_abbreviated" msgid="7746778673131551185">"VM:"</string>
<string name="make_and_receive_calls" msgid="4868913166494621109">"通話の発着と着信"</string>
<string name="smart_forwarding_settings_menu" msgid="8850429887958938540">"スマート転送"</string>
@@ -155,12 +155,12 @@
<item msgid="6813323051965618926">"番号を非通知"</item>
<item msgid="9150034130629852635">"番号を通知"</item>
</string-array>
- <string name="vm_changed" msgid="4739599044379692505">"留守番電話の番号が変更されました。"</string>
+ <string name="vm_changed" msgid="4739599044379692505">"ボイスメールの番号が変更されました。"</string>
<string name="vm_change_failed" msgid="7877733929455763566">"ボイスメール番号を変更できませんでした。\nこの問題が続くようであれば携帯通信会社にお問い合わせください。"</string>
<string name="fw_change_failed" msgid="9179241823460192148">"転送番号を変更できませんでした。\nこの問題が続くようであれば携帯通信会社にお問い合わせください。"</string>
<string name="fw_get_in_vm_failed" msgid="2432678237218183844">"現在の転送先番号設定の取得と保存ができませんでした。\nかまわず新しい携帯通信会社に切り替えますか?"</string>
<string name="no_change" msgid="3737264882821031892">"変更されていません。"</string>
- <string name="sum_voicemail_choose_provider" msgid="6750824719081403773">"留守番電話サービスを選択"</string>
+ <string name="sum_voicemail_choose_provider" msgid="6750824719081403773">"ボイスメールサービスを選択"</string>
<string name="voicemail_default" msgid="6427575113775462077">"携帯通信会社"</string>
<string name="vm_change_pin_old_pin" msgid="7154951790929009241">"古い PIN"</string>
<string name="vm_change_pin_new_pin" msgid="2656200418481288069">"新しい PIN"</string>
@@ -519,7 +519,7 @@
<string name="pin2_unblocked" msgid="4481107908727789303">"PIN2はブロックされなくなりました"</string>
<string name="pin2_error_exception" msgid="8116103864600823641">"ネットワークまたはSIMカードのエラー"</string>
<string name="doneButton" msgid="7371209609238460207">"完了"</string>
- <string name="voicemail_settings_number_label" msgid="1265118640154688162">"留守番電話の番号"</string>
+ <string name="voicemail_settings_number_label" msgid="1265118640154688162">"ボイスメールの番号"</string>
<string name="card_title_dialing" msgid="8742182654254431781">"発信中"</string>
<string name="card_title_redialing" msgid="18130232613559964">"リダイヤル中"</string>
<string name="card_title_conf_call" msgid="901197309274457427">"グループ通話"</string>
@@ -528,10 +528,10 @@
<string name="card_title_on_hold" msgid="9028319436626975207">"保留中"</string>
<string name="card_title_hanging_up" msgid="814874106866647871">"通話終了"</string>
<string name="card_title_in_call" msgid="8231896539567594265">"着信"</string>
- <string name="notification_voicemail_title" msgid="3932876181831601351">"新しい留守番電話"</string>
- <string name="notification_voicemail_title_count" msgid="2806950319222327082">"新しい留守番電話(<xliff:g id="COUNT">%d</xliff:g>)"</string>
+ <string name="notification_voicemail_title" msgid="3932876181831601351">"新しいボイスメール"</string>
+ <string name="notification_voicemail_title_count" msgid="2806950319222327082">"新しいボイスメール(<xliff:g id="COUNT">%d</xliff:g>)"</string>
<string name="notification_voicemail_text_format" msgid="5720947141702312537">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>にダイヤル"</string>
- <string name="notification_voicemail_no_vm_number" msgid="3423686009815186750">"留守番電話の番号が不明です"</string>
+ <string name="notification_voicemail_no_vm_number" msgid="3423686009815186750">"ボイスメールの番号が不明です"</string>
<string name="notification_network_selection_title" msgid="255595526707809121">"通信サービスなし"</string>
<string name="notification_network_selection_text" msgid="553288408722427659">"選択したネットワーク(<xliff:g id="OPERATOR_NAME">%s</xliff:g>)は利用できません"</string>
<string name="incall_error_power_off" product="watch" msgid="7191184639454113633">"通話を発信するには、モバイル ネットワークを ON にし、機内モードまたはバッテリー セーバー モードを OFF にしてください。"</string>
@@ -668,7 +668,7 @@
<string name="description_dial_button" msgid="8614631902795087259">"発信"</string>
<string name="description_dialpad_button" msgid="7395114120463883623">"ダイヤルパッドを表示"</string>
<string name="pane_title_emergency_dialpad" msgid="3627372514638694401">"緊急通報ダイヤルパッド"</string>
- <string name="voicemail_visual_voicemail_switch_title" msgid="6610414098912832120">"ビジュアル留守番電話"</string>
+ <string name="voicemail_visual_voicemail_switch_title" msgid="6610414098912832120">"ビジュアルボイスメール"</string>
<string name="voicemail_set_pin_dialog_title" msgid="7005128605986960003">"PIN の設定"</string>
<string name="voicemail_change_pin_dialog_title" msgid="4633077715231764435">"PIN の変更"</string>
<string name="preference_category_ringtone" msgid="8787281191375434976">"着信音とバイブレーション"</string>
@@ -693,17 +693,17 @@
<string name="callFailed_low_battery" msgid="4056828320214416182">"電池残量が低下したため、ビデオハングアウトが終了しました。"</string>
<string name="callFailed_emergency_call_over_wfc_not_available" msgid="5944309590693432042">"この場所では Wi-Fi 通話による緊急通報はご利用いただけません。"</string>
<string name="callFailed_wfc_service_not_available_in_this_location" msgid="3624536608369524988">"この場所では Wi-Fi 通話はご利用いただけません。"</string>
- <string name="change_pin_title" msgid="3564254326626797321">"留守番電話 PIN の変更"</string>
+ <string name="change_pin_title" msgid="3564254326626797321">"ボイスメール PIN の変更"</string>
<string name="change_pin_continue_label" msgid="5177011752453506371">"続行"</string>
<string name="change_pin_cancel_label" msgid="2301711566758827936">"キャンセル"</string>
<string name="change_pin_ok_label" msgid="6861082678817785330">"OK"</string>
<string name="change_pin_enter_old_pin_header" msgid="853151335217594829">"古い PIN の確認"</string>
- <string name="change_pin_enter_old_pin_hint" msgid="8801292976275169367">"続行するには留守番電話 PIN を入力してください。"</string>
+ <string name="change_pin_enter_old_pin_hint" msgid="8801292976275169367">"続行するにはボイスメール PIN を入力してください。"</string>
<string name="change_pin_enter_new_pin_header" msgid="4739465616733486118">"新しい PIN の設定"</string>
<string name="change_pin_enter_new_pin_hint" msgid="2326038476516364210">"PIN は <xliff:g id="MIN">%1$d</xliff:g>~<xliff:g id="MAX">%2$d</xliff:g> 桁にしてください。"</string>
<string name="change_pin_confirm_pin_header" msgid="2606303906320705726">"PIN の確認"</string>
<string name="change_pin_confirm_pins_dont_match" msgid="305164501222587215">"PIN が一致しません"</string>
- <string name="change_pin_succeeded" msgid="2504705600693014403">"留守番電話 PIN を更新しました"</string>
+ <string name="change_pin_succeeded" msgid="2504705600693014403">"ボイスメール PIN を更新しました"</string>
<string name="change_pin_system_error" msgid="7772788809875146873">"PIN を設定できません"</string>
<string name="mobile_data_status_roaming_turned_off_subtext" msgid="6840673347416227054">"データ ローミングが OFF になっています"</string>
<string name="mobile_data_status_roaming_turned_on_subtext" msgid="5615757897768777865">"データ ローミングが ON になっています"</string>
diff --git a/res/values-ky/strings.xml b/res/values-ky/strings.xml
index 1420182..c4ea6fa 100644
--- a/res/values-ky/strings.xml
+++ b/res/values-ky/strings.xml
@@ -341,7 +341,7 @@
<string name="general_news_settings" msgid="2670499575962080411">"Жалпы жаңылыктар"</string>
<string name="bf_news_settings" msgid="8571709425370794221">"Ишкердик жана каржы жаңылыктары"</string>
<string name="sports_news_settings" msgid="2684364556989168438">"Спорт жаңылыктары"</string>
- <string name="entertainment_news_settings" msgid="4228527702346305543">"Көңүл ачуу жаатындагы жаңылыктар"</string>
+ <string name="entertainment_news_settings" msgid="4228527702346305543">"Көңүл ачуу жаңылыктары"</string>
<string name="enable_disable_local" msgid="7654175079979415572">"Жергиликтүү"</string>
<string name="local_enable" msgid="790606890868710629">"Жергиликтүү жаңылыктар иштетилген"</string>
<string name="local_disable" msgid="7649945293198602877">"Жергиликтүү жаңылыктар өчүрүлгөн"</string>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index b1b1a2f..4e639eb 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -86,11 +86,11 @@
<string name="voicemail_notifications_preference_title" msgid="7829238858063382977">"Notificações"</string>
<string name="cell_broadcast_settings" msgid="8135324242541809924">"Transmissões de emergência"</string>
<string name="call_settings" msgid="3677282690157603818">"Configurações de chamadas"</string>
- <string name="additional_gsm_call_settings" msgid="1561980168685658846">"Configurações avançadas"</string>
- <string name="additional_gsm_call_settings_with_label" msgid="7973920539979524908">"Configurações avançadas (<xliff:g id="SUBSCRIPTIONLABEL">%s</xliff:g>)"</string>
- <string name="sum_gsm_call_settings" msgid="7964692601608878138">"Configurações avançadas somente de chamada GSM"</string>
+ <string name="additional_gsm_call_settings" msgid="1561980168685658846">"Configurações adicionais"</string>
+ <string name="additional_gsm_call_settings_with_label" msgid="7973920539979524908">"Configurações adicionais (<xliff:g id="SUBSCRIPTIONLABEL">%s</xliff:g>)"</string>
+ <string name="sum_gsm_call_settings" msgid="7964692601608878138">"Configurações adicionais somente de chamada GSM"</string>
<string name="additional_cdma_call_settings" msgid="2178016561980611304">"Configurações de chamada CDMA adicionais"</string>
- <string name="sum_cdma_call_settings" msgid="3185825305136993636">"Configurações avançadas somente de chamada CDMA"</string>
+ <string name="sum_cdma_call_settings" msgid="3185825305136993636">"Configurações adicionais somente de chamada CDMA"</string>
<string name="labelNwService" msgid="6015891883487125120">"Configurações do serviço de rede"</string>
<string name="labelCallerId" msgid="2090540744550903172">"Identificador de chamadas"</string>
<string name="sum_loading_settings" msgid="434063780286688775">"Carregando configurações…"</string>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index ecd1ff1..43633a7 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -615,7 +615,7 @@
<string name="ota_title_activate" msgid="4049645324841263423">"Активирајте телефон"</string>
<string name="ota_touch_activate" msgid="838764494319694754">"Потребно је да упутите посебан позив да бисте активирали услугу свој телефона. \n\nНакон што притиснете дугме „Активирај“, слушајте дата упутства да бисте да бисте активирали свој телефон."</string>
<string name="ota_hfa_activation_title" msgid="3300556778212729671">"Активирање..."</string>
- <string name="ota_hfa_activation_dialog_message" msgid="7921718445773342996">"Телефон активира услугу мобилних података.\n\nТо може да потраје и до 5 минута."</string>
+ <string name="ota_hfa_activation_dialog_message" msgid="7921718445773342996">"Телефон активира услугу мобилног преноса података.\n\nТо може да потраје и до 5 минута."</string>
<string name="ota_skip_activation_dialog_title" msgid="7666611236789203797">"Желите ли да прескочите активацију?"</string>
<string name="ota_skip_activation_dialog_message" msgid="6691722887019708713">"Ако прескочите активацију, не можете да упућујете позиве или да се повезујете са мрежама за мобилни пренос података (иако можете да се повежете са WiFi мрежама). Све док не активирате свој телефон, бићете упитани да то учините сваки пут када га укључите."</string>
<string name="ota_skip_activation_dialog_skip_label" msgid="5908029466817825633">"Прескочи"</string>
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index ba797a3..03b0be9 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -341,6 +341,10 @@
private static final int CMD_GET_SLICING_CONFIG = 110;
private static final int EVENT_GET_SLICING_CONFIG_DONE = 111;
private static final int CMD_ERASE_DATA_SHARED_PREFERENCES = 112;
+ private static final int CMD_ENABLE_VONR = 113;
+ private static final int EVENT_ENABLE_VONR_DONE = 114;
+ private static final int CMD_IS_VONR_ENABLED = 115;
+ private static final int EVENT_IS_VONR_ENABLED_DONE = 116;
// Parameters of select command.
private static final int SELECT_COMMAND = 0xA4;
@@ -834,7 +838,7 @@
} else {
// request.result must be set to something non-null
// for the calling thread to unblock
- if (request.result != null) {
+ if (ar.result != null) {
request.result = ar.result;
} else {
request.result = false;
@@ -851,6 +855,46 @@
notifyRequester(request);
break;
+ case CMD_IS_VONR_ENABLED: {
+ request = (MainThreadRequest) msg.obj;
+ onCompleted = obtainMessage(EVENT_IS_VONR_ENABLED_DONE,
+ request);
+ Phone phone = getPhoneFromRequest(request);
+ if (phone != null) {
+ phone.isVoNrEnabled(onCompleted, request.workSource);
+ } else {
+ loge("isVoNrEnabled: No phone object");
+ request.result = false;
+ notifyRequester(request);
+ }
+ break;
+ }
+
+ case EVENT_IS_VONR_ENABLED_DONE:
+ ar = (AsyncResult) msg.obj;
+ request = (MainThreadRequest) ar.userObj;
+ if (ar.exception == null && ar.result != null) {
+ request.result = ar.result;
+ } else {
+ // request.result must be set to something non-null
+ // for the calling thread to unblock
+ if (ar.result != null) {
+ request.result = ar.result;
+ } else {
+ request.result = false;
+ }
+ if (ar.result == null) {
+ loge("isVoNrEnabled: Empty response");
+ } else if (ar.exception instanceof CommandException) {
+ loge("isVoNrEnabled: CommandException: "
+ + ar.exception);
+ } else {
+ loge("isVoNrEnabled: Unknown exception");
+ }
+ }
+ notifyRequester(request);
+ break;
+
case CMD_ENABLE_NR_DUAL_CONNECTIVITY: {
request = (MainThreadRequest) msg.obj;
onCompleted = obtainMessage(EVENT_ENABLE_NR_DUAL_CONNECTIVITY_DONE, request);
@@ -899,6 +943,49 @@
break;
}
+ case CMD_ENABLE_VONR: {
+ request = (MainThreadRequest) msg.obj;
+ onCompleted = obtainMessage(EVENT_ENABLE_VONR_DONE, request);
+ Phone phone = getPhoneFromRequest(request);
+ if (phone != null) {
+ phone.setVoNrEnabled((boolean) request.argument, onCompleted,
+ request.workSource);
+ } else {
+ loge("setVoNrEnabled: No phone object");
+ request.result =
+ TelephonyManager.ENABLE_VONR_RADIO_NOT_AVAILABLE;
+ notifyRequester(request);
+ }
+ break;
+ }
+
+ case EVENT_ENABLE_VONR_DONE: {
+ ar = (AsyncResult) msg.obj;
+ request = (MainThreadRequest) ar.userObj;
+ if (ar.exception == null) {
+ request.result = TelephonyManager.ENABLE_VONR_SUCCESS;
+ } else {
+ request.result = TelephonyManager.ENABLE_VONR_RADIO_ERROR;
+ if (ar.exception instanceof CommandException) {
+ CommandException.Error error =
+ ((CommandException) (ar.exception)).getCommandError();
+ if (error == CommandException.Error.RADIO_NOT_AVAILABLE) {
+ request.result = TelephonyManager.ENABLE_VONR_RADIO_NOT_AVAILABLE;
+ } else if (error == CommandException.Error.REQUEST_NOT_SUPPORTED) {
+ request.result = TelephonyManager.ENABLE_VONR_REQUEST_NOT_SUPPORTED;
+ } else {
+ request.result = TelephonyManager.ENABLE_VONR_RADIO_ERROR;
+ }
+ loge("setVoNrEnabled" + ": CommandException: "
+ + ar.exception);
+ } else {
+ loge("setVoNrEnabled" + ": Unknown exception");
+ }
+ }
+ notifyRequester(request);
+ break;
+ }
+
case CMD_GET_ALLOWED_NETWORK_TYPES_BITMASK:
request = (MainThreadRequest) msg.obj;
onCompleted = obtainMessage(EVENT_GET_ALLOWED_NETWORK_TYPES_BITMASK_DONE,
@@ -1056,7 +1143,7 @@
request.argument).first;
request.phone.setCallForwardingOption(
callForwardingInfoToSet.isEnabled()
- ? CommandsInterface.CF_ACTION_ENABLE
+ ? CommandsInterface.CF_ACTION_REGISTRATION
: CommandsInterface.CF_ACTION_DISABLE,
callForwardingInfoToSet.getReason(),
callForwardingInfoToSet.getNumber(),
@@ -2947,6 +3034,14 @@
@SuppressWarnings("unchecked")
public List<NeighboringCellInfo> getNeighboringCellInfo(String callingPackage,
String callingFeatureId) {
+ try {
+ mApp.getSystemService(AppOpsManager.class)
+ .checkPackage(Binder.getCallingUid(), callingPackage);
+ } catch (SecurityException e) {
+ EventLog.writeEvent(0x534e4554, "190619791", Binder.getCallingUid());
+ throw e;
+ }
+
final int targetSdk = TelephonyPermissions.getTargetSdk(mApp, callingPackage);
if (targetSdk >= android.os.Build.VERSION_CODES.Q) {
throw new SecurityException(
@@ -8205,6 +8300,53 @@
}
/**
+ * Enable or disable Voice over NR (VoNR)
+ * @param subId the subscription ID that this action applies to.
+ * @param enabled enable or disable VoNR.
+ * @return operation result.
+ */
+ @Override
+ public int setVoNrEnabled(int subId, boolean enabled) {
+ enforceModifyPermission();
+ final Phone phone = getPhone(subId);
+
+ final long identity = Binder.clearCallingIdentity();
+ if (phone == null) {
+ loge("setVoNrEnabled fails with no phone object for subId: " + subId);
+ return TelephonyManager.ENABLE_VONR_RADIO_NOT_AVAILABLE;
+ }
+
+ WorkSource workSource = getWorkSource(Binder.getCallingUid());
+ try {
+ int result = (int) sendRequest(CMD_ENABLE_VONR, enabled, subId,
+ workSource);
+ if (DBG) log("setVoNrEnabled result: " + result);
+ return result;
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
+ * Is voice over NR enabled
+ * @return true if VoNR is enabled else false
+ */
+ @Override
+ public boolean isVoNrEnabled(int subId) {
+ enforceReadPrivilegedPermission("isVoNrEnabled");
+ WorkSource workSource = getWorkSource(Binder.getCallingUid());
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ boolean isEnabled = (boolean) sendRequest(CMD_IS_VONR_ENABLED,
+ null, subId, workSource);
+ if (DBG) log("isVoNrEnabled: " + isEnabled);
+ return isEnabled;
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
* Action set from carrier signalling broadcast receivers to start/stop reporting the default
* network status based on which carrier apps could apply actions accordingly,
* enable/disable default url handler for example.
diff --git a/src/com/android/phone/RcsProvisioningMonitor.java b/src/com/android/phone/RcsProvisioningMonitor.java
index 23c4c5a..6d2bd6f 100644
--- a/src/com/android/phone/RcsProvisioningMonitor.java
+++ b/src/com/android/phone/RcsProvisioningMonitor.java
@@ -75,6 +75,10 @@
private static final int EVENT_RESET = 8;
private static final int EVENT_FEATURE_ENABLED_OVERRIDE = 9;
+ // indicate that the carrier single registration capable is initial value as
+ // carrier config is not ready yet.
+ private static final int MASK_CAP_CARRIER_INIT = 0xF000;
+
private final PhoneGlobals mPhone;
private final Handler mHandler;
// Cache the RCS provsioning info and related sub id
@@ -220,7 +224,19 @@
}
void setSingleRegistrationCapability(int singleRegistrationCapability) {
- mSingleRegistrationCapability = singleRegistrationCapability;
+ if (mSingleRegistrationCapability != singleRegistrationCapability) {
+ mSingleRegistrationCapability = singleRegistrationCapability;
+ notifyDma();
+ }
+ }
+
+ void notifyDma() {
+ // notify only if capable value has been updated when carrier config ready.
+ if ((mSingleRegistrationCapability & MASK_CAP_CARRIER_INIT) != MASK_CAP_CARRIER_INIT) {
+ logi("notify default messaging app for sub:" + mSubId + " with capability:"
+ + mSingleRegistrationCapability);
+ notifyDmaForSub(mSubId, mSingleRegistrationCapability);
+ }
}
int getSingleRegistrationCapability() {
@@ -675,7 +691,7 @@
logv("new default messaging application " + mDmaPackageName);
mRcsProvisioningInfos.forEach((k, v) -> {
- notifyDmaForSub(k, v.getSingleRegistrationCapability());
+ v.notifyDma();
byte[] cachedConfig = v.getConfig();
//clear old callbacks
@@ -715,17 +731,20 @@
return b.getBoolean(CarrierConfigManager.KEY_USE_ACS_FOR_RCS_BOOL);
}
- private boolean isSingleRegistrationRequiredByCarrier(int subId) {
+ private int getSingleRegistrationRequiredByCarrier(int subId) {
Boolean enabledByOverride = mCarrierSingleRegistrationEnabledOverride.get(subId);
if (enabledByOverride != null) {
- return enabledByOverride;
+ return enabledByOverride ? ProvisioningManager.STATUS_CAPABLE
+ : ProvisioningManager.STATUS_CARRIER_NOT_CAPABLE;
}
PersistableBundle b = mCarrierConfigManager.getConfigForSubId(subId);
- if (b == null) {
- return false;
+ if (!CarrierConfigManager.isConfigForIdentifiedCarrier(b)) {
+ return MASK_CAP_CARRIER_INIT;
}
- return b.getBoolean(CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL);
+ return b.getBoolean(CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL)
+ ? ProvisioningManager.STATUS_CAPABLE
+ : ProvisioningManager.STATUS_CARRIER_NOT_CAPABLE;
}
private int getSingleRegistrationCapableValue(int subId) {
@@ -735,10 +754,9 @@
: mPhone.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_TELEPHONY_IMS_SINGLE_REGISTRATION);
- int value = (isSingleRegistrationEnabledOnDevice ? 0
- : ProvisioningManager.STATUS_DEVICE_NOT_CAPABLE) | (
- isSingleRegistrationRequiredByCarrier(subId) ? 0
- : ProvisioningManager.STATUS_CARRIER_NOT_CAPABLE);
+ int value = (isSingleRegistrationEnabledOnDevice ? ProvisioningManager.STATUS_CAPABLE
+ : ProvisioningManager.STATUS_DEVICE_NOT_CAPABLE)
+ | getSingleRegistrationRequiredByCarrier(subId);
logv("SingleRegistrationCapableValue : " + value);
return value;
}
@@ -746,11 +764,8 @@
private void onCarrierConfigChange() {
logv("onCarrierConfigChange");
mRcsProvisioningInfos.forEach((subId, info) -> {
- int value = getSingleRegistrationCapableValue(subId);
- if (value != info.getSingleRegistrationCapability()) {
- info.setSingleRegistrationCapability(value);
- notifyDmaForSub(subId, value);
- }
+ info.setSingleRegistrationCapability(
+ getSingleRegistrationCapableValue(subId));
});
}
@@ -765,9 +780,8 @@
byte[] data = loadConfigForSub(i);
int capability = getSingleRegistrationCapableValue(i);
logv("new info is created for sub : " + i + ", single registration capability :"
- + capability + ", rcs config : " + data);
+ + capability + ", rcs config : " + Arrays.toString(data));
mRcsProvisioningInfos.put(i, new RcsProvisioningInfo(i, capability, data));
- notifyDmaForSub(i, capability);
}
}
@@ -783,6 +797,10 @@
logv("onConfigReceived, subId:" + subId + ", config:"
+ config + ", isCompressed:" + isCompressed);
RcsProvisioningInfo info = mRcsProvisioningInfos.get(subId);
+ if (info == null) {
+ logd("sub[" + subId + "] has been removed");
+ return;
+ }
info.setConfig(isCompressed ? RcsConfig.decompressGzip(config) : config);
updateConfigForSub(subId, config, isCompressed);
}
@@ -852,6 +870,10 @@
}
}
+ private static void logi(String msg) {
+ Rlog.i(TAG, msg);
+ }
+
private static void logd(String msg) {
Rlog.d(TAG, msg);
}
diff --git a/src/com/android/phone/SimPhonebookProvider.java b/src/com/android/phone/SimPhonebookProvider.java
index b921398..04c4f48 100644
--- a/src/com/android/phone/SimPhonebookProvider.java
+++ b/src/com/android/phone/SimPhonebookProvider.java
@@ -16,8 +16,8 @@
package com.android.phone;
-import static com.android.internal.telephony.IccProvider.STR_NEW_TAG;
import static com.android.internal.telephony.IccProvider.STR_NEW_NUMBER;
+import static com.android.internal.telephony.IccProvider.STR_NEW_TAG;
import android.Manifest;
import android.annotation.TestApi;
@@ -97,6 +97,8 @@
private static final String TAG = "SimPhonebookProvider";
private static final Set<String> ELEMENTARY_FILES_COLUMNS_SET =
ImmutableSet.copyOf(ELEMENTARY_FILES_ALL_COLUMNS);
+ private static final Set<String> SIM_RECORDS_COLUMNS_SET =
+ ImmutableSet.copyOf(SIM_RECORDS_ALL_COLUMNS);
private static final Set<String> SIM_RECORDS_WRITABLE_COLUMNS = ImmutableSet.of(
SimRecords.NAME, SimRecords.PHONE_NUMBER
);
@@ -305,8 +307,10 @@
MatrixCursor result = new MatrixCursor(projection);
try {
- addEfToCursor(
- result, getActiveSubscriptionInfo(args.subscriptionId), args.efType);
+ SubscriptionInfo info = getActiveSubscriptionInfo(args.subscriptionId);
+ if (info != null) {
+ addEfToCursor(result, info, args.efType);
+ }
} catch (RemoteException e) {
// Return an empty cursor. If service to access it is throwing remote
// exceptions then it's basically the same as not having a SIM.
@@ -353,6 +357,7 @@
}
private Cursor querySimRecords(PhonebookArgs args, String[] projection) {
+ validateProjection(SIM_RECORDS_COLUMNS_SET, projection);
validateSubscriptionAndEf(args);
if (projection == null) {
projection = SIM_RECORDS_ALL_COLUMNS;
@@ -407,6 +412,7 @@
}
private Cursor querySimRecordsItem(PhonebookArgs args, String[] projection) {
+ validateProjection(SIM_RECORDS_COLUMNS_SET, projection);
if (projection == null) {
projection = SIM_RECORDS_ALL_COLUMNS;
}
@@ -734,6 +740,7 @@
}
}
+ @Nullable
private SubscriptionInfo getActiveSubscriptionInfo(int subId) {
// Getting the SubscriptionInfo requires READ_PHONE_STATE.
CallingIdentity identity = clearCallingIdentity();
diff --git a/src/com/android/phone/settings/RadioInfo.java b/src/com/android/phone/settings/RadioInfo.java
index b1ab413..d4c926e 100644
--- a/src/com/android/phone/settings/RadioInfo.java
+++ b/src/com/android/phone/settings/RadioInfo.java
@@ -673,6 +673,12 @@
mPreferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
mPreferredNetworkType.setOnItemSelectedListener(mPreferredNetworkHandler);
+ new Thread(() -> {
+ int networkType = (int) mTelephonyManager.getPreferredNetworkTypeBitmask();
+ updatePreferredNetworkType(
+ RadioAccessFamily.getNetworkTypeFromRaf(networkType));
+ }).start();
+
// set phone index
mSelectPhoneIndex.setSelection(mSelectedPhoneIndex, true);
mSelectPhoneIndex.setOnItemSelectedListener(mSelectPhoneIndexHandler);
diff --git a/src/com/android/services/telephony/DisconnectCauseUtil.java b/src/com/android/services/telephony/DisconnectCauseUtil.java
index 9c89e9e..9321e1e 100644
--- a/src/com/android/services/telephony/DisconnectCauseUtil.java
+++ b/src/com/android/services/telephony/DisconnectCauseUtil.java
@@ -787,12 +787,12 @@
default:
break;
}
- return resourceId == null ? "" : context.getResources().getText(resourceId);
+ return resourceId == null ? "" : context.getResources().getString(resourceId);
}
private static boolean isRadioOffForThermalMitigation(int phoneId) {
Phone phone = PhoneFactory.getPhone(phoneId);
- return phone.isRadioOffForThermalMitigation();
+ return phone == null ? false : phone.isRadioOffForThermalMitigation();
}
/**
diff --git a/src/com/android/services/telephony/ImsConference.java b/src/com/android/services/telephony/ImsConference.java
index 0be927a..7f088f7 100644
--- a/src/com/android/services/telephony/ImsConference.java
+++ b/src/com/android/services/telephony/ImsConference.java
@@ -257,7 +257,7 @@
@Override
public void onConnectionPropertiesChanged(Connection c, int connectionProperties) {
- Log.d(this, "onConnectionPropertiesChanged: Connection: %s,"
+ Log.i(ImsConference.this, "onConnectionPropertiesChanged: Connection: %s,"
+ " connectionProperties: %s", c, connectionProperties);
updateConnectionProperties(connectionProperties);
}
@@ -383,6 +383,11 @@
private boolean mIsUsingSimCallManager = false;
/**
+ * See {@link #isRemotelyHosted()} for details.
+ */
+ private boolean mWasRemotelyHosted = false;
+
+ /**
* Where {@link #isMultiparty()} is {@code false}, contains the
* {@link ConferenceParticipantConnection#getUserEntity()} and
* {@link ConferenceParticipantConnection#getEndpoint()} of the single participant which this
@@ -522,11 +527,12 @@
(properties & Connection.PROPERTY_IS_EXTERNAL_CALL) != 0);
conferenceProperties = changeBitmask(conferenceProperties,
- Connection.PROPERTY_REMOTELY_HOSTED, !isConferenceHost());
+ Connection.PROPERTY_REMOTELY_HOSTED, isRemotelyHosted());
conferenceProperties = changeBitmask(conferenceProperties,
Connection.PROPERTY_IS_ADHOC_CONFERENCE,
(properties & Connection.PROPERTY_IS_ADHOC_CONFERENCE) != 0);
+ Log.i(this, "applyHostProperties: confProp=%s", conferenceProperties);
return conferenceProperties;
}
@@ -774,6 +780,26 @@
}
/**
+ * Returns whether the conference is remotely hosted or not.
+ * This method will cache the current remotely hosted state when the conference host or
+ * original connection becomes null. This is important for scenarios where the conference host
+ * or original connection changes midway through a conference such as in an SRVCC scenario.
+ * @return {@code true} if the conference was remotely hosted based on the conference host and
+ * its original connection, or based on the last known remotely hosted state. {@code false}
+ * otherwise.
+ */
+ public boolean isRemotelyHosted() {
+ if (mConferenceHost == null || mConferenceHost.getOriginalConnection() == null) {
+ return mWasRemotelyHosted;
+ }
+ com.android.internal.telephony.Connection originalConnection =
+ mConferenceHost.getOriginalConnection();
+ mWasRemotelyHosted = originalConnection.isMultiparty()
+ && !originalConnection.isConferenceHost();
+ return mWasRemotelyHosted;
+ }
+
+ /**
* Determines if this conference is hosted on the current device or the peer device.
*
* @return {@code true} if this conference is hosted on the current device, {@code false} if it
@@ -1209,6 +1235,7 @@
ConferenceParticipantConnection connection = new ConferenceParticipantConnection(
parent.getOriginalConnection(), participant,
!isConferenceHost() /* isRemotelyHosted */);
+
if (participant.getConnectTime() == 0) {
connection.setConnectTimeMillis(parent.getConnectTimeMillis());
connection.setConnectionStartElapsedRealtimeMillis(
diff --git a/src/com/android/services/telephony/TelephonyConferenceController.java b/src/com/android/services/telephony/TelephonyConferenceController.java
index 228541a..9aa3dbe 100644
--- a/src/com/android/services/telephony/TelephonyConferenceController.java
+++ b/src/com/android/services/telephony/TelephonyConferenceController.java
@@ -40,6 +40,7 @@
*/
final class TelephonyConferenceController {
private static final int TELEPHONY_CONFERENCE_MAX_SIZE = 5;
+ private static final String RIL_REPORTED_CONFERENCE_CALL_STRING = "Conference Call";
private final TelephonyConnection.TelephonyConnectionListener mTelephonyConnectionListener =
new TelephonyConnection.TelephonyConnectionListener() {
@@ -179,7 +180,6 @@
private void recalculateConference() {
Set<TelephonyConnection> conferencedConnections = new HashSet<>();
int numGsmConnections = 0;
-
for (TelephonyConnection connection : mTelephonyConnections) {
com.android.internal.telephony.Connection radioConnection =
connection.getOriginalConnection();
@@ -271,11 +271,19 @@
// Remove all instances of PROPERTY_IS_DOWNGRADED_CONFERENCE. This
// property should only be set on the parent call (i.e. the newly
// created TelephonyConference.
- Log.d(this, "Removing PROPERTY_IS_DOWNGRADED_CONFERENCE from connection"
- + " %s", connection);
- int newProperties = connection.getConnectionProperties()
- & ~Connection.PROPERTY_IS_DOWNGRADED_CONFERENCE;
- connection.setTelephonyConnectionProperties(newProperties);
+ // This doesn't apply to a connection whose address is "Conference
+ // Call", which may be updated by some modem to create a connection
+ // to represent a merged conference connection in SRVCC.
+ if (connection.getAddress() == null
+ || !connection.getAddress().getSchemeSpecificPart()
+ .equalsIgnoreCase(
+ RIL_REPORTED_CONFERENCE_CALL_STRING)) {
+ Log.d(this, "Removing PROPERTY_IS_DOWNGRADED_CONFERENCE"
+ + " from connection %s", connection);
+ int newProperties = connection.getConnectionProperties()
+ & ~Connection.PROPERTY_IS_DOWNGRADED_CONFERENCE;
+ connection.setTelephonyConnectionProperties(newProperties);
+ }
isDowngradedConference = true;
}
mTelephonyConference.addTelephonyConnection(connection);
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 53e923e..ce3cf01 100755
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -3810,4 +3810,13 @@
mCommunicator.sendMessages(set);
}
}
+
+ /**
+ * Returns the current telephony connection listeners for test purposes.
+ * @return list of telephony connection listeners.
+ */
+ @VisibleForTesting
+ public List<TelephonyConnectionListener> getTelephonyConnectionListeners() {
+ return new ArrayList<>(mTelephonyListeners);
+ }
}
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 7a0d8c2..4f6acc8 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -1199,9 +1199,9 @@
return connection;
}
- com.android.internal.telephony.Connection originalConnection =
- call.getState() == Call.State.WAITING ?
- call.getLatestConnection() : call.getEarliestConnection();
+ // If there are multiple Connections tracked in a call, grab the latest, since it is most
+ // likely to be the incoming call.
+ com.android.internal.telephony.Connection originalConnection = call.getLatestConnection();
if (isOriginalConnectionKnown(originalConnection)) {
Log.i(this, "onCreateIncomingConnection, original connection already registered");
return Connection.createCanceledConnection();
@@ -2084,8 +2084,7 @@
if (phone.getEmergencyNumberTracker() != null) {
if (phone.getEmergencyNumberTracker().isEmergencyNumber(
emergencyNumberAddress, true)) {
- if (phone.getHalVersion().greaterOrEqual(RIL.RADIO_HAL_VERSION_1_4)
- || isAvailableForEmergencyCalls(phone)) {
+ if (isAvailableForEmergencyCalls(phone)) {
// a)
if (phone.getPhoneId() == defaultVoicePhoneId) {
Log.i(this, "getPhoneForEmergencyCall, Phone Id that supports"
@@ -2208,12 +2207,6 @@
// Only sort if there are enough elements to do so.
if (phoneSlotStatus.size() > 1) {
Collections.sort(phoneSlotStatus, (o1, o2) -> {
- if (!o1.hasDialedEmergencyNumber && o2.hasDialedEmergencyNumber) {
- return -1;
- }
- if (o1.hasDialedEmergencyNumber && !o2.hasDialedEmergencyNumber) {
- return 1;
- }
// Sort by non-absent SIM.
if (o1.simState == TelephonyManager.SIM_STATE_ABSENT
&& o2.simState != TelephonyManager.SIM_STATE_ABSENT) {
@@ -2232,6 +2225,13 @@
if (o2.isLocked && !o1.isLocked) {
return 1;
}
+ // Prefer slots where the number is considered emergency.
+ if (!o1.hasDialedEmergencyNumber && o2.hasDialedEmergencyNumber) {
+ return -1;
+ }
+ if (o1.hasDialedEmergencyNumber && !o2.hasDialedEmergencyNumber) {
+ return 1;
+ }
// sort by number of RadioAccessFamily Capabilities.
int compare = RadioAccessFamily.compare(o1.capabilities, o2.capabilities);
if (compare == 0) {
diff --git a/tests/src/com/android/phone/RcsProvisioningMonitorTest.java b/tests/src/com/android/phone/RcsProvisioningMonitorTest.java
index 4fba922..8e5e073 100644
--- a/tests/src/com/android/phone/RcsProvisioningMonitorTest.java
+++ b/tests/src/com/android/phone/RcsProvisioningMonitorTest.java
@@ -305,7 +305,6 @@
@Test
@SmallTest
public void testInitWithSavedConfig() throws Exception {
- ArgumentCaptor<Intent> captorIntent = ArgumentCaptor.forClass(Intent.class);
createMonitor(3);
for (int i = 0; i < 3; i++) {
@@ -313,10 +312,6 @@
mRcsProvisioningMonitor.getConfig(FAKE_SUB_ID_BASE + i)));
}
- verify(mPhone, times(3)).sendBroadcast(captorIntent.capture(), any());
- Intent capturedIntent = captorIntent.getAllValues().get(1);
- assertEquals(ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE,
- capturedIntent.getAction());
verify(mIImsConfig, times(3)).notifyRcsAutoConfigurationReceived(any(), anyBoolean());
}
@@ -324,14 +319,8 @@
@SmallTest
public void testInitWithoutSavedConfig() throws Exception {
when(mCursor.getBlob(anyInt())).thenReturn(null);
- ArgumentCaptor<Intent> captorIntent = ArgumentCaptor.forClass(Intent.class);
createMonitor(3);
- verify(mPhone, times(3)).sendBroadcast(captorIntent.capture(), any());
- Intent capturedIntent = captorIntent.getAllValues().get(1);
-
- assertEquals(ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE,
- capturedIntent.getAction());
//Should not notify null config
verify(mIImsConfig, never()).notifyRcsAutoConfigurationReceived(any(), anyBoolean());
}
@@ -340,16 +329,12 @@
@SmallTest
public void testSubInfoChanged() throws Exception {
createMonitor(3);
- ArgumentCaptor<Intent> captorIntent = ArgumentCaptor.forClass(Intent.class);
for (int i = 0; i < 3; i++) {
assertTrue(Arrays.equals(CONFIG_DEFAULT.getBytes(),
mRcsProvisioningMonitor.getConfig(FAKE_SUB_ID_BASE + i)));
}
- verify(mPhone, times(3)).sendBroadcast(captorIntent.capture(), any());
- Intent capturedIntent = captorIntent.getAllValues().get(1);
- assertEquals(ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE,
- capturedIntent.getAction());
+
verify(mIImsConfig, times(3)).notifyRcsAutoConfigurationReceived(any(), anyBoolean());
makeFakeActiveSubIds(1);
@@ -401,14 +386,20 @@
@SmallTest
public void testCarrierConfigChanged() throws Exception {
createMonitor(1);
+ // should not broadcast message if carrier config is not ready
+ verify(mPhone, never()).sendBroadcast(any(), any());
+
when(mPackageManager.hasSystemFeature(
eq(PackageManager.FEATURE_TELEPHONY_IMS_SINGLE_REGISTRATION))).thenReturn(true);
ArgumentCaptor<Intent> captorIntent = ArgumentCaptor.forClass(Intent.class);
+ mBundle.putBoolean(CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL, true);
mBundle.putBoolean(
CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL, true);
+
broadcastCarrierConfigChange(FAKE_SUB_ID_BASE);
processAllMessages();
- verify(mPhone, atLeastOnce()).sendBroadcast(captorIntent.capture(), any());
+
+ verify(mPhone, times(1)).sendBroadcast(captorIntent.capture(), any());
Intent capturedIntent = captorIntent.getValue();
assertEquals(capturedIntent.getAction(),
ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE);
@@ -421,7 +412,8 @@
CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL, false);
broadcastCarrierConfigChange(FAKE_SUB_ID_BASE);
processAllMessages();
- verify(mPhone, atLeastOnce()).sendBroadcast(captorIntent.capture(), any());
+
+ verify(mPhone, times(2)).sendBroadcast(captorIntent.capture(), any());
capturedIntent = captorIntent.getValue();
assertEquals(capturedIntent.getAction(),
ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE);
@@ -435,7 +427,8 @@
eq(PackageManager.FEATURE_TELEPHONY_IMS_SINGLE_REGISTRATION))).thenReturn(false);
broadcastCarrierConfigChange(FAKE_SUB_ID_BASE);
processAllMessages();
- verify(mPhone, atLeastOnce()).sendBroadcast(captorIntent.capture(), any());
+
+ verify(mPhone, times(3)).sendBroadcast(captorIntent.capture(), any());
capturedIntent = captorIntent.getValue();
assertEquals(capturedIntent.getAction(),
ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE);
@@ -479,6 +472,7 @@
when(mPackageManager.hasSystemFeature(
eq(PackageManager.FEATURE_TELEPHONY_IMS_SINGLE_REGISTRATION))).thenReturn(false);
+ mBundle.putBoolean(CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL, true);
mBundle.putBoolean(
CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL, false);
broadcastCarrierConfigChange(FAKE_SUB_ID_BASE);
@@ -580,13 +574,39 @@
@Test
@SmallTest
public void testSendBroadcastWhenDmaChanged() throws Exception {
- createMonitor(3);
- verify(mPhone, times(3)).sendBroadcast(any(), any());
-
+ when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(null);
+ mBundle.putBoolean(CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL, true);
+ createMonitor(1);
updateDefaultMessageApplication(DEFAULT_MESSAGING_APP2);
processAllMessages();
- verify(mPhone, times(6)).sendBroadcast(any(), any());
+ // should not broadcast message as no carrier config change happens
+ verify(mPhone, never()).sendBroadcast(any(), any());
+
+ when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(mBundle);
+ when(mPackageManager.hasSystemFeature(
+ eq(PackageManager.FEATURE_TELEPHONY_IMS_SINGLE_REGISTRATION))).thenReturn(true);
+ ArgumentCaptor<Intent> captorIntent = ArgumentCaptor.forClass(Intent.class);
+ mBundle.putBoolean(
+ CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL, true);
+
+ broadcastCarrierConfigChange(FAKE_SUB_ID_BASE);
+ processAllMessages();
+
+ verify(mPhone, times(1)).sendBroadcast(captorIntent.capture(), any());
+ Intent capturedIntent = captorIntent.getValue();
+ assertEquals(capturedIntent.getAction(),
+ ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE);
+
+ updateDefaultMessageApplication(DEFAULT_MESSAGING_APP1);
+ processAllMessages();
+
+ // should broadcast message when default messaging application changed if carrier config
+ // has been loaded
+ verify(mPhone, times(2)).sendBroadcast(captorIntent.capture(), any());
+ capturedIntent = captorIntent.getValue();
+ assertEquals(capturedIntent.getAction(),
+ ProvisioningManager.ACTION_RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE);
}
@Test
@@ -611,6 +631,7 @@
when(mPackageManager.hasSystemFeature(
eq(PackageManager.FEATURE_TELEPHONY_IMS_SINGLE_REGISTRATION))).thenReturn(true);
+ mBundle.putBoolean(CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL, true);
mBundle.putBoolean(
CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL, true);
broadcastCarrierConfigChange(FAKE_SUB_ID_BASE);
@@ -694,6 +715,7 @@
when(mPackageManager.hasSystemFeature(
eq(PackageManager.FEATURE_TELEPHONY_IMS_SINGLE_REGISTRATION))).thenReturn(true);
+ mBundle.putBoolean(CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL, true);
mBundle.putBoolean(
CarrierConfigManager.Ims.KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL, true);
broadcastCarrierConfigChange(FAKE_SUB_ID_BASE);
diff --git a/tests/src/com/android/phone/SimPhonebookProviderTest.java b/tests/src/com/android/phone/SimPhonebookProviderTest.java
index f897fac..29a653d 100644
--- a/tests/src/com/android/phone/SimPhonebookProviderTest.java
+++ b/tests/src/com/android/phone/SimPhonebookProviderTest.java
@@ -56,6 +56,7 @@
import com.android.internal.telephony.uicc.IccConstants;
import com.google.common.collect.ImmutableList;
+import com.google.common.io.Closeables;
import com.google.common.truth.Correspondence;
import org.junit.Before;
@@ -234,6 +235,19 @@
}
@Test
+ public void query_elementaryFilesItem_nonExistentSubscriptionId_returnsEmptyCursor() {
+ setupSimsWithSubscriptionIds(1);
+ mIccPhoneBook.makeAllEfsSupported(1);
+
+ // Subscription ID 2 does not exist
+ Uri nonExistentElementaryFileItemUri = ElementaryFiles.getItemUri(2, EF_ADN);
+
+ try (Cursor cursor = mResolver.query(nonExistentElementaryFileItemUri, null, null, null)) {
+ assertThat(Objects.requireNonNull(cursor)).hasCount(0);
+ }
+ }
+
+ @Test
public void query_adnRecords_returnsCursorWithMatchingProjection() {
setupSimsWithSubscriptionIds(1);
mIccPhoneBook.makeAllEfsSupported(1);
@@ -275,6 +289,33 @@
}
@Test
+ public void query_adnRecords_invalidColumnProjection_throwsIllegalArgumentException() {
+ setupSimsWithSubscriptionIds(1);
+ mIccPhoneBook.makeAllEfsSupported(1);
+ Uri contentAdn = SimRecords.getContentUri(1, EF_ADN);
+
+ assertThrows(IllegalArgumentException.class, () -> Closeables.close(
+ mResolver.query(contentAdn, new String[] {
+ "an_unsupported_column",
+ }, null, null), false)
+ );
+
+ assertThrows(IllegalArgumentException.class, () -> Closeables.close(
+ mResolver.query(contentAdn, new String[] {
+ SimRecords.RECORD_NUMBER,
+ "an_unsupported_column"
+ }, null, null), false)
+ );
+
+ assertThrows(IllegalArgumentException.class, () -> Closeables.close(
+ mResolver.query(contentAdn, new String[] {
+ "an_unsupported_column",
+ SimRecords.RECORD_NUMBER
+ }, null, null), false)
+ );
+ }
+
+ @Test
public void query_adnRecords_noRecords_returnsEmptyCursor() {
setupSimsWithSubscriptionIds(1);
mIccPhoneBook.makeAllEfsSupported(1);
diff --git a/tests/src/com/android/services/telephony/ImsConferenceTest.java b/tests/src/com/android/services/telephony/ImsConferenceTest.java
index 3bc5ee8..9d2f5ac 100644
--- a/tests/src/com/android/services/telephony/ImsConferenceTest.java
+++ b/tests/src/com/android/services/telephony/ImsConferenceTest.java
@@ -622,6 +622,46 @@
}
/**
+ * Tests a scenario where a handover connection arrives via
+ * {@link TelephonyConnection#onOriginalConnectionRedialed(
+ * com.android.internal.telephony.Connection)}. During this process, the conference properties
+ * get updated. Since the original connection is null at this point, we need to verify that
+ * the remotely hosted property is retained from before the original connection was nulled.
+ */
+ @Test
+ public void testIsConferenceRemotelyHostedCachingOnSRVCC() {
+ mConferenceHost.setIsImsConnection(true);
+ when(mConferenceHost.getMockImsPhoneConnection().isMultiparty()).thenReturn(true);
+ when(mConferenceHost.getMockImsPhoneConnection().isConferenceHost()).thenReturn(true);
+
+ // Start out with a valid conference host.
+ ImsConference imsConference = new ImsConference(mMockTelecomAccountRegistry,
+ mMockTelephonyConnectionServiceProxy, mConferenceHost,
+ null /* phoneAccountHandle */, () -> false /* featureFlagProxy */,
+ new ImsConference.CarrierConfiguration.Builder().build());
+
+ // By default it is not remotely hosted.
+ assertFalse(imsConference.isRemotelyHosted());
+ assertEquals(0,
+ imsConference.getConnectionProperties() & Connection.PROPERTY_REMOTELY_HOSTED);
+
+ // Simulate a change to the original connection due to srvcc
+ com.android.internal.telephony.Connection previousOriginalConnection =
+ mConferenceHost.getMockImsPhoneConnection();
+ mConferenceHost.setMockImsPhoneConnection(null);
+
+ // Trigger the property update which takes place when the original connection changes.
+ mConferenceHost.getTelephonyConnectionListeners().forEach(
+ l -> l.onConnectionPropertiesChanged(mConferenceHost,
+ mConferenceHost.getConnectionProperties()));
+
+ // Should still NOT be remotely hosted based on cached value.
+ assertFalse(imsConference.isRemotelyHosted());
+ assertEquals(0,
+ imsConference.getConnectionProperties() & Connection.PROPERTY_REMOTELY_HOSTED);
+ }
+
+ /**
* Verifies that an ImsConference can handle SIP and TEL URIs for both the P-Associated-Uri and
* conference event package identities.
*/
diff --git a/tests/src/com/android/services/telephony/TelephonyConferenceControllerTest.java b/tests/src/com/android/services/telephony/TelephonyConferenceControllerTest.java
index cfdc2fd..b7fe988 100644
--- a/tests/src/com/android/services/telephony/TelephonyConferenceControllerTest.java
+++ b/tests/src/com/android/services/telephony/TelephonyConferenceControllerTest.java
@@ -23,9 +23,11 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.net.Uri;
import android.os.Looper;
import android.telecom.Conference;
import android.telecom.Connection;
+import android.telecom.PhoneAccount;
import android.test.suitebuilder.annotation.SmallTest;
import org.junit.Before;
@@ -35,7 +37,9 @@
import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
+import java.util.List;
/**
* Tests the functionality in TelephonyConferenceController.java
@@ -111,6 +115,46 @@
}
/**
+ * Verify the connection with "Conference Call" with PROPERTY_IS_DOWNGRADED_CONFERENCE
+ * during SRVCC
+ */
+ @Test
+ @SmallTest
+ public void testSrvccConferenceConnection() {
+ when(mTestTelephonyConnectionA.mMockRadioConnection.getCall()
+ .isMultiparty()).thenReturn(true);
+ when(mTestTelephonyConnectionB.mMockRadioConnection.getCall()
+ .isMultiparty()).thenReturn(true);
+
+ List<Connection> listConnections = Arrays.asList(
+ mTestTelephonyConnectionA, mTestTelephonyConnectionB);
+ when(mMockTelephonyConnectionServiceProxy.getAllConnections()).thenReturn(listConnections);
+
+ mTestTelephonyConnectionA.setAddress(
+ Uri.fromParts(PhoneAccount.SCHEME_TEL, "Conference Call", null), 0);
+ mTestTelephonyConnectionA.setTelephonyConnectionProperties(
+ Connection.PROPERTY_IS_DOWNGRADED_CONFERENCE);
+ mTestTelephonyConnectionB.setAddress(
+ Uri.fromParts(PhoneAccount.SCHEME_TEL, "5551213", null), 0);
+ mTestTelephonyConnectionB.setTelephonyConnectionProperties(
+ Connection.PROPERTY_IS_DOWNGRADED_CONFERENCE);
+
+ // add telephony connection B
+ mControllerTest.add(mTestTelephonyConnectionB);
+
+ // add telephony connection A
+ mControllerTest.add(mTestTelephonyConnectionA);
+
+ // verify the connection with "Conference Call" has PROPERTY_IS_DOWNGRADED_CONFERENCE
+ assertTrue((mTestTelephonyConnectionA.getConnectionProperties()
+ & Connection.PROPERTY_IS_DOWNGRADED_CONFERENCE) != 0);
+
+ // verify the connection with "5551213" hasn't PROPERTY_IS_DOWNGRADED_CONFERENCE
+ assertFalse((mTestTelephonyConnectionB.getConnectionProperties()
+ & Connection.PROPERTY_IS_DOWNGRADED_CONFERENCE) != 0);
+ }
+
+ /**
* Behavior: add telephony connection B and A to conference controller,
* set status for connections and merged calls, remove one call
* Assumption: after performing the behaviours, the status of Connection A is STATE_ACTIVE;
diff --git a/tests/src/com/android/services/telephony/TestTelephonyConnection.java b/tests/src/com/android/services/telephony/TestTelephonyConnection.java
index 817e9a7..e149d3b 100644
--- a/tests/src/com/android/services/telephony/TestTelephonyConnection.java
+++ b/tests/src/com/android/services/telephony/TestTelephonyConnection.java
@@ -305,4 +305,12 @@
public PersistableBundle getCarrierConfigBundle() {
return mCarrierConfig;
}
+
+ public ImsPhoneConnection getMockImsPhoneConnection() {
+ return mImsPhoneConnection;
+ }
+
+ public void setMockImsPhoneConnection(ImsPhoneConnection connection) {
+ mImsPhoneConnection = connection;
+ }
}