Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da342209 authored by Marie Janssen's avatar Marie Janssen Committed by Hansong Zhang
Browse files

Make notifications local-only

Notifications from Bluetooth shouldn't be seen on external devices like
watches - they don't make sense to accept on those devices.

Test: while connected to watch, connect phone to carkit
Bug: 34612389
Change-Id: Ie1e3044db0677832bbfba52dfc5932d309dec100
parent 6ec220c6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -383,6 +383,7 @@ class BluetoothOppNotification {
                }
            }
            b.setOngoing(true);
            b.setLocalOnly(true);

            Intent intent = new Intent(Constants.ACTION_LIST);
            intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
@@ -460,6 +461,7 @@ class BluetoothOppNotification {
                            .setDeleteIntent(
                                    PendingIntent.getBroadcast(mContext, 0, deleteIntent, 0))
                            .setWhen(timeStamp)
                            .setLocalOnly(true)
                            .build();
            mNotificationMgr.notify(NOTIFICATION_ID_OUTBOUND_COMPLETE, outNoti);
        } else {
@@ -525,6 +527,7 @@ class BluetoothOppNotification {
                            .setDeleteIntent(
                                    PendingIntent.getBroadcast(mContext, 0, deleteIntent, 0))
                            .setWhen(timeStamp)
                            .setLocalOnly(true)
                            .build();
            mNotificationMgr.notify(NOTIFICATION_ID_INBOUND_COMPLETE, inNoti);
        } else {
@@ -588,6 +591,7 @@ class BluetoothOppNotification {
                                    info.mDeviceName, info.mFileName)))
                            .setContentInfo(Formatter.formatFileSize(mContext, info.mTotalBytes))
                            .setSmallIcon(R.drawable.bt_incomming_file_notification)
                            .setLocalOnly(true)
                            .build();
            mNotificationMgr.notify(NOTIFICATION_ID_PROGRESS, n);
        }
+1 −0
Original line number Diff line number Diff line
@@ -671,6 +671,7 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect
                            .setDefaults(Notification.DEFAULT_SOUND)
                            .setContentIntent(PendingIntent.getActivity(this, 0, clickIntent, 0))
                            .setDeleteIntent(PendingIntent.getBroadcast(this, 0, deleteIntent, 0))
                            .setLocalOnly(true)
                            .build();
            nm.notify(NOTIFICATION_ID_AUTH, notification);
        }
+2 −0
Original line number Diff line number Diff line
@@ -263,6 +263,7 @@ public class SapServer extends Thread implements Callback {
                            .setAutoCancel(false)
                            .setPriority(Notification.PRIORITY_MAX)
                            .setOnlyAlertOnce(true)
                            .setLocalOnly(true)
                            .build();
        } else {
            sapDisconnectIntent.putExtra(SapServer.SAP_DISCONNECT_TYPE_EXTRA,
@@ -293,6 +294,7 @@ public class SapServer extends Thread implements Callback {
                            .setAutoCancel(false)
                            .setPriority(Notification.PRIORITY_MAX)
                            .setOnlyAlertOnce(true)
                            .setLocalOnly(true)
                            .build();
        }