diff options
author | maxwelb <maxwelb@google.com> | 2017-08-09 13:34:36 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-09 17:36:04 -0700 |
commit | dee030fa20b4f659a2970680554ee5c264552b21 (patch) | |
tree | bafb9c8a4cf6e05d7a2f2137e80cb622e8428fbf | |
parent | 3edf1abd74ee1aaeaee7d152b7658922916a4201 (diff) |
Add special WiFi calling strings for Vodafone
Vodafone specifically wants the ongoing notification to display as "WiFi
call", rather than "WLAN...". It appears that our specific settings for
mcc262-mnc01 are used for mcc2620-mnc02, which is why the string doesn't
show properly.
This CL adds a specific strings.xml file for mcc2620-mnc02 to fix the
issue. Additionally, VF does not want these strings to be translated,
hence the 'translatable="false"'. I confirmed that this string will have
a separare message id from the strings in values/strings.xml and so
won't interfere with the translations.
Since it's just the "WiFi call" which must not be translated, this CL
refactors how we choose the content string for Wifi call notifications.
This change could have applied to the rest of the logic, but was not to
keep the change minimal for OC DR. I filed http://b/64525903 to track
work to fix up the logic.
See the related framework changes:
http://ag/q/topic:wificall_no_tr+(status:open+OR+status:merged)
Screenshot:
https://screenshot.googleplex.com/3DS74zm9bBM
Bug: 64487733
Test: StatusBarNotifierTest
PiperOrigin-RevId: 164765234
Change-Id: Ic3e7a60316cf1748259f61d5c5abd95b0303e69d
-rw-r--r-- | java/com/android/incallui/StatusBarNotifier.java | 17 | ||||
-rw-r--r-- | java/com/android/incallui/res/values/strings.xml | 27 |
2 files changed, 26 insertions, 18 deletions
diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java index 03e119efe..07f179edc 100644 --- a/java/com/android/incallui/StatusBarNotifier.java +++ b/java/com/android/incallui/StatusBarNotifier.java @@ -155,10 +155,6 @@ public class StatusBarNotifier private static int getWorkStringFromPersonalString(int resId) { if (resId == R.string.notification_ongoing_call) { return R.string.notification_ongoing_work_call; - } else if (resId == R.string.notification_ongoing_call_wifi) { - return R.string.notification_ongoing_work_call_wifi; - } else if (resId == R.string.notification_incoming_call_wifi) { - return R.string.notification_incoming_work_call_wifi; } else if (resId == R.string.notification_incoming_call) { return R.string.notification_incoming_work_call; } else { @@ -696,8 +692,9 @@ public class StatusBarNotifier } int resId = R.string.notification_ongoing_call; + String wifiBrand = mContext.getString(R.string.notification_call_wifi_brand); if (call.hasProperty(Details.PROPERTY_WIFI)) { - resId = R.string.notification_ongoing_call_wifi; + resId = R.string.notification_ongoing_call_wifi_template; } if (isIncomingOrWaiting) { @@ -706,7 +703,8 @@ public class StatusBarNotifier } else if (shouldShowEnrichedCallNotification(call.getEnrichedCallSession())) { resId = getECIncomingCallText(call.getEnrichedCallSession()); } else if (call.hasProperty(Details.PROPERTY_WIFI)) { - resId = R.string.notification_incoming_call_wifi; + resId = R.string.notification_incoming_call_wifi_template; + } else { resId = R.string.notification_incoming_call; } @@ -723,6 +721,13 @@ public class StatusBarNotifier boolean isWorkCall = call.hasProperty(PROPERTY_ENTERPRISE_CALL); if (userType == ContactsUtils.USER_TYPE_WORK || isWorkCall) { resId = getWorkStringFromPersonalString(resId); + wifiBrand = mContext.getString(R.string.notification_call_wifi_work_brand); + } + + if (resId == R.string.notification_incoming_call_wifi_template + || resId == R.string.notification_ongoing_call_wifi_template) { + // TODO(b/64525903): Potentially apply this template logic everywhere. + return mContext.getString(resId, wifiBrand); } return mContext.getString(resId); diff --git a/java/com/android/incallui/res/values/strings.xml b/java/com/android/incallui/res/values/strings.xml index 4113313df..22c3c23cc 100644 --- a/java/com/android/incallui/res/values/strings.xml +++ b/java/com/android/incallui/res/values/strings.xml @@ -76,12 +76,21 @@ <string name="notification_ongoing_call">Ongoing call</string> <!-- The "label" of the in-call Notification for an ongoing work call. [CHAR LIMIT=60] --> <string name="notification_ongoing_work_call">Ongoing work call</string> - <!-- The "label" of the in-call Notification for an ongoing call, which is being made over - Wi-Fi. [CHAR LIMIT=60] --> - <string name="notification_ongoing_call_wifi">Ongoing Wi\u2011Fi call</string> - <!-- The "label" of the in-call Notification for an ongoing work call, which is being made - over Wi-Fi. [CHAR LIMIT=60] --> - <string name="notification_ongoing_work_call_wifi">Ongoing Wi\u2011Fi work call</string> + + <!-- Template for the label on the in-call Notification for an ongoing call, which is being made + over Wi-Fi. The format argument is @string/notification_call_wifi_brand [CHAR LIMIT=20]--> + <string name="notification_ongoing_call_wifi_template">Ongoing <xliff:g id="brand_name">%1$s</xliff:g></string> + + <!-- Template for the label of the in-call Notification for an incoming call, which is being made + over Wi-Fi. The format argument is @string/notification_call_wifi_brand [CHAR LIMIT=20] --> + <string name="notification_incoming_call_wifi_template">Incoming <xliff:g id="brand_name">%1$s</xliff:g></string> + + <!-- "Brand name" for WiFi calls. Will be overridden for specific mcc-mnc combinations [CHAR LIMIT=40]--> + <string name="notification_call_wifi_brand">Wi\u2011Fi call</string> + + <!-- "Brand name" for WiFi work calls. Will be overridden for specific mcc-mnc combinations [CHAR LIMIT=40] --> + <string name="notification_call_wifi_work_brand">Wi\u2011Fi work call</string> + <!-- The "label" of the in-call Notification for a call that's on hold --> <string name="notification_on_hold">On hold</string> <!-- The "label" of the in-call Notification for an incoming ringing call. [CHAR LIMIT=60] --> @@ -124,12 +133,6 @@ <!-- The "label" of the in-call Notification for an incoming ringing call. [CHAR LIMIT=60] --> <string name="notification_incoming_work_call">Incoming work call</string> - <!-- The "label" of the in-call Notification for an incoming ringing call, - which is being made over Wi-Fi. [CHAR LIMIT=60] --> - <string name="notification_incoming_call_wifi">Incoming Wi\u2011Fi call</string> - <!-- The "label" of the in-call Notification for an incoming ringing work call, - which is being made over Wi-Fi. [CHAR LIMIT=60] --> - <string name="notification_incoming_work_call_wifi">Incoming Wi\u2011Fi work call</string> <!-- The "label" of the in-call Notification for an incoming ringing spam call. --> <string name="notification_incoming_spam_call">Incoming suspected spam call</string> <!-- The "label" of the in-call Notification for upgrading an existing call to a video call. --> |