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

Commit e7c723e3 authored by Omair Kamil's avatar Omair Kamil Committed by Gerrit Code Review
Browse files

Merge "Clean up flag get_address_type_api." into main

parents a0b54258 52233eac
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -243,13 +243,9 @@ public class HidHostService extends ProfileService {
     * @return address type
     */
    private int getAddressType(BluetoothDevice device) {
        if (Flags.getAddressTypeApi()) {
        return device.getAddressType();
    }

        return BluetoothDevice.ADDRESS_TYPE_PUBLIC;
    }

    /**
     * Retrieves preferred transport for the device
     *
+0 −8
Original line number Diff line number Diff line
@@ -52,14 +52,6 @@ flag {
    }
}

flag {
    name: "get_address_type_api"
    is_exported: true
    namespace: "bluetooth"
    description: "Change visibility of BluetoothDevice#getAddressType API to public"
    bug: "321120941"
}

flag {
    name: "remove_address_map_on_unbond"
    namespace: "bluetooth"
+2 −2
Original line number Diff line number Diff line
@@ -534,7 +534,7 @@ package android.bluetooth {
    method public int describeContents();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean fetchUuidsWithSdp();
    method public String getAddress();
    method @FlaggedApi("com.android.bluetooth.flags.get_address_type_api") public int getAddressType();
    method public int getAddressType();
    method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public String getAlias();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothClass getBluetoothClass();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getBondState();
@@ -555,7 +555,7 @@ package android.bluetooth {
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_NAME_CHANGED = "android.bluetooth.device.action.NAME_CHANGED";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_UUID = "android.bluetooth.device.action.UUID";
    field @FlaggedApi("com.android.bluetooth.flags.get_address_type_api") public static final int ADDRESS_TYPE_ANONYMOUS = 255; // 0xff
    field public static final int ADDRESS_TYPE_ANONYMOUS = 255; // 0xff
    field public static final int ADDRESS_TYPE_PUBLIC = 0; // 0x0
    field public static final int ADDRESS_TYPE_RANDOM = 1; // 0x1
    field public static final int ADDRESS_TYPE_UNKNOWN = 65535; // 0xffff
+0 −2
Original line number Diff line number Diff line
@@ -1363,7 +1363,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    public static final int ADDRESS_TYPE_UNKNOWN = 0xFFFF;

    /** Address type used to indicate an anonymous advertisement. */
    @FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API)
    public static final int ADDRESS_TYPE_ANONYMOUS = 0xFF;

    /**
@@ -1561,7 +1560,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     *
     * @return Bluetooth address type
     */
    @FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API)
    public @AddressType int getAddressType() {
        if (DBG) Log.d(TAG, "mAddressType: " + mAddressType);
        return mAddressType;
+0 −110
Original line number Diff line number Diff line
@@ -100,61 +100,6 @@
            column="49"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Field `ADDRESS_TYPE_ANONYMOUS` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `BluetoothDevice` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                &amp;&amp; addressType != ADDRESS_TYPE_ANONYMOUS) {"
        errorLine2="                                  ~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothDevice.java"
            line="1426"
            column="35"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Field `ADDRESS_TYPE_ANONYMOUS` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `BluetoothDevice` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="        if (addressType == ADDRESS_TYPE_ANONYMOUS &amp;&amp; !NULL_MAC_ADDRESS.equals(address)) {"
        errorLine2="                           ~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothDevice.java"
            line="1430"
            column="28"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `getAddressType()` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `onClientRegistered` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                                mDevice.getAddressType(),"
        errorLine2="                                ~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothGatt.java"
            line="279"
            column="33"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `getAddressType()` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `connect` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                    mDevice.getAddressType(),"
        errorLine2="                    ~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothGatt.java"
            line="1227"
            column="21"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `getAddressType()` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `connect` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                    device.getAddressType(),"
        errorLine2="                    ~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothGattServer.java"
            line="728"
            column="21"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Field `PRESET_INDEX_UNAVAILABLE` is a flagged API and should be inside an `if (Flags.settingsCanControlHapPreset())` check (or annotate the surrounding method `?` with `@FlaggedApi(Flags.FLAG_SETTINGS_CAN_CONTROL_HAP_PRESET) to transfer requirement to caller`)"
@@ -584,61 +529,6 @@
            column="49"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Field `ADDRESS_TYPE_ANONYMOUS` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `BluetoothDevice` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                &amp;&amp; addressType != ADDRESS_TYPE_ANONYMOUS) {"
        errorLine2="                                  ~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothDevice.java"
            line="1426"
            column="35"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Field `ADDRESS_TYPE_ANONYMOUS` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `BluetoothDevice` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="        if (addressType == ADDRESS_TYPE_ANONYMOUS &amp;&amp; !NULL_MAC_ADDRESS.equals(address)) {"
        errorLine2="                           ~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothDevice.java"
            line="1430"
            column="28"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `getAddressType()` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `onClientRegistered` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                                mDevice.getAddressType(),"
        errorLine2="                                ~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothGatt.java"
            line="279"
            column="33"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `getAddressType()` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `connect` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                    mDevice.getAddressType(),"
        errorLine2="                    ~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothGatt.java"
            line="1227"
            column="21"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `getAddressType()` is a flagged API and should be inside an `if (Flags.getAddressTypeApi())` check (or annotate the surrounding method `connect` with `@FlaggedApi(Flags.FLAG_GET_ADDRESS_TYPE_API) to transfer requirement to caller`)"
        errorLine1="                    device.getAddressType(),"
        errorLine2="                    ~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothGattServer.java"
            line="728"
            column="21"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Field `PRESET_INDEX_UNAVAILABLE` is a flagged API and should be inside an `if (Flags.settingsCanControlHapPreset())` check (or annotate the surrounding method `?` with `@FlaggedApi(Flags.FLAG_SETTINGS_CAN_CONTROL_HAP_PRESET) to transfer requirement to caller`)"