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

Commit 86d78c94 authored by Hyundo Moon's avatar Hyundo Moon Committed by Automerger Merge Worker
Browse files

Merge "Opp: Group 'Sent/Received files' notifications using group summary"...

Merge "Opp: Group 'Sent/Received files' notifications using group summary" into main am: ea069ef8 am: 59f3f1ee

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2949747



Change-Id: Idd5682809db906813ec8d60e93aec1657e8b73d5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 551d3861 59f3f1ee
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
@@ -115,6 +115,8 @@ class BluetoothOppNotification {
    @VisibleForTesting
    static final int NOTIFICATION_ID_INBOUND_COMPLETE = -1000006;

    static final int NOTIFICATION_ID_COMPLETE_SUMMARY = -1000007;

    private static final String NOTIFICATION_GROUP_KEY_PROGRESS = "PROGRESS";

    private static final String NOTIFICATION_GROUP_KEY_TRANSFER_COMPLETE = "TRANSFER_COMPLETE";
@@ -583,6 +585,24 @@ class BluetoothOppNotification {
                }
            }
        }

        if (Flags.oppFixMultipleNotificationsIssues() && inboundNum > 0 && outboundNum > 0) {
            Notification.Builder b =
                    new Notification.Builder(mContext, OPP_NOTIFICATION_CHANNEL)
                            .setGroup(NOTIFICATION_GROUP_KEY_TRANSFER_COMPLETE)
                            .setGroupSummary(true)
                            .setGroupAlertBehavior(Notification.GROUP_ALERT_CHILDREN)
                            .setSmallIcon(R.drawable.ic_bluetooth_file_transfer_notification)
                            .setColor(
                                    mContext.getResources()
                                            .getColor(
                                                    android.R.color
                                                            .system_notification_accent_color,
                                                    mContext.getTheme()))
                            .setLocalOnly(true);

            mNotificationMgr.notify(NOTIFICATION_ID_COMPLETE_SUMMARY, b.build());
        }
    }

    @VisibleForTesting
@@ -656,7 +676,7 @@ class BluetoothOppNotification {
                                    R.string.incoming_file_confirm_Notification_content,
                                    info.mDeviceName, fileNameSafe)))
                            .setSubText(Formatter.formatFileSize(mContext, info.mTotalBytes))
                            .setSmallIcon(R.drawable.bt_incomming_file_notification)
                            .setSmallIcon(R.drawable.ic_bluetooth_file_transfer_notification)
                            .setLocalOnly(true);
            if (Flags.oppFixMultipleNotificationsIssues()) {
                publicNotificationBuilder.setGroup(NOTIFICATION_GROUP_KEY_INCOMING_FILE_CONFIRM);
@@ -683,7 +703,7 @@ class BluetoothOppNotification {
                                    R.string.incoming_file_confirm_Notification_content,
                                    info.mDeviceName, fileNameSafe)))
                            .setSubText(Formatter.formatFileSize(mContext, info.mTotalBytes))
                            .setSmallIcon(R.drawable.bt_incomming_file_notification)
                            .setSmallIcon(R.drawable.ic_bluetooth_file_transfer_notification)
                            .setLocalOnly(true)
                            .setVisibility(Notification.VISIBILITY_PRIVATE)
                            .addAction(actionDecline)