summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Omair Kamil <okamil@google.com> 2025-01-15 16:07:08 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-15 16:07:08 -0800
commit17a3de67b215cba1d6a53adf799390a06abb1151 (patch)
tree88a6f080e045fd5375d58cc4e78184eef79e7600
parentf500c6ac8ebe7dad9e9c634ecb0b0953cb651b2f (diff)
parentc277a0b7473c82f8e117cf9e5b8f2db88c7480d3 (diff)
Merge "Clean up flag scan_record_manufacturer_data_merge" into main
-rw-r--r--flags/gap.aconfig10
-rw-r--r--framework/java/android/bluetooth/le/ScanRecord.java22
-rw-r--r--framework/tests/unit/src/android/bluetooth/le/ScanRecordTest.java3
3 files changed, 8 insertions, 27 deletions
diff --git a/flags/gap.aconfig b/flags/gap.aconfig
index b3852f28d2..7b9d928135 100644
--- a/flags/gap.aconfig
+++ b/flags/gap.aconfig
@@ -54,16 +54,6 @@ flag {
}
flag {
- name: "scan_record_manufacturer_data_merge"
- namespace: "bluetooth"
- description: "If a scan record has multiple datas under same manufacturer id, merge the values"
- bug: "331723396"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
-
-flag {
name: "msft_addr_tracking_quirk"
namespace: "bluetooth"
description: "Scanning with MSFT paddress tracking for Realtek BT controllers"
diff --git a/framework/java/android/bluetooth/le/ScanRecord.java b/framework/java/android/bluetooth/le/ScanRecord.java
index 57bd7445c7..d5b3b46e4e 100644
--- a/framework/java/android/bluetooth/le/ScanRecord.java
+++ b/framework/java/android/bluetooth/le/ScanRecord.java
@@ -28,8 +28,6 @@ import android.util.ArrayMap;
import android.util.Log;
import android.util.SparseArray;
-import com.android.bluetooth.flags.Flags;
-
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.nio.ByteBuffer;
@@ -644,18 +642,14 @@ public final class ScanRecord {
+ (scanRecord[currentPos] & 0xFF);
byte[] manufacturerDataBytes =
extractBytes(scanRecord, currentPos + 2, dataLength - 2);
- if (Flags.scanRecordManufacturerDataMerge()) {
- if (manufacturerData.contains(manufacturerId)) {
- byte[] firstValue = manufacturerData.get(manufacturerId);
- ByteBuffer buffer =
- ByteBuffer.allocate(
- firstValue.length + manufacturerDataBytes.length);
- buffer.put(firstValue);
- buffer.put(manufacturerDataBytes);
- manufacturerData.put(manufacturerId, buffer.array());
- } else {
- manufacturerData.put(manufacturerId, manufacturerDataBytes);
- }
+ if (manufacturerData.contains(manufacturerId)) {
+ byte[] firstValue = manufacturerData.get(manufacturerId);
+ ByteBuffer buffer =
+ ByteBuffer.allocate(
+ firstValue.length + manufacturerDataBytes.length);
+ buffer.put(firstValue);
+ buffer.put(manufacturerDataBytes);
+ manufacturerData.put(manufacturerId, buffer.array());
} else {
manufacturerData.put(manufacturerId, manufacturerDataBytes);
}
diff --git a/framework/tests/unit/src/android/bluetooth/le/ScanRecordTest.java b/framework/tests/unit/src/android/bluetooth/le/ScanRecordTest.java
index a690e510f5..4292583191 100644
--- a/framework/tests/unit/src/android/bluetooth/le/ScanRecordTest.java
+++ b/framework/tests/unit/src/android/bluetooth/le/ScanRecordTest.java
@@ -21,7 +21,6 @@ import static com.google.common.truth.Truth.assertThat;
import android.os.ParcelUuid;
import android.platform.test.flag.junit.SetFlagsRule;
-import com.android.bluetooth.flags.Flags;
import com.android.modules.utils.BytesMatcher;
import org.junit.Rule;
@@ -195,8 +194,6 @@ public class ScanRecordTest {
@Test
public void testParserMultipleManufacturerSpecificData() {
- mSetFlagsRule.enableFlags(Flags.FLAG_SCAN_RECORD_MANUFACTURER_DATA_MERGE);
-
byte[] scanRecord =
new byte[] {
0x02,