From 113839733658188e93303caee7d8a1db579f1246 Mon Sep 17 00:00:00 2001 From: Marie Janssen Date: Thu, 15 Jun 2017 17:19:36 -0700 Subject: [PATCH] Bluetooth: Make notifications local-only This will prevent them from showing up on external devices where they would be less than useful. Test: connect to watch and pair a device Bug: 34612389 Change-Id: I8b02c20200ce78a73967b8121cf7d5653b68f356 (cherry picked from commit 426903d155a0e9089666736e784d498e6a016845) --- .../android/settings/bluetooth/BluetoothPairingService.java | 3 ++- .../android/settings/bluetooth/BluetoothPermissionRequest.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothPairingService.java b/src/com/android/settings/bluetooth/BluetoothPairingService.java index 58df9192d7b..4fedb6d4f32 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingService.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingService.java @@ -120,7 +120,8 @@ public final class BluetoothPairingService extends Service { Notification.Builder builder = new Notification.Builder(this, BLUETOOTH_NOTIFICATION_CHANNEL) .setSmallIcon(android.R.drawable.stat_sys_data_bluetooth) - .setTicker(res.getString(R.string.bluetooth_notif_ticker)); + .setTicker(res.getString(R.string.bluetooth_notif_ticker)) + .setLocalOnly(true); PendingIntent pairIntent = PendingIntent.getActivity(this, 0, getPairingDialogIntent(this, intent), PendingIntent.FLAG_ONE_SHOT); diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index 59496ddb6e8..85c5e45ec00 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java @@ -181,6 +181,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { .setDeleteIntent(PendingIntent.getBroadcast(context, 0, deleteIntent, 0)) .setColor(context.getColor( com.android.internal.R.color.system_notification_accent_color)) + .setLocalOnly(true) .build(); notification.flags |= Notification.FLAG_NO_CLEAR; // Cannot be set with the builder.