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

Commit 3bcef52b authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Jakub Pawłowski
Browse files

Add @SystemApi for key missing broadcast

Bug: 311447399
Bug: 297598060
Test: None
Change-Id: I6494083f3a56093b0066aec0329795a5da0688af
parent 9e39238c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -6,3 +6,10 @@ flag {
    description: "Support more device types in bt device metadata"
    bug: "289584302"
}

flag {
    name: "key_missing_broadcast"
    namespace: "bluetooth"
    description: "Broadcast when remote device it lost bond"
    bug: "311447399"
}
+1 −0
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ package android.bluetooth {
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_ACCESS_CANCEL = "android.bluetooth.device.action.CONNECTION_ACCESS_CANCEL";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_ACCESS_REPLY = "android.bluetooth.device.action.CONNECTION_ACCESS_REPLY";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_ACCESS_REQUEST = "android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST";
    field @FlaggedApi("com.android.bluetooth.flags.key_missing_broadcast") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_KEY_MISSING = "android.bluetooth.device.action.KEY_MISSING";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_PAIRING_CANCEL = "android.bluetooth.device.action.PAIRING_CANCEL";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_SILENCE_MODE_CHANGED = "android.bluetooth.device.action.SILENCE_MODE_CHANGED";
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_SWITCH_BUFFER_SIZE = "android.bluetooth.device.action.SWITCH_BUFFER_SIZE";
+29 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.bluetooth;

import static android.bluetooth.BluetoothUtils.getSyncTimeout;

import android.annotation.BroadcastBehavior;
import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntRange;
@@ -283,6 +284,34 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    public static final String ACTION_SWITCH_BUFFER_SIZE =
            "android.bluetooth.device.action.SWITCH_BUFFER_SIZE";

    /**
     * Broadcast Action: Indicates that previously bonded device couldn't provide keys to establish
     * encryption. This can have numerous reasons, i.e.:
     *
     * <ul>
     *   <li>remote was factory reset, or removed bond
     *   <li>spoofing attack, someone is impersonating remote device
     *   <li>in case of LE devices, very unlikely address collision
     * </ul>
     *
     * Only registered receivers will receive this intent.
     *
     * <p>Always contains the extra field {@link #EXTRA_DEVICE}
     *
     * @hide
     */
    @FlaggedApi("com.android.bluetooth.flags.key_missing_broadcast")
    @SuppressLint("ActionValue")
    @RequiresPermission(
            allOf = {
                android.Manifest.permission.BLUETOOTH_CONNECT,
                android.Manifest.permission.BLUETOOTH_PRIVILEGED,
            })
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @SystemApi
    @BroadcastBehavior(includeBackground = true, protectedBroadcast = true)
    public static final String ACTION_KEY_MISSING = "android.bluetooth.device.action.KEY_MISSING";

    /**
     * Used as an Integer extra field in {@link #ACTION_BATTERY_LEVEL_CHANGED}
     * intent. It contains the most recently retrieved battery level information