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

Commit 02634fce authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix (again) bad scan record data length"

parents ffca0695 150d5746
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -688,8 +688,14 @@ public class GattService extends ProfileService {
            ScanSettings settings = client.settings;
            byte[] scan_record_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;
                }
            } else {
                scan_record_data = adv_data;
            }
@@ -708,11 +714,6 @@ public class GattService extends ProfileService {
                continue;
            }

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

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