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

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

Merge "Remove always from isBleScanAlwaysAvailable" into main

parents 81b7bcd1 bb510b97
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2434,9 +2434,9 @@ public final class BluetoothAdapter {
    @RequiresNoPermission
    public boolean isBleScanAlwaysAvailable() {
        try {
            return mManagerService.isBleScanAlwaysAvailable();
            return mManagerService.isBleScanAvailable();
        } catch (RemoteException e) {
            Log.e(TAG, "remote exception when calling isBleScanAlwaysAvailable", e);
            Log.e(TAG, "remote exception when calling isBleScanAvailable", e);
            return false;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ interface IBluetoothManager
    boolean onFactoryReset(in AttributionSource attributionSource);

    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isBleScanAlwaysAvailable();
    boolean isBleScanAvailable();
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    boolean enableBle(in AttributionSource attributionSource, IBinder b);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
+2 −2
Original line number Diff line number Diff line
@@ -875,7 +875,7 @@ class BluetoothManagerService {
        }
    }

    boolean isBleScanAlwaysAvailable() {
    boolean isBleScanAvailable() {
        if (Flags.airplaneModeXBleOn()) {
            if (AirplaneModeListener.isOn() && !mEnable) {
                return false;
@@ -915,7 +915,7 @@ class BluetoothManagerService {
                new ContentObserver(new Handler(mLooper)) {
                    @Override
                    public void onChange(boolean selfChange) {
                        if (isBleScanAlwaysAvailable()) {
                        if (isBleScanAvailable()) {
                            // Nothing to do
                            return;
                        }
+2 −2
Original line number Diff line number Diff line
@@ -237,8 +237,8 @@ class BluetoothServiceBinder extends IBluetoothManager.Stub {
    }

    @Override
    public boolean isBleScanAlwaysAvailable() {
        return mBluetoothManagerService.isBleScanAlwaysAvailable();
    public boolean isBleScanAvailable() {
        return mBluetoothManagerService.isBleScanAvailable();
    }

    @Override
+3 −3
Original line number Diff line number Diff line
@@ -293,10 +293,10 @@ public class BluetoothServiceBinderTest {
    }

    @Test
    public void isBleScanAlwaysAvailable() {
    public void isBleScanAvailable() {
        // No permission needed for this call
        mBinder.isBleScanAlwaysAvailable();
        verify(mManagerService).isBleScanAlwaysAvailable();
        mBinder.isBleScanAvailable();
        verify(mManagerService).isBleScanAvailable();
        verifyMock();
    }