summaryrefslogtreecommitdiff
path: root/src/com/android/car
diff options
context:
space:
mode:
authorRitwika Mitra <ritwikam@google.com>2019-11-22 15:36:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-11-22 15:36:01 +0000
commita5dcdcacb9818cda089c17d68f4d91f7898663bd (patch)
tree666c9351e84accd35f0caf0251f6bb404b692070 /src/com/android/car
parent1deb027c9db509b9c4595e807f9bbc5a0da77026 (diff)
parent67a8cdeaeb2a0842979da395ebb3a7caabc8319c (diff)
downloadMessenger-a5dcdcacb9818cda089c17d68f4d91f7898663bd.tar.gz
Merge "Disable reply for messages with null contact URIs" into pi-car-dev
Diffstat (limited to 'src/com/android/car')
-rw-r--r--src/com/android/car/messenger/MessengerDelegate.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/car/messenger/MessengerDelegate.java b/src/com/android/car/messenger/MessengerDelegate.java
index 4662625..33615fb 100644
--- a/src/com/android/car/messenger/MessengerDelegate.java
+++ b/src/com/android/car/messenger/MessengerDelegate.java
@@ -399,7 +399,7 @@ public class MessengerDelegate implements BluetoothMonitor.OnBluetoothEventListe
final List<Action> actionList = new ArrayList<>();
// Reply action
- if (shouldAddReplyAction(senderKey.getDeviceAddress())) {
+ if (shouldAddReplyAction(senderKey)) {
final String replyString = mContext.getString(R.string.action_reply);
PendingIntent replyIntent = createServiceIntent(senderKey, notificationId,
MessengerService.ACTION_VOICE_REPLY);
@@ -431,12 +431,16 @@ public class MessengerDelegate implements BluetoothMonitor.OnBluetoothEventListe
return actionList;
}
- private boolean shouldAddReplyAction(String deviceAddress) {
+ private boolean shouldAddReplyAction(SenderKey senderKey) {
+ if (mNotificationInfos.get(senderKey).mSenderContactUri == null) {
+ return false;
+ }
+
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if (adapter == null) {
return false;
}
- BluetoothDevice device = adapter.getRemoteDevice(deviceAddress);
+ BluetoothDevice device = adapter.getRemoteDevice(senderKey.getDeviceAddress());
synchronized (mMapClientLock) {
return (mBluetoothMapClient != null) && mBluetoothMapClient.isUploadingSupported(