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

Commit 8b946957 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Removing flag reset_pairing_only_for_related_service_discovery

Flag: com.android.bluetooth.flags.reset_pairing_only_for_related_service_discovery
Test: mmm packages/modules/Bluetooth
Bug: 321996502
Change-Id: I6cc9002154cfebf25e53e9f708b0370a258fe0db
parent ab192b16
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -8,13 +8,6 @@ flag {
    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 −21
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) {