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

Commit 9a651951 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Merge "Fix (again) bad scan record data length" am: 7dff110b am: 396c3678

am: ed6d9a7c

Change-Id: I485d752aa5939212279481287ca78b0d73b15a42
parents 6362045c ed6d9a7c
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -688,8 +688,14 @@ public class GattService extends ProfileService {
            ScanSettings settings = client.settings;
            ScanSettings settings = client.settings;
            byte[] scan_record_data;
            byte[] scan_record_data;
            // This is for compability with applications that assume fixed size scan data.
            // This is for compability with applications that assume fixed size scan data.
            if (settings.getLegacy() && ((event_type & ET_LEGACY_MASK) == 0)) {
            if (settings.getLegacy()) {
                if ((event_type & ET_LEGACY_MASK) == 0) {
                    // If this is legacy scan, but nonlegacy result - skip.
                    continue;
                } else {
                    // Some apps are used to fixed-size advertise data.
                    scan_record_data = legacy_adv_data;
                    scan_record_data = legacy_adv_data;
                }
            } else {
            } else {
                scan_record_data = adv_data;
                scan_record_data = adv_data;
            }
            }
@@ -708,11 +714,6 @@ public class GattService extends ProfileService {
                continue;
                continue;
            }
            }


            // if this is legacy scan, return only legacy scan results
            if (settings.getLegacy() && ((event_type & ET_LEGACY_MASK) == 0)) {
                continue;
            }

            try {
            try {
                app.appScanStats.addResult();
                app.appScanStats.addResult();
                app.callback.onScanResult(result);
                app.callback.onScanResult(result);