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

Commit 49837f2d authored by William Escande's avatar William Escande
Browse files

Update parcel read for ScanFilter

The writeToParcel is always writing 2 int for the `mAdvertisingDataType`
and the `mAdvertisingData == null ? 0 : 1`
Changed the constructor(Parcel) to do the same thing in same order

Tag: #stability
Fix: 217567811
Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testScanFilter'
Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testStartScanPendingIntent'
Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testStartScanPendingIntent_nullnull'
Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testBatchScan'

Change-Id: Ie0d4d54bc74db73694c21b3f5ec646ddda8b0ec3
parent 0b3fcdf1
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -291,10 +291,10 @@ public final class ScanFilter implements Parcelable {

            // Advertising data type
            int advertisingDataType = in.readInt();
            if (advertisingDataType != -1) {
            if (in.readInt() == 1) {
                byte[] advertisingData = null;
                byte[] advertisingDataMask = null;
                if (in.readInt() == 1) {

                int advertisingDataLength = in.readInt();
                advertisingData = new byte[advertisingDataLength];
                in.readByteArray(advertisingData);
@@ -303,7 +303,6 @@ public final class ScanFilter implements Parcelable {
                    advertisingDataMask = new byte[advertisingDataMaskLength];
                    in.readByteArray(advertisingDataMask);
                }
                }
                builder.setAdvertisingDataWithType(advertisingDataType, advertisingData,
                        advertisingDataMask);
            }