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

Commit 2fa1415c authored by Jack He's avatar Jack He Committed by android-build-merger
Browse files

Merge "Bluetooth: Ensure only desired intents are being handled" into oc-dev

am: d2778f32

Change-Id: Ia7b60079b09f6277d2b5c0959fe6fa9d1f2959e3
parents 3f4d2f28 d2778f32
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -71,12 +71,13 @@ public class BluetoothDiscoverableTimeoutReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction() == null || !intent.getAction().equals(INTENT_DISCOVERABLE_TIMEOUT)) {
            return;
        }
        LocalBluetoothAdapter localBluetoothAdapter = LocalBluetoothAdapter.getInstance();

        if(localBluetoothAdapter != null  &&
            localBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) {
            Log.d(TAG, "Disable discoverable...");

            localBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE);
        } else {
            Log.e(TAG, "localBluetoothAdapter is NULL!!");