From dee030fa20b4f659a2970680554ee5c264552b21 Mon Sep 17 00:00:00 2001 From: maxwelb Date: Wed, 9 Aug 2017 13:34:36 -0700 Subject: 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 --- java/com/android/incallui/StatusBarNotifier.java | 17 +++++++++------ java/com/android/incallui/res/values/strings.xml | 27 +++++++++++++----------- 2 files changed, 26 insertions(+), 18 deletions(-) (limited to 'java/com') 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 @@ Ongoing call Ongoing work call - - Ongoing Wi\u2011Fi call - - Ongoing Wi\u2011Fi work call + + + Ongoing %1$s + + + Incoming %1$s + + + Wi\u2011Fi call + + + Wi\u2011Fi work call + On hold @@ -124,12 +133,6 @@ Incoming work call - - Incoming Wi\u2011Fi call - - Incoming Wi\u2011Fi work call Incoming suspected spam call -- cgit v1.2.3