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

Commit 9827bfa2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I52105432,I6cc90021 into main am: f864b7e3 am: d415f438

parents 06b4c20b d415f438
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"
container: "com.android.btservices"

flag {
    name: "ignore_bond_type_for_le"
    namespace: "bluetooth"
    description: "Bond type is not applicable for LE SMP pairing"
    bug: "319695663"
}

flag {
    name: "reset_pairing_only_for_related_service_discovery"
    namespace: "bluetooth"
    description: "Don't reset the pairing state if service discovery concludes for a different device"
    bug: "321996502"
}

flag {
    name: "force_bredr_for_sdp_retry"
    namespace: "bluetooth"
+0 −4
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.ParcelUuid;
import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.util.Log;
@@ -47,7 +46,6 @@ import android.util.Log;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.AdoptShellPermissionsRule;

import io.grpc.stub.StreamObserver;
@@ -306,7 +304,6 @@ public class PairingTest {
     * Expectation: Pairing gets cancelled instead of getting timed out
     */
    @Test
    @RequiresFlagsEnabled(Flags.FLAG_RESET_PAIRING_ONLY_FOR_RELATED_SERVICE_DISCOVERY)
    public void testCancelBondLe_WithGattServiceDiscovery() {
        registerIntentActions(BluetoothDevice.ACTION_BOND_STATE_CHANGED);

@@ -357,7 +354,6 @@ public class PairingTest {
     * Expectation: Pairing succeeds
     */
    @Test
    @RequiresFlagsEnabled(Flags.FLAG_RESET_PAIRING_ONLY_FOR_RELATED_SERVICE_DISCOVERY)
    public void testBondLe_WithGattServiceDiscovery() {
        registerIntentActions(BluetoothDevice.ACTION_BOND_STATE_CHANGED);

+2 −25
Original line number Diff line number Diff line
@@ -1658,27 +1658,8 @@ static bool btif_should_ignore_uuid(const Uuid& uuid) {
}

static bool btif_is_gatt_service_discovery_post_pairing(const RawAddress bd_addr) {
  if (!com::android::bluetooth::flags::
          reset_pairing_only_for_related_service_discovery()) {
    if (bd_addr == pairing_cb.bd_addr || bd_addr == pairing_cb.static_bdaddr) {
      if (pairing_cb.gatt_over_le !=
          btif_dm_pairing_cb_t::ServiceDiscoveryState::SCHEDULED) {
        log::error(
            "gatt_over_le should be SCHEDULED, did someone clear the control "
            "block for {} ?",
            bd_addr);
      }

      return true;
    }

    return false;
  }

 return ((bd_addr == pairing_cb.bd_addr ||
          bd_addr == pairing_cb.static_bdaddr) &&
         (pairing_cb.gatt_over_le ==
          btif_dm_pairing_cb_t::ServiceDiscoveryState::SCHEDULED));
  return (bd_addr == pairing_cb.bd_addr || bd_addr == pairing_cb.static_bdaddr) &&
         (pairing_cb.gatt_over_le == btif_dm_pairing_cb_t::ServiceDiscoveryState::SCHEDULED);
}

static void btif_merge_existing_uuids(RawAddress& addr, std::set<Uuid>* uuids) {
@@ -3493,10 +3474,6 @@ static void btif_dm_ble_key_notif_evt(tBTA_DM_SP_KEY_NOTIF* p_ssp_key_notif) {

static bool btif_dm_ble_is_temp_pairing(RawAddress& bd_addr, bool ctkd) {
  if (btm_get_bond_type_dev(bd_addr) == BOND_TYPE_TEMPORARY) {
    if (!com::android::bluetooth::flags::ignore_bond_type_for_le()) {
      return true;
    }

    return ctkd;
  }