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

Commit ffc0b153 authored by Stephanie Bak's avatar Stephanie Bak
Browse files

Use message ID from proto for BT APM notification

Bug: 239983569
Test: atest ServiceBluetoothTests
Ignore-AOSP-First: resolve merge conflict on internal first

Change-Id: Id16cb1e0a89d66d9d5cb250ca5de987ef558e447
Merged-In: Id16cb1e0a89d66d9d5cb250ca5de987ef558e447
parent 739bf6dc
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ java_library {
        "androidx.annotation_annotation",
        "androidx.appcompat_appcompat",
        "modules-utils-shell-command-handler",
        "bluetooth-nano-protos",
    ],

    apex_available: [
@@ -135,6 +136,23 @@ gensrcs {
    output_extension: "srcjar",
}

java_library {
    name: "bluetooth-nano-protos",
    sdk_version: "system_current",
    min_sdk_version: "Tiramisu",
    proto: {
        type: "nano",
    },
    srcs: [
        ":system-messages-proto-src",
    ],
    libs: ["libprotobuf-java-nano"],
    apex_available: [
        "com.android.bluetooth",
    ],
    lint: { strict_updatability_linting: true },
}

platform_compat_config
{
    name: "bluetooth-compat-config",
+3 −4
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import android.util.Log;

import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;

import java.util.ArrayList;
import java.util.List;

@@ -38,9 +40,6 @@ public class BluetoothNotificationManager {
    public static final String APM_NOTIFICATION_CHANNEL = "apm_notification_channel";
    private static final String APM_NOTIFICATION_GROUP = "apm_notification_group";

    //TODO: b/239983569 remove hardcoded notification ID
    private static final int NOTE_BT_APM_NOTIFICATION = -1000007;

    private final Context mContext;
    private NotificationManager mNotificationManager;

@@ -137,7 +136,7 @@ public class BluetoothNotificationManager {
                        .setStyle(new Notification.BigTextStyle().bigText(message))
                        .setSmallIcon(android.R.drawable.stat_sys_data_bluetooth)
                        .build();
        notify(NOTE_BT_APM_NOTIFICATION, notification);
        notify(SystemMessage.NOTE_BT_APM_NOTIFICATION, notification);
    }

    /**