Merge "[MEP] Adding getSimSlotMapping Telephony API"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 09947f4..0d296b5 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -237,6 +237,8 @@
<!-- Needed to listen to changes in projection state. -->
<uses-permission android:name="android.permission.READ_PROJECTION_STATE"/>
+ <!-- Needed to access TelephonyProvider SIMINFO table. -->
+ <uses-permission android:name="android.permission.ACCESS_TELEPHONY_SIMINFO_DB"/>
<application android:name="PhoneApp"
android:persistent="true"
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 54a2c7b..9d9971c 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -518,7 +518,7 @@
<string name="puk2_locked" msgid="6497760825455461057">"SIM bloqueada con PUK2. Comunícate con el proveedor para desbloquearla."</string>
<string name="pin2_unblocked" msgid="4481107908727789303">"El PIN2 ya no está bloqueado."</string>
<string name="pin2_error_exception" msgid="8116103864600823641">"Error en la red o en la tarjeta SIM"</string>
- <string name="doneButton" msgid="7371209609238460207">"Finalizado"</string>
+ <string name="doneButton" msgid="7371209609238460207">"Listo"</string>
<string name="voicemail_settings_number_label" msgid="1265118640154688162">"Número de buzón de voz"</string>
<string name="card_title_dialing" msgid="8742182654254431781">"Marcando"</string>
<string name="card_title_redialing" msgid="18130232613559964">"Volviendo a marcar"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 06af4bc..738a019 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -638,12 +638,12 @@
<string name="phone_in_ecm_call_notification_text" msgid="653972232922670335">"Connessione dati disabilitata"</string>
<string name="phone_in_ecm_notification_complete_time" msgid="7341624337163082759">"Nessuna connessione dati fino alle ore <xliff:g id="COMPLETETIME">%s</xliff:g>"</string>
<plurals name="alert_dialog_exit_ecm" formatted="false" msgid="5425906903766466743">
+ <item quantity="one">The phone will be in Emergency Callback mode for <xliff:g id="COUNT_1">%s</xliff:g> minutes. While in this mode no applications using a data connection can be used. Do you want to exit now?</item>
<item quantity="other">Il telefono sarà in modalità Richiamata di emergenza per <xliff:g id="COUNT_1">%s</xliff:g> minuti. In questa modalità non è possibile utilizzare applicazioni che impiegano una connessione dati. Vuoi uscire ora?</item>
- <item quantity="one">Il telefono sarà in modalità Richiamata di emergenza per <xliff:g id="COUNT_0">%s</xliff:g> minuto. In questa modalità non è possibile utilizzare app che impiegano una connessione dati. Vuoi uscire ora?</item>
</plurals>
<plurals name="alert_dialog_not_avaialble_in_ecm" formatted="false" msgid="1152682528741457004">
+ <item quantity="one">The selected action isn\'t available while in the Emergency Callback mode. The phone will be in this mode for <xliff:g id="COUNT_1">%s</xliff:g> minutes. Do you want to exit now?</item>
<item quantity="other">L\'azione selezionata non è disponibile in modalità Richiamata di emergenza. Il telefono sarà in questa modalità per <xliff:g id="COUNT_1">%s</xliff:g> minuti. Vuoi uscire ora?</item>
- <item quantity="one">L\'azione selezionata non è disponibile in modalità Richiamata di emergenza. Il telefono sarà in questa modalità per <xliff:g id="COUNT_0">%s</xliff:g> minuto. Vuoi uscire ora?</item>
</plurals>
<string name="alert_dialog_in_ecm_call" msgid="1207545603149771978">"L\'azione selezionata non è disponibile in modalità di chiamata di emergenza."</string>
<string name="progress_dialog_exiting_ecm" msgid="9159080081676927217">"Uscita dalla modalità di richiamata di emergenza"</string>
@@ -653,8 +653,8 @@
<string name="phone_in_ecm_call_notification_text_without_data_restriction_hint" msgid="3747860785153531225">"Il telefono è in modalità di richiamata di emergenza"</string>
<string name="phone_in_ecm_notification_complete_time_without_data_restriction_hint" msgid="3690292264812050858">"Fino alle ore <xliff:g id="COMPLETETIME">%s</xliff:g>"</string>
<plurals name="alert_dialog_exit_ecm_without_data_restriction_hint" formatted="false" msgid="6477733043040328640">
+ <item quantity="one">Il telefono sarà in modalità di richiamata di emergenza per <xliff:g id="COUNT_1">%s</xliff:g> minuti.\nVuoi uscire ora?</item>
<item quantity="other">Il telefono sarà in modalità di richiamata di emergenza per <xliff:g id="COUNT_1">%s</xliff:g> minuti.\nVuoi uscire ora?</item>
- <item quantity="one">Il telefono sarà in modalità di richiamata di emergenza per <xliff:g id="COUNT_0">%s</xliff:g> minuto.\nVuoi uscire ora?</item>
</plurals>
<string name="voicemail_provider" msgid="4158806657253745294">"Servizio"</string>
<string name="voicemail_settings" msgid="4451045613238972776">"Configurazione"</string>
diff --git a/res/values-pa/strings.xml b/res/values-pa/strings.xml
index a63243f..7340540 100644
--- a/res/values-pa/strings.xml
+++ b/res/values-pa/strings.xml
@@ -338,24 +338,24 @@
<string name="enable_disable_maintenance" msgid="3824817751053035017">"ਪ੍ਰਬੰਧਨ"</string>
<string name="maintenance_enable" msgid="2646784483222342290">"ਪ੍ਰਬੰਧਨ ਸਮਰਥਿਤ"</string>
<string name="maintenance_disable" msgid="2121032601497725602">"ਪ੍ਰਬੰਧਨ ਅਸਮਰਥਿਤ"</string>
- <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="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="enable_disable_local" msgid="7654175079979415572">"ਸਥਾਨਕ"</string>
- <string name="local_enable" msgid="790606890868710629">"ਸਥਾਨਕ ਖ਼ਬਰਾਂ ਸਮਰਥਿਤ"</string>
- <string name="local_disable" msgid="7649945293198602877">"ਸਥਾਨਕ ਖ਼ਬਰਾਂ ਅਸਮਰਥਿਤ"</string>
+ <string name="local_enable" msgid="790606890868710629">"ਸਥਾਨਕ ਖਬਰਾਂ ਚਾਲੂ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
+ <string name="local_disable" msgid="7649945293198602877">"ਸਥਾਨਕ ਖਬਰਾਂ ਬੰਦ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
<string name="enable_disable_regional" msgid="5783403191376564638">"ਖੇਤਰੀ"</string>
- <string name="regional_enable" msgid="7730109417536296079">"ਖੇਤਰੀ ਖ਼ਬਰਾਂ ਸਮਰਥਿਤ"</string>
- <string name="regional_disable" msgid="3781951818157772545">"ਖੇਤਰੀ ਖ਼ਬਰਾਂ ਅਸਮਰਥਿਤ"</string>
+ <string name="regional_enable" msgid="7730109417536296079">"ਖੇਤਰੀ ਖਬਰਾਂ ਚਾਲੂ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
+ <string name="regional_disable" msgid="3781951818157772545">"ਖੇਤਰੀ ਖਬਰਾਂ ਬੰਦ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
<string name="enable_disable_national" msgid="6198481711934897632">"ਰਾਸ਼ਟਰੀ"</string>
- <string name="national_enable" msgid="5159683504138239304">"ਰਾਸ਼ਟਰੀ ਖ਼ਬਰਾਂ ਸਮਰਥਿਤ"</string>
- <string name="national_disable" msgid="8484356368757118987">"ਰਾਸ਼ਟਰੀ ਖ਼ਬਰਾਂ ਅਸਮਰਥਿਤ"</string>
+ <string name="national_enable" msgid="5159683504138239304">"ਰਾਸ਼ਟਰੀ ਖਬਰਾਂ ਚਾਲੂ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
+ <string name="national_disable" msgid="8484356368757118987">"ਰਾਸ਼ਟਰੀ ਖਬਰਾਂ ਬੰਦ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
<string name="enable_disable_international" msgid="4204334217211198792">"ਅੰਤਰਰਾਸ਼ਟਰੀ"</string>
- <string name="international_enable" msgid="8943466745792690340">"ਅੰਤਰਰਾਸ਼ਟਰੀ ਖ਼ਬਰਾਂ ਸਮਰਥਿਤ"</string>
- <string name="international_disable" msgid="4803498658100318265">"ਅੰਤਰਰਾਸ਼ਟਰੀ ਖ਼ਬਰਾਂ ਅਸਮਰਥਿਤ"</string>
+ <string name="international_enable" msgid="8943466745792690340">"ਅੰਤਰਰਾਸ਼ਟਰੀ ਖਬਰਾਂ ਚਾਲੂ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
+ <string name="international_disable" msgid="4803498658100318265">"ਅੰਤਰਰਾਸ਼ਟਰੀ ਖਬਰਾਂ ਬੰਦ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
<string name="list_language_title" msgid="1850167908665485738">"ਭਾਸ਼ਾ"</string>
- <string name="list_language_summary" msgid="7921756070782277559">"ਖ਼ਬਰਾਂ ਦੀ ਭਾਸ਼ਾ ਚੁਣੋ"</string>
+ <string name="list_language_summary" msgid="7921756070782277559">"ਖਬਰਾਂ ਦੀ ਭਾਸ਼ਾ ਚੁਣੋ"</string>
<string-array name="list_language_entries">
<item msgid="2347238508726934281">"ਅੰਗ੍ਰੇਜ਼ੀ"</item>
<item msgid="5172468397620875174">"ਫਰਾਂਸੀਸੀ"</item>
@@ -405,9 +405,9 @@
<string name="enable_disable_mhh" msgid="715930476289202466">"ਚਿਕਿਤਸਾ, ਸਿਹਤ ਅਤੇ ਹਸਪਤਾਲ"</string>
<string name="mhh_enable" msgid="7224396815285147008">"ਚਿਕਿਤਸਾ, ਸਿਹਤ ਅਤੇ ਹਸਪਤਾਲ ਸਮਰਥਿਤ"</string>
<string name="mhh_disable" msgid="5503643028885686265">"ਚਿਕਿਤਸਾ, ਸਿਹਤ ਅਤੇ ਹਸਪਤਾਲ ਅਸਮਰਥਿਤ"</string>
- <string name="enable_disable_technology_news" msgid="2794845609698078400">"ਟੈਕਨਾਲੋਜੀ ਖ਼ਬਰਾਂ"</string>
- <string name="technology_news_enable" msgid="1908991199492598311">"ਟੈਕਨਾਲੋਜੀ ਖ਼ਬਰਾਂ ਸਮਰਥਿਤ"</string>
- <string name="technology_news_disable" msgid="8388582607149800889">"ਟੈਕਨਾਲੋਜੀ ਖ਼ਬਰਾਂ ਅਸਮਰਥਿਤ"</string>
+ <string name="enable_disable_technology_news" msgid="2794845609698078400">"ਤਕਨਾਲੋਜੀ ਖਬਰਾਂ"</string>
+ <string name="technology_news_enable" msgid="1908991199492598311">"ਤਕਨਾਲੋਜੀ ਖਬਰਾਂ ਚਾਲੂ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
+ <string name="technology_news_disable" msgid="8388582607149800889">"ਤਕਨਾਲੋਜੀ ਖਬਰਾਂ ਬੰਦ ਕੀਤੀਆਂ ਗਈਆਂ"</string>
<string name="enable_disable_multi_category" msgid="5958248155437940625">"ਮਲਟੀ-ਸ਼੍ਰੇਣੀ"</string>
<string name="multi_category_enable" msgid="4531915767817483960">"ਮਲਟੀ-ਸ਼੍ਰੇਣੀ ਸਮਰਥਿਤ"</string>
<string name="multi_category_disable" msgid="6325934413701238104">"ਮਲਟੀ-ਸ਼੍ਰੇਣੀ ਅਸਮਰਥਿਤ"</string>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index bed887f..9b6d5df 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -638,12 +638,12 @@
<string name="phone_in_ecm_call_notification_text" msgid="653972232922670335">"Ligação de dados desativada"</string>
<string name="phone_in_ecm_notification_complete_time" msgid="7341624337163082759">"Sem ligação de dados até à(s) <xliff:g id="COMPLETETIME">%s</xliff:g>"</string>
<plurals name="alert_dialog_exit_ecm" formatted="false" msgid="5425906903766466743">
- <item quantity="other">O telemóvel fica no modo de Chamada de emergência durante <xliff:g id="COUNT_1">%s</xliff:g> minutos. Neste modo, não é possível utilizar aplicações com uma ligação de dados. Pretende sair agora?</item>
<item quantity="one">O telemóvel fica no modo de Chamada de emergência durante <xliff:g id="COUNT_0">%s</xliff:g> minuto. Neste modo, não é possível utilizar aplicações com uma ligação de dados. Pretende sair agora?</item>
+ <item quantity="other">O telemóvel fica no modo de Chamada de emergência durante <xliff:g id="COUNT_1">%s</xliff:g> minutos. Neste modo, não é possível utilizar aplicações com uma ligação de dados. Pretende sair agora?</item>
</plurals>
<plurals name="alert_dialog_not_avaialble_in_ecm" formatted="false" msgid="1152682528741457004">
- <item quantity="other">A ação selecionada não está disponível no modo de Chamada de emergência. O telemóvel fica neste modo durante <xliff:g id="COUNT_1">%s</xliff:g> minutos. Pretende sair agora?</item>
<item quantity="one">A ação selecionada não está disponível no modo de Chamada de emergência. O telemóvel fica neste modo durante <xliff:g id="COUNT_0">%s</xliff:g> minuto. Pretende sair agora?</item>
+ <item quantity="other">A ação selecionada não está disponível no modo de Chamada de emergência. O telemóvel fica neste modo durante <xliff:g id="COUNT_1">%s</xliff:g> minutos. Pretende sair agora?</item>
</plurals>
<string name="alert_dialog_in_ecm_call" msgid="1207545603149771978">"A ação selecionada não está disponível durante uma chamada de emergência."</string>
<string name="progress_dialog_exiting_ecm" msgid="9159080081676927217">"A sair do modo de chamada de retorno de emergência"</string>
@@ -653,8 +653,8 @@
<string name="phone_in_ecm_call_notification_text_without_data_restriction_hint" msgid="3747860785153531225">"O telemóvel está no modo de chamada de retorno de emergência."</string>
<string name="phone_in_ecm_notification_complete_time_without_data_restriction_hint" msgid="3690292264812050858">"Até à(s) <xliff:g id="COMPLETETIME">%s</xliff:g>."</string>
<plurals name="alert_dialog_exit_ecm_without_data_restriction_hint" formatted="false" msgid="6477733043040328640">
- <item quantity="other">O telemóvel ficará no modo de chamada de retorno de emergência durante <xliff:g id="COUNT_1">%s</xliff:g> minutos.\nPretende sair agora?</item>
<item quantity="one">O telemóvel ficará no modo de chamada de retorno de emergência durante <xliff:g id="COUNT_0">%s</xliff:g> minuto.\nPretende sair agora?</item>
+ <item quantity="other">O telemóvel ficará no modo de chamada de retorno de emergência durante <xliff:g id="COUNT_1">%s</xliff:g> minutos.\nPretende sair agora?</item>
</plurals>
<string name="voicemail_provider" msgid="4158806657253745294">"Serviço"</string>
<string name="voicemail_settings" msgid="4451045613238972776">"Configuração"</string>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 6353cb4..078a25b 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -849,8 +849,8 @@
<string name="radioInfo_menu_viewADN" msgid="4533179730908559846">"SIM అడ్రస్ పుస్తకాన్ని చూడండి"</string>
<string name="radioInfo_menu_viewFDN" msgid="1847236480527032061">"ఫిక్స్డ్ డయలింగ్ నంబర్లను చూడండి"</string>
<string name="radioInfo_menu_viewSDN" msgid="2613431584522392842">"సర్వీస్ డయలింగ్ నంబర్లను చూడండి"</string>
- <string name="radioInfo_menu_getIMS" msgid="1950869267853198232">"IMS సేవ స్థితి"</string>
- <string name="radio_info_ims_reg_status_title" msgid="6875885401313992007">"IMS స్థితి"</string>
+ <string name="radioInfo_menu_getIMS" msgid="1950869267853198232">"IMS సేవ స్టేటస్"</string>
+ <string name="radio_info_ims_reg_status_title" msgid="6875885401313992007">"IMS స్టేటస్"</string>
<string name="radio_info_ims_reg_status_registered" msgid="7095182114078864326">"నమోదు చేయబడింది"</string>
<string name="radio_info_ims_reg_status_not_registered" msgid="8045821447288876085">"నమోదు కాలేదు"</string>
<string name="radio_info_ims_feature_status_available" msgid="6493200914756969292">"అందుబాటులో ఉన్నారు"</string>
diff --git a/sip/res/values-te/strings.xml b/sip/res/values-te/strings.xml
index b646f9d..b821a60 100644
--- a/sip/res/values-te/strings.xml
+++ b/sip/res/values-te/strings.xml
@@ -36,7 +36,7 @@
<string name="alert_dialog_close" msgid="1734746505531110706">"ప్రొఫైల్ను మూసివేయండి"</string>
<string name="alert_dialog_ok" msgid="7806760618798687406">"సరే"</string>
<string name="close_profile" msgid="3756064641769751774">"మూసివేయి"</string>
- <string name="registration_status_checking_status" msgid="884179594507591180">"స్థితిని తనిఖీ చేస్తోంది..."</string>
+ <string name="registration_status_checking_status" msgid="884179594507591180">"స్టేటస్ని తనిఖీ చేస్తోంది..."</string>
<string name="registration_status_registering" msgid="7986331597809521791">"నమోదు చేస్తోంది…"</string>
<string name="registration_status_still_trying" msgid="7178623685868766282">"ఇప్పటికీ ప్రయత్నిస్తోంది..."</string>
<string name="registration_status_not_receiving" msgid="3873074208531938401">"కాల్స్ను స్వీకరించడం లేదు."</string>
diff --git a/src/com/android/phone/CallForwardEditPreference.java b/src/com/android/phone/CallForwardEditPreference.java
index db1c5b4..2cbb7c5 100644
--- a/src/com/android/phone/CallForwardEditPreference.java
+++ b/src/com/android/phone/CallForwardEditPreference.java
@@ -58,6 +58,7 @@
CarrierXmlParser.SsEntry.SSAction.UNKNOWN;
private int mAction;
private HashMap<String, String> mCfInfo;
+ private long mDelayMillisAfterUssdSet = 1000;
public CallForwardEditPreference(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -490,8 +491,9 @@
mPhone.getCallForwardingOption(reason, mServiceClass,
obtainMessage(MESSAGE_GET_CF, msg.arg1, MESSAGE_SET_CF, ar.exception));
} else {
- mHandler.sendMessage(mHandler.obtainMessage(mHandler.MESSAGE_GET_CF_USSD,
- msg.arg1, MyHandler.MESSAGE_SET_CF, ar.exception));
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(mHandler.MESSAGE_GET_CF_USSD,
+ msg.arg1, MyHandler.MESSAGE_SET_CF, ar.exception),
+ mDelayMillisAfterUssdSet);
}
}
diff --git a/src/com/android/phone/ImsRcsController.java b/src/com/android/phone/ImsRcsController.java
index 7d594d1..3618d58 100644
--- a/src/com/android/phone/ImsRcsController.java
+++ b/src/com/android/phone/ImsRcsController.java
@@ -582,6 +582,7 @@
throw new SecurityException("Passed in PackageName can not be found on device");
}
+ final int uid = Binder.getCallingUid();
final long identity = Binder.clearCallingIdentity();
SipTransportController transport = getRcsFeatureController(subId).getFeature(
SipTransportController.class);
@@ -590,7 +591,7 @@
"This subscription does not support the creation of SIP delegates");
}
try {
- transport.createSipDelegate(subId, request, packageName, delegateState,
+ transport.createSipDelegate(subId, uid, request, packageName, delegateState,
delegateMessage);
} catch (ImsException e) {
throw new ServiceSpecificException(e.getCode(), e.getMessage());
diff --git a/src/com/android/phone/settings/RadioInfo.java b/src/com/android/phone/settings/RadioInfo.java
index 7681a02..17adef3 100644
--- a/src/com/android/phone/settings/RadioInfo.java
+++ b/src/com/android/phone/settings/RadioInfo.java
@@ -1171,9 +1171,16 @@
if (s == null) s = r.getString(R.string.radioInfo_unknown);
mSubscriberId.setText(s);
- //FIXME: Replace with a TelephonyManager call
- s = mPhone.getLine1Number();
- if (s == null) s = r.getString(R.string.radioInfo_unknown);
+ SubscriptionManager subMgr = getSystemService(SubscriptionManager.class);
+ int subId = mPhone.getSubId();
+ s = subMgr.getPhoneNumber(subId)
+ + " { CARRIER:"
+ + subMgr.getPhoneNumber(subId, SubscriptionManager.PHONE_NUMBER_SOURCE_CARRIER)
+ + ", UICC:"
+ + subMgr.getPhoneNumber(subId, SubscriptionManager.PHONE_NUMBER_SOURCE_UICC)
+ + ", IMS:"
+ + subMgr.getPhoneNumber(subId, SubscriptionManager.PHONE_NUMBER_SOURCE_IMS)
+ + " }";
mLine1Number.setText(s);
}
diff --git a/src/com/android/services/telephony/rcs/DelegateStateTracker.java b/src/com/android/services/telephony/rcs/DelegateStateTracker.java
index 18aab88..64090d5 100644
--- a/src/com/android/services/telephony/rcs/DelegateStateTracker.java
+++ b/src/com/android/services/telephony/rcs/DelegateStateTracker.java
@@ -16,6 +16,10 @@
package com.android.services.telephony.rcs;
+import android.app.compat.CompatChanges;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.EnabledAfter;
+import android.os.Build;
import android.os.RemoteException;
import android.telephony.ims.DelegateRegistrationState;
import android.telephony.ims.FeatureTagState;
@@ -28,6 +32,7 @@
import android.util.LocalLog;
import android.util.Log;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.metrics.RcsStats;
import java.io.PrintWriter;
@@ -43,25 +48,58 @@
private static final String LOG_TAG = "DelegateST";
private final int mSubId;
+ private final int mUid;
private final ISipDelegateConnectionStateCallback mAppStateCallback;
private final ISipDelegate mLocalDelegateImpl;
private final LocalLog mLocalLog = new LocalLog(SipTransportController.LOG_SIZE);
+ private final RcsStats mRcsStats;
+
private List<FeatureTagState> mDelegateDeniedTags;
private DelegateRegistrationState mLastRegState;
private boolean mCreatedCalled = false;
private int mRegistrationStateOverride = -1;
-
+ private CompatChangesFactory mCompatChangesFactory;
private Set<String> mDelegateSupportedTags;
- private final RcsStats mRcsStats;
- public DelegateStateTracker(int subId, ISipDelegateConnectionStateCallback appStateCallback,
+ /**
+ * Interface for checking compatibility of apps
+ */
+ public interface CompatChangesFactory {
+ /**
+ * @param changeId The ID of the compatibility change.
+ * @param uid The UID of the app.
+ * @return {@code true} if the change is enabled for the current app.
+ */
+ boolean isChangeEnabled(long changeId, int uid);
+ }
+
+ /**
+ * For apps targeting Android T and above, support the REGISTERING state on APIs, such as
+ * {@code DelegateRegistrationState#addRegisteringFeatureTags} and
+ * {@code DelegateRegistrationState#getRegisteringFeatureTags}
+ * @hide
+ */
+ @ChangeId
+ @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.S)
+ @VisibleForTesting
+ public static final long SUPPORT_REGISTERING_DELEGATE_STATE = 205194548;
+
+ public DelegateStateTracker(int subId, int uid,
+ ISipDelegateConnectionStateCallback appStateCallback,
ISipDelegate localDelegateImpl, RcsStats rcsStats) {
mSubId = subId;
+ mUid = uid;
mAppStateCallback = appStateCallback;
mLocalDelegateImpl = localDelegateImpl;
mRcsStats = rcsStats;
+ setCompatChangesFactory((changeId, uid1) -> CompatChanges.isChangeEnabled(changeId, uid1));
+ }
+
+ @VisibleForTesting
+ protected void setCompatChangesFactory(CompatChangesFactory factory) {
+ mCompatChangesFactory = factory;
}
/**
@@ -140,6 +178,9 @@
*/
@Override
public void onRegistrationStateChanged(DelegateRegistrationState registrationState) {
+ if (!mCompatChangesFactory.isChangeEnabled(SUPPORT_REGISTERING_DELEGATE_STATE, mUid)) {
+ registrationState = overrideRegistrationForCompatibility(registrationState);
+ }
if (mRegistrationStateOverride > DelegateRegistrationState.DEREGISTERED_REASON_UNKNOWN) {
logi("onRegistrationStateChanged: overriding registered state to "
+ mRegistrationStateOverride);
@@ -204,6 +245,7 @@
private DelegateRegistrationState overrideRegistrationForDelegateChange(
int registerOverrideReason, DelegateRegistrationState state) {
Set<String> registeredFeatures = state.getRegisteredFeatureTags();
+ Set<String> registeringFeatures = state.getRegisteringFeatureTags();
DelegateRegistrationState.Builder overriddenState = new DelegateRegistrationState.Builder();
// keep other deregistering/deregistered tags the same.
for (FeatureTagState dereging : state.getDeregisteringFeatureTags()) {
@@ -214,13 +256,41 @@
overriddenState.addDeregisteredFeatureTag(dereged.getFeatureTag(),
dereged.getState());
}
- // Override REGISTERED only
+ // Override REGISTERING/REGISTERED
+ for (String ft : registeringFeatures) {
+ overriddenState.addDeregisteringFeatureTag(ft, registerOverrideReason);
+ }
for (String ft : registeredFeatures) {
overriddenState.addDeregisteringFeatureTag(ft, registerOverrideReason);
}
return overriddenState.build();
}
+ private DelegateRegistrationState overrideRegistrationForCompatibility(
+ DelegateRegistrationState state) {
+ Set<String> registeredFeatures = state.getRegisteredFeatureTags();
+ Set<String> registeringFeatures = state.getRegisteringFeatureTags();
+ DelegateRegistrationState.Builder overriddenState = new DelegateRegistrationState.Builder();
+ // keep other registered/deregistering/deregistered tags the same.
+ for (FeatureTagState dereging : state.getDeregisteringFeatureTags()) {
+ overriddenState.addDeregisteringFeatureTag(dereging.getFeatureTag(),
+ dereging.getState());
+ }
+ for (FeatureTagState dereged : state.getDeregisteredFeatureTags()) {
+ overriddenState.addDeregisteredFeatureTag(dereged.getFeatureTag(),
+ dereged.getState());
+ }
+ overriddenState.addRegisteredFeatureTags(registeredFeatures);
+
+ // move the REGISTERING state to the DEREGISTERED state.
+ for (String tag : registeringFeatures) {
+ overriddenState.addDeregisteredFeatureTag(tag,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_REGISTERED);
+ }
+
+ return overriddenState.build();
+ }
+
private void notifySipDelegateCreated() {
try {
mAppStateCallback.onCreated(mLocalDelegateImpl);
diff --git a/src/com/android/services/telephony/rcs/SipDelegateController.java b/src/com/android/services/telephony/rcs/SipDelegateController.java
index c728141..860a6d9 100644
--- a/src/com/android/services/telephony/rcs/SipDelegateController.java
+++ b/src/com/android/services/telephony/rcs/SipDelegateController.java
@@ -78,6 +78,7 @@
}
private final int mSubId;
+ private final int mUid;
private final String mPackageName;
private final DelegateRequest mInitialRequest;
private final ScheduledExecutorService mExecutorService;
@@ -89,12 +90,13 @@
private DelegateBinderStateManager mBinderConnection;
private Set<String> mTrackedFeatureTags;
- public SipDelegateController(int subId, DelegateRequest initialRequest, String packageName,
- ISipTransport transportImpl, IImsRegistration registrationImpl,
+ public SipDelegateController(int subId, int uid, DelegateRequest initialRequest,
+ String packageName, ISipTransport transportImpl, IImsRegistration registrationImpl,
ScheduledExecutorService executorService,
ISipDelegateConnectionStateCallback stateCallback,
ISipDelegateMessageCallback messageCallback) {
mSubId = subId;
+ mUid = uid;
mPackageName = packageName;
mInitialRequest = initialRequest;
mExecutorService = executorService;
@@ -102,7 +104,8 @@
mMessageTransportWrapper = new MessageTransportWrapper(mSubId, executorService,
messageCallback);
- mDelegateStateTracker = new DelegateStateTracker(mSubId, stateCallback,
+
+ mDelegateStateTracker = new DelegateStateTracker(mSubId, mUid, stateCallback,
mMessageTransportWrapper.getDelegateConnection(), RcsStats.getInstance());
}
@@ -110,12 +113,13 @@
* Inject dependencies for testing only.
*/
@VisibleForTesting
- public SipDelegateController(int subId, DelegateRequest initialRequest, String packageName,
- ScheduledExecutorService executorService,
+ public SipDelegateController(int subId, int uid, DelegateRequest initialRequest,
+ String packageName, ScheduledExecutorService executorService,
MessageTransportWrapper messageTransportWrapper,
DelegateStateTracker delegateStateTracker,
DelegateBinderStateManager.Factory connectionFactory) {
mSubId = subId;
+ mUid = uid;
mInitialRequest = initialRequest;
mPackageName = packageName;
mExecutorService = executorService;
diff --git a/src/com/android/services/telephony/rcs/SipTransportController.java b/src/com/android/services/telephony/rcs/SipTransportController.java
index 709e142..0aa3aa0 100644
--- a/src/com/android/services/telephony/rcs/SipTransportController.java
+++ b/src/com/android/services/telephony/rcs/SipTransportController.java
@@ -243,9 +243,9 @@
@VisibleForTesting
public interface SipDelegateControllerFactory {
/** See {@link SipDelegateController} */
- SipDelegateController create(int subId, DelegateRequest initialRequest, String packageName,
- ISipTransport sipTransportImpl, IImsRegistration registrationImpl,
- ScheduledExecutorService executorService,
+ SipDelegateController create(int subId, int uid, DelegateRequest initialRequest,
+ String packageName, ISipTransport sipTransportImpl,
+ IImsRegistration registrationImpl, ScheduledExecutorService executorService,
ISipDelegateConnectionStateCallback stateCallback,
ISipDelegateMessageCallback messageCallback);
}
@@ -364,17 +364,18 @@
* {@link ISipDelegateConnectionStateCallback#onCreated(ISipDelegate)} must be called with
* the AIDL instance corresponding to the remote {@link SipDelegate}.
* @param subId the subId associated with the request.
+ * @param uid the uid associated with the request
* @param request The request parameters used to create the {@link SipDelegate}.
* @param delegateState The {@link DelegateConnectionStateCallback} Binder connection.
* @param delegateMessage The {@link DelegateConnectionMessageCallback} Binder Connection
* @throws ImsException if the request to create the {@link SipDelegate} did not complete.
*/
- public void createSipDelegate(int subId, DelegateRequest request, String packageName,
+ public void createSipDelegate(int subId, int uid, DelegateRequest request, String packageName,
ISipDelegateConnectionStateCallback delegateState,
ISipDelegateMessageCallback delegateMessage) throws ImsException {
logi("createSipDelegate: request= " + request + ", packageName= " + packageName);
CompletableFuture<ImsException> result = new CompletableFuture<>();
- mExecutorService.submit(() -> createSipDelegateInternal(subId, request, packageName,
+ mExecutorService.submit(() -> createSipDelegateInternal(subId, uid, request, packageName,
delegateState,
// Capture any ImsExceptions generated during the process.
delegateMessage, result::complete));
@@ -423,8 +424,8 @@
return result;
}
- private void createSipDelegateInternal(int subId, DelegateRequest request, String packageName,
- ISipDelegateConnectionStateCallback delegateState,
+ private void createSipDelegateInternal(int subId, int uid, DelegateRequest request,
+ String packageName, ISipDelegateConnectionStateCallback delegateState,
ISipDelegateMessageCallback delegateMessage,
Consumer<ImsException> startedErrorConsumer) {
ISipTransport transport;
@@ -450,8 +451,9 @@
return;
}
- SipDelegateController c = mDelegateControllerFactory.create(subId, request, packageName,
- transport, registration, mExecutorService, delegateState, delegateMessage);
+ SipDelegateController c = mDelegateControllerFactory.create(subId, uid, request,
+ packageName, transport, registration, mExecutorService, delegateState,
+ delegateMessage);
logi("createSipDelegateInternal: request= " + request + ", packageName= " + packageName
+ ", controller created: " + c);
addPendingCreateAndEvaluate(c);
diff --git a/tests/src/com/android/services/telephony/rcs/DelegateStateTrackerTest.java b/tests/src/com/android/services/telephony/rcs/DelegateStateTrackerTest.java
index 25b5339..0eb19e7 100644
--- a/tests/src/com/android/services/telephony/rcs/DelegateStateTrackerTest.java
+++ b/tests/src/com/android/services/telephony/rcs/DelegateStateTrackerTest.java
@@ -16,6 +16,8 @@
package com.android.services.telephony.rcs;
+import static com.android.services.telephony.rcs.DelegateStateTracker.SUPPORT_REGISTERING_DELEGATE_STATE;
+
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -24,7 +26,9 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import android.app.compat.CompatChanges;
import android.net.InetAddresses;
+import android.os.Binder;
import android.telephony.ims.DelegateRegistrationState;
import android.telephony.ims.FeatureTagState;
import android.telephony.ims.SipDelegateConfiguration;
@@ -33,8 +37,8 @@
import android.telephony.ims.aidl.ISipDelegateConnectionStateCallback;
import android.util.ArraySet;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
import com.android.TelephonyTestBase;
import com.android.internal.telephony.metrics.RcsStats;
@@ -77,8 +81,8 @@
@SmallTest
@Test
public void testDelegateCreated() throws Exception {
- DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID, mAppCallback,
- mSipDelegate, mRcsStats);
+ DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID,
+ Binder.getCallingUid(), mAppCallback, mSipDelegate, mRcsStats);
Set<FeatureTagState> deniedTags = getMmTelDeniedTag();
Set<String> supportedTags = getSupportedTags();
stateTracker.sipDelegateConnected(supportedTags, deniedTags);
@@ -114,8 +118,8 @@
@SmallTest
@Test
public void testDelegateDestroyed() throws Exception {
- DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID, mAppCallback,
- mSipDelegate, mRcsStats);
+ DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID,
+ Binder.getCallingUid(), mAppCallback, mSipDelegate, mRcsStats);
Set<FeatureTagState> deniedTags = getMmTelDeniedTag();
Set<String> supportedTags = getSupportedTags();
stateTracker.sipDelegateConnected(supportedTags, deniedTags);
@@ -139,39 +143,75 @@
@SmallTest
@Test
public void testDelegateChangingRegisteredTagsOverride() throws Exception {
- DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID, mAppCallback,
- mSipDelegate, mRcsStats);
+ DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID,
+ Binder.getCallingUid(), mAppCallback, mSipDelegate, mRcsStats);
Set<FeatureTagState> deniedTags = getMmTelDeniedTag();
Set<String> supportedTags = getSupportedTags();
+ Set<String> registeringTags = getRegisteringTag();
stateTracker.sipDelegateConnected(supportedTags, deniedTags);
+
// SipDelegate created
verify(mAppCallback).onCreated(mSipDelegate);
+
DelegateRegistrationState regState = new DelegateRegistrationState.Builder()
.addRegisteredFeatureTag(ImsSignallingUtils.ONE_TO_ONE_CHAT_TAG)
+ .addRegisteringFeatureTags(registeringTags)
.addDeregisteringFeatureTag(ImsSignallingUtils.FILE_TRANSFER_HTTP_TAG,
DelegateRegistrationState.DEREGISTERING_REASON_PROVISIONING_CHANGE)
.addDeregisteredFeatureTag(ImsSignallingUtils.GROUP_CHAT_TAG,
DelegateRegistrationState.DEREGISTERED_REASON_NOT_PROVISIONED)
.build();
+
stateTracker.onRegistrationStateChanged(regState);
// Simulate underlying SipDelegate switch
stateTracker.sipDelegateChanging(
DelegateRegistrationState.DEREGISTERING_REASON_FEATURE_TAGS_CHANGING);
// onFeatureTagStatusChanged should now be called with registered features overridden with
// DEREGISTERING_REASON_FEATURE_TAGS_CHANGING
- DelegateRegistrationState overrideRegState = new DelegateRegistrationState.Builder()
+ DelegateRegistrationState.Builder overrideBuilder =
+ new DelegateRegistrationState.Builder()
.addDeregisteringFeatureTag(ImsSignallingUtils.ONE_TO_ONE_CHAT_TAG,
DelegateRegistrationState.DEREGISTERING_REASON_FEATURE_TAGS_CHANGING)
// Already Deregistering/Deregistered tags should not be overridden.
.addDeregisteringFeatureTag(ImsSignallingUtils.FILE_TRANSFER_HTTP_TAG,
DelegateRegistrationState.DEREGISTERING_REASON_PROVISIONING_CHANGE)
.addDeregisteredFeatureTag(ImsSignallingUtils.GROUP_CHAT_TAG,
- DelegateRegistrationState.DEREGISTERED_REASON_NOT_PROVISIONED)
- .build();
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_PROVISIONED);
+ if (CompatChanges.isChangeEnabled(SUPPORT_REGISTERING_DELEGATE_STATE,
+ Binder.getCallingUid())) {
+ for (String tag : registeringTags) {
+ overrideBuilder.addDeregisteringFeatureTag(tag,
+ DelegateRegistrationState.DEREGISTERING_REASON_FEATURE_TAGS_CHANGING);
+ }
+ } else {
+ for (String tag : registeringTags) {
+ overrideBuilder.addDeregisteredFeatureTag(tag,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_REGISTERED);
+ }
+ }
+
+ DelegateRegistrationState overrideRegState = overrideBuilder.build();
+
// new underlying SipDelegate created
stateTracker.sipDelegateConnected(supportedTags, deniedTags);
stateTracker.onRegistrationStateChanged(regState);
+ DelegateRegistrationState.Builder builder = new DelegateRegistrationState.Builder()
+ .addRegisteredFeatureTag(ImsSignallingUtils.ONE_TO_ONE_CHAT_TAG)
+ .addDeregisteringFeatureTag(ImsSignallingUtils.FILE_TRANSFER_HTTP_TAG,
+ DelegateRegistrationState.DEREGISTERING_REASON_PROVISIONING_CHANGE)
+ .addDeregisteredFeatureTag(ImsSignallingUtils.GROUP_CHAT_TAG,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_PROVISIONED);
+ if (CompatChanges.isChangeEnabled(SUPPORT_REGISTERING_DELEGATE_STATE,
+ Binder.getCallingUid())) {
+ builder.addRegisteringFeatureTags(registeringTags);
+ } else {
+ for (String tag : registeringTags) {
+ builder.addDeregisteredFeatureTag(tag,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_REGISTERED);
+ }
+ }
+ DelegateRegistrationState regStateResult = builder.build();
// Verify registration state through the process:
ArgumentCaptor<DelegateRegistrationState> regCaptor =
ArgumentCaptor.forClass(DelegateRegistrationState.class);
@@ -179,11 +219,11 @@
regCaptor.capture(), eq(new ArrayList<>(deniedTags)));
List<DelegateRegistrationState> testStates = regCaptor.getAllValues();
// feature tags should first be registered
- assertEquals(regState, testStates.get(0));
+ assertEquals(regStateResult, testStates.get(0));
// registered feature tags should have moved to deregistering
assertEquals(overrideRegState, testStates.get(1));
// and then moved back to registered after underlying FT change done.
- assertEquals(regState, testStates.get(2));
+ assertEquals(regStateResult, testStates.get(2));
//onCreate should only have been called once and onDestroy should have never been called.
verify(mAppCallback).onCreated(mSipDelegate);
@@ -191,14 +231,102 @@
}
/**
+ * When registration states are changed in a case that an application doesn't support the new
+ * 'registering' state the 'registering' state will be moved to the 'registered' state
+ * as the old behavior.
+ */
+ @Test
+ public void testDelegateChangingRegisteredTagsRegisteringDisable() throws Exception {
+ DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID,
+ Binder.getCallingUid(), mAppCallback, mSipDelegate, mRcsStats);
+ stateTracker.setCompatChangesFactory((changeId, uid) -> false);
+ Set<FeatureTagState> deniedTags = getMmTelDeniedTag();
+ Set<String> supportedTags = getSupportedTags();
+ Set<String> registeringTags = getRegisteringTag();
+ stateTracker.sipDelegateConnected(supportedTags, deniedTags);
+ // SipDelegate created
+ verify(mAppCallback).onCreated(mSipDelegate);
+ DelegateRegistrationState regState = new DelegateRegistrationState.Builder()
+ .addRegisteredFeatureTag(ImsSignallingUtils.ONE_TO_ONE_CHAT_TAG)
+ .addRegisteringFeatureTags(registeringTags)
+ .addDeregisteringFeatureTag(ImsSignallingUtils.FILE_TRANSFER_HTTP_TAG,
+ DelegateRegistrationState.DEREGISTERING_REASON_PROVISIONING_CHANGE)
+ .addDeregisteredFeatureTag(ImsSignallingUtils.GROUP_CHAT_TAG,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_PROVISIONED)
+ .build();
+ stateTracker.onRegistrationStateChanged(regState);
+
+ DelegateRegistrationState.Builder builder = new DelegateRegistrationState.Builder()
+ .addRegisteredFeatureTag(ImsSignallingUtils.ONE_TO_ONE_CHAT_TAG)
+ .addDeregisteringFeatureTag(ImsSignallingUtils.FILE_TRANSFER_HTTP_TAG,
+ DelegateRegistrationState.DEREGISTERING_REASON_PROVISIONING_CHANGE)
+ .addDeregisteredFeatureTag(ImsSignallingUtils.GROUP_CHAT_TAG,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_PROVISIONED);
+ for (String tag : registeringTags) {
+ builder.addDeregisteredFeatureTag(tag,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_REGISTERED);
+ }
+ DelegateRegistrationState overrideRegState = builder.build();
+
+
+ // Verify registration state through the process:
+ ArgumentCaptor<DelegateRegistrationState> regCaptor =
+ ArgumentCaptor.forClass(DelegateRegistrationState.class);
+ verify(mAppCallback, times(1)).onFeatureTagStatusChanged(
+ regCaptor.capture(), eq(new ArrayList<>(deniedTags)));
+ List<DelegateRegistrationState> testStates = regCaptor.getAllValues();
+
+ assertEquals(overrideRegState, testStates.get(0));
+ verify(mAppCallback).onCreated(mSipDelegate);
+ }
+
+ /**
+ * When registration states are changed in a case that an application supports the new
+ * 'registering' state the state will be kept.
+ */
+ @Test
+ public void testDelegateChangingRegisteredTagsRegisteringEnable() throws Exception {
+ DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID,
+ Binder.getCallingUid(), mAppCallback, mSipDelegate, mRcsStats);
+ stateTracker.setCompatChangesFactory((changeId, uid) -> true);
+ Set<FeatureTagState> deniedTags = getMmTelDeniedTag();
+ Set<String> supportedTags = getSupportedTags();
+ Set<String> registeringTags = getRegisteringTag();
+ stateTracker.sipDelegateConnected(supportedTags, deniedTags);
+ // SipDelegate created
+ verify(mAppCallback).onCreated(mSipDelegate);
+
+ DelegateRegistrationState regState = new DelegateRegistrationState.Builder()
+ .addRegisteredFeatureTag(ImsSignallingUtils.ONE_TO_ONE_CHAT_TAG)
+ .addRegisteringFeatureTags(registeringTags)
+ .addDeregisteringFeatureTag(ImsSignallingUtils.FILE_TRANSFER_HTTP_TAG,
+ DelegateRegistrationState.DEREGISTERING_REASON_PROVISIONING_CHANGE)
+ .addDeregisteredFeatureTag(ImsSignallingUtils.GROUP_CHAT_TAG,
+ DelegateRegistrationState.DEREGISTERED_REASON_NOT_PROVISIONED)
+ .build();
+ stateTracker.onRegistrationStateChanged(regState);
+
+ // Verify registration state through the process:
+ ArgumentCaptor<DelegateRegistrationState> regCaptor =
+ ArgumentCaptor.forClass(DelegateRegistrationState.class);
+ verify(mAppCallback, times(1)).onFeatureTagStatusChanged(
+ regCaptor.capture(), eq(new ArrayList<>(deniedTags)));
+ List<DelegateRegistrationState> testStates = regCaptor.getAllValues();
+
+ assertEquals(regState, testStates.get(0));
+ verify(mAppCallback).onCreated(mSipDelegate);
+ }
+
+
+ /**
* Test the case that when the underlying Denied tags change in the SipDelegate, the change is
* properly shown in the registration update event.
*/
@SmallTest
@Test
public void testDelegateChangingDeniedTagsChanged() throws Exception {
- DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID, mAppCallback,
- mSipDelegate, mRcsStats);
+ DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID,
+ Binder.getCallingUid(), mAppCallback, mSipDelegate, mRcsStats);
Set<FeatureTagState> deniedTags = getMmTelDeniedTag();
Set<String> supportedTags = getSupportedTags();
stateTracker.sipDelegateConnected(supportedTags, deniedTags);
@@ -255,8 +383,8 @@
@SmallTest
@Test
public void testDelegateChangingDeniedTagsChangingToDestroy() throws Exception {
- DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID, mAppCallback,
- mSipDelegate, mRcsStats);
+ DelegateStateTracker stateTracker = new DelegateStateTracker(TEST_SUB_ID,
+ Binder.getCallingUid(), mAppCallback, mSipDelegate, mRcsStats);
Set<FeatureTagState> deniedTags = getMmTelDeniedTag();
Set<String> supportedTags = getSupportedTags();
stateTracker.sipDelegateConnected(supportedTags, deniedTags);
@@ -316,4 +444,11 @@
supportedTags.add(ImsSignallingUtils.GROUP_CHAT_TAG);
return supportedTags;
}
+
+ private Set<String> getRegisteringTag() {
+ Set<String> registeringTags = new ArraySet<>();
+ registeringTags.add(ImsSignallingUtils.CHATBOT_COMMUNICATION_USING_SESSION_TAG);
+ return registeringTags;
+
+ }
}
diff --git a/tests/src/com/android/services/telephony/rcs/ImsSignallingUtils.java b/tests/src/com/android/services/telephony/rcs/ImsSignallingUtils.java
index d607f6d..0e725e0 100644
--- a/tests/src/com/android/services/telephony/rcs/ImsSignallingUtils.java
+++ b/tests/src/com/android/services/telephony/rcs/ImsSignallingUtils.java
@@ -28,4 +28,6 @@
"+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gppservice.ims.icsi.oma.cpm.session\"";
public static final String FILE_TRANSFER_HTTP_TAG =
"+g.3gpp.iari-ref=\"urn%3Aurn-7%3A3gppapplication.ims.iari.rcs.fthttp\"";
+ public static final String CHATBOT_COMMUNICATION_USING_SESSION_TAG =
+ "+g.3gpp.iari-ref=\"urn%3Aurn-7%3A3gpp-application.ims.iari.rcs.chatbot\"";
}
diff --git a/tests/src/com/android/services/telephony/rcs/SipDelegateControllerTest.java b/tests/src/com/android/services/telephony/rcs/SipDelegateControllerTest.java
index 78f6894..575b81e 100644
--- a/tests/src/com/android/services/telephony/rcs/SipDelegateControllerTest.java
+++ b/tests/src/com/android/services/telephony/rcs/SipDelegateControllerTest.java
@@ -30,6 +30,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.os.Binder;
import android.telephony.ims.DelegateRegistrationState;
import android.telephony.ims.DelegateRequest;
import android.telephony.ims.FeatureTagState;
@@ -291,8 +292,8 @@
private SipDelegateController getTestDelegateController(DelegateRequest request,
Set<FeatureTagState> deniedSet) {
- return new SipDelegateController(TEST_SUB_ID, request, "", mExecutorService,
- mMockMessageTracker, mMockDelegateStateTracker,
+ return new SipDelegateController(TEST_SUB_ID, Binder.getCallingUid(), request, "",
+ mExecutorService, mMockMessageTracker, mMockDelegateStateTracker,
(a, b, deniedFeatureSet, d, e) -> {
assertEquals(deniedSet, deniedFeatureSet);
return mMockBinderConnection;
diff --git a/tests/src/com/android/services/telephony/rcs/SipTransportControllerTest.java b/tests/src/com/android/services/telephony/rcs/SipTransportControllerTest.java
index 0f139f8..42a45f4 100644
--- a/tests/src/com/android/services/telephony/rcs/SipTransportControllerTest.java
+++ b/tests/src/com/android/services/telephony/rcs/SipTransportControllerTest.java
@@ -78,6 +78,7 @@
@RunWith(AndroidJUnit4.class)
public class SipTransportControllerTest extends TelephonyTestBase {
private static final int TEST_SUB_ID = 1;
+ private static final int TEST_UID = 1001;
private static final String TEST_PACKAGE_NAME = "com.test_pkg";
private static final String TEST_PACKAGE_NAME_2 = "com.test_pkg2";
private static final int TIMEOUT_MS = 200;
@@ -132,13 +133,13 @@
mSmsPackageName.add(TEST_PACKAGE_NAME);
doAnswer(invocation -> {
Integer subId = invocation.getArgument(0);
- String packageName = invocation.getArgument(2);
- DelegateRequest request = invocation.getArgument(1);
+ String packageName = invocation.getArgument(3);
+ DelegateRequest request = invocation.getArgument(2);
SipDelegateController c = getMockDelegateController(subId, packageName, request);
assertNotNull("create called with no corresponding controller set up", c);
return c;
- }).when(mMockDelegateControllerFactory).create(anyInt(), any(), anyString(), any(), any(),
- any(), any(), any());
+ }).when(mMockDelegateControllerFactory).create(anyInt(), anyInt(), any(), anyString(),
+ any(), any(), any(), any(), any());
setFeatureAllowedConfig(TEST_SUB_ID, new String[]{ImsSignallingUtils.MMTEL_TAG,
ImsSignallingUtils.ONE_TO_ONE_CHAT_TAG, ImsSignallingUtils.GROUP_CHAT_TAG,
ImsSignallingUtils.FILE_TRANSFER_HTTP_TAG});
@@ -254,7 +255,7 @@
doReturn(mSipTransport).when(mRcsManager).getSipTransport();
controller.onRcsConnected(mRcsManager);
try {
- controller.createSipDelegate(TEST_SUB_ID + 1,
+ controller.createSipDelegate(TEST_SUB_ID + 1, TEST_UID,
new DelegateRequest(Collections.emptySet()), TEST_PACKAGE_NAME,
mock(ISipDelegateConnectionStateCallback.class),
mock(ISipDelegateMessageCallback.class));
@@ -271,7 +272,7 @@
doReturn(null).when(mRcsManager).getSipTransport();
controller.onRcsConnected(mRcsManager);
try {
- controller.createSipDelegate(TEST_SUB_ID,
+ controller.createSipDelegate(TEST_SUB_ID, TEST_UID,
new DelegateRequest(Collections.emptySet()), TEST_PACKAGE_NAME,
mock(ISipDelegateConnectionStateCallback.class),
mock(ISipDelegateMessageCallback.class));
@@ -289,7 +290,7 @@
.when(mRcsManager).getSipTransport();
// No RCS connected message
try {
- controller.createSipDelegate(TEST_SUB_ID,
+ controller.createSipDelegate(TEST_SUB_ID, TEST_UID,
new DelegateRequest(Collections.emptySet()), TEST_PACKAGE_NAME,
mock(ISipDelegateConnectionStateCallback.class),
mock(ISipDelegateMessageCallback.class));
@@ -812,7 +813,7 @@
CompletableFuture<Boolean> pendingChange = setChangeSupportedFeatureTagsFuture(
delegateControllerContainer.delegateController, allowedTags, deniedTags);
try {
- controller.createSipDelegate(delegateControllerContainer.subId,
+ controller.createSipDelegate(delegateControllerContainer.subId, TEST_UID,
delegateControllerContainer.delegateRequest,
delegateControllerContainer.packageName,
delegateControllerContainer.mockDelegateConnectionCallback,