Change the fallback sender name to "Name not available" am: 4332ee73e7
am: 478b1acf29
Change-Id: Ib007213f4f8c9ca5e906cb23867e60f4e4f4c50e
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6f6cbf7..1752ce8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -41,6 +41,9 @@
<string name="sms_channel_name">SMS Channel</string>
<string name="sms_channel_description">Phone SMS Receiver Service</string>
+ <!-- Default Sender name that appears in message notification if sender name is not available. [CHAR_LIMIT=NONE] -->
+ <string name="name_not_available">Name not available</string>
+
<string name="app_running_msg_channel_name">Uncategorized</string>
<string name="app_running_msg_notification_title">Messaging service is active</string>
<string name="app_running_msg_notification_content">Receiving SMS through Bluetooth</string>
diff --git a/src/com/android/car/messenger/MessengerDelegate.java b/src/com/android/car/messenger/MessengerDelegate.java
index ad2ee6a..e2a9035 100644
--- a/src/com/android/car/messenger/MessengerDelegate.java
+++ b/src/com/android/car/messenger/MessengerDelegate.java
@@ -50,8 +50,6 @@
/** Delegate class responsible for handling messaging service actions */
public class MessengerDelegate implements BluetoothMonitor.OnBluetoothEventListener {
private static final String TAG = "CM.MessengerDelegate";
- // Static user name for building a MessagingStyle.
- private static final String STATIC_USER_NAME = "STATIC_USER_NAME";
private static final Object mMapClientLock = new Object();
private final Context mContext;
@@ -348,7 +346,7 @@
List<Action> actions = getNotificationActions(senderKey, notificationId);
Person user = new Person.Builder()
- .setName(STATIC_USER_NAME)
+ .setName(mContext.getString(R.string.name_not_available))
.build();
MessagingStyle messagingStyle = new MessagingStyle(user);
Person sender = new Person.Builder()