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

Commit 825471dd authored by Ugo Yu's avatar Ugo Yu Committed by William Escande
Browse files

Only broadcast inquiried devices with a name

To prevent spamming in the scanning page.

Bug: 219387005
Bug: 263323082
Test: manual
Change-Id: Ic6ca2e6d9e08523e15c28d5263ddff2f717c0fdd
(cherry picked from commit 52e26953e1642e5038285d7a4ab4f5c6035006aa)
(cherry picked from commit 8f629fbe)
Merged-In: Ic6ca2e6d9e08523e15c28d5263ddff2f717c0fdd
parent 34708f5d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.ParcelUuid;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.util.Log;

import com.android.bluetooth.BluetoothStatsLog;
@@ -754,6 +755,12 @@ final class RemoteDevices {
            errorLog("Device Properties is null for Device:" + device);
            return;
        }
        boolean restrict_device_found =
                SystemProperties.getBoolean("bluetooth.restrict_discovered_device.enabled", false);
        if (restrict_device_found && (deviceProp.mName == null || deviceProp.mName.isEmpty())) {
            debugLog("Device name is null or empty: " + device);
            return;
        }

        Intent intent = new Intent(BluetoothDevice.ACTION_FOUND);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);