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

Commit e80d3cc4 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12265118 from e0372643 to 24Q4-release

Change-Id: Id9ba4a632a4edb631b2ca3c0801dcbd45078d081
parents 777b6fd0 e0372643
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import static java.util.Objects.requireNonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
@@ -582,7 +581,6 @@ public class HeadsetService extends ProfileService {
        }

        @Override
        @SuppressLint("AndroidFrameworkRequiresPermission") // TODO: b/356478621 - remove
        public boolean setConnectionPolicy(
                BluetoothDevice device, int connectionPolicy, AttributionSource source) {
            HeadsetService service = getService(source);
@@ -590,8 +588,7 @@ public class HeadsetService extends ProfileService {
                return false;
            }

            // TODO: b/356478621 - put back the permission check
            // service.enforceCallingOrSelfPermission(MODIFY_PHONE_STATE, null);
            service.enforceCallingOrSelfPermission(MODIFY_PHONE_STATE, null);
            service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null);
            return service.setConnectionPolicy(device, connectionPolicy);
        }
+5 −2
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ class BluetoothManagerService {
        }
    }

    boolean onFactoryReset() {
    boolean onFactoryResetFromBinder() {
        // Wait for stable state if bluetooth is temporary state.
        int state = getState();
        if (state == STATE_BLE_TURNING_ON
@@ -258,10 +258,13 @@ class BluetoothManagerService {
                return false;
            }
        }
        return postAndWait(() -> onFactoryReset());
    }

    boolean onFactoryReset() {
        // Clear registered LE apps to force shut-off Bluetooth
        clearBleApps();
        state = getState();
        int state = getState();
        mAdapterLock.readLock().lock();
        try {
            if (mAdapter == null) {
+1 −1
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ class BluetoothServiceBinder extends IBluetoothManager.Stub {
            return false;
        }

        return mBluetoothManagerService.onFactoryReset();
        return mBluetoothManagerService.onFactoryResetFromBinder();
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ public class BluetoothServiceBinderTest {
                .adoptShellPermissionIdentity(BLUETOOTH_PRIVILEGED, BLUETOOTH_CONNECT);

        assertThat(mBinder.onFactoryReset(mSource)).isFalse();
        verify(mManagerService).onFactoryReset();
        verify(mManagerService).onFactoryResetFromBinder();
        verifyMock();
    }

+4 −2
Original line number Diff line number Diff line
@@ -249,9 +249,11 @@ void bta_dm_sdp_finished(RawAddress bda, tBTA_STATUS result, std::vector<bluetoo

/* Callback from sdp with discovery status */
void bta_dm_sdp_callback(const RawAddress& /* bd_addr */, tSDP_STATUS sdp_status) {
  log::info("{}", bta_dm_state_text(bta_dm_discovery_get_state()));
  bool sdp_pending = bta_dm_discovery_cb.transports & BT_TRANSPORT_BR_EDR;
  log::info("{}, sdp_pending: {}", bta_dm_state_text(bta_dm_discovery_get_state()), sdp_pending);

  if (bta_dm_discovery_get_state() == BTA_DM_DISCOVER_IDLE) {
  if (bta_dm_discovery_get_state() == BTA_DM_DISCOVER_IDLE || !sdp_pending ||
      !bta_dm_discovery_cb.sdp_state) {
    return;
  }

Loading