Skip to content

Commit

Permalink
[Fast Pair] Remove handshake refactor flag
Browse files Browse the repository at this point in the history
The handshake refactor quick fix has been enabled since M115 and has
not had any issues so we are removing the flag that it was gated behind.

Test: Manually tested on DUT and updated unittests.
Change-Id: Ic571a4b5588437dc2f5519a4124540622d94034c
Bug: b/265853116
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706078
Reviewed-by: Daniel Classon <dclasson@google.com>
Commit-Queue: Alex Kingsborough <akingsb@google.com>
Reviewed-by: Jack Shira <jackshira@google.com>
Cr-Commit-Position: refs/heads/main@{#1188118}
  • Loading branch information
Alex Kingsborough authored and Chromium LUCI CQ committed Aug 25, 2023
1 parent f4c65f1 commit 7a7b6ed
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 44 deletions.
9 changes: 0 additions & 9 deletions ash/constants/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -989,11 +989,6 @@ BASE_FEATURE(kFastPairDebugMetadata,
"FastPairDebugMetadata",
base::FEATURE_DISABLED_BY_DEFAULT);

// Enables using new Handshake retry logic for Fast Pair.
BASE_FEATURE(kFastPairHandshakeRefactor,
"FastPairHandshakeRefactor",
base::FEATURE_ENABLED_BY_DEFAULT);

// Enables using longterm Handshake retry logic for Fast Pair.
BASE_FEATURE(kFastPairHandshakeLongTermRefactor,
"FastPairHandshakeLongTermRefactor",
Expand Down Expand Up @@ -3183,10 +3178,6 @@ bool IsFastPairDevicesBluetoothSettingsEnabled() {
return base::FeatureList::IsEnabled(kFastPairDevicesBluetoothSettings);
}

bool IsFastPairHandshakeRefactorEnabled() {
return base::FeatureList::IsEnabled(kFastPairHandshakeRefactor);
}

bool IsFastPairHandshakeLongTermRefactorEnabled() {
return base::FeatureList::IsEnabled(kFastPairHandshakeLongTermRefactor);
}
Expand Down
2 changes: 0 additions & 2 deletions ash/constants/ash_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS)
BASE_DECLARE_FEATURE(kFastPairBleRotation);
COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kFastPairDebugMetadata);
COMPONENT_EXPORT(ASH_CONSTANTS)
BASE_DECLARE_FEATURE(kFastPairHandshakeRefactor);
COMPONENT_EXPORT(ASH_CONSTANTS)
BASE_DECLARE_FEATURE(kFastPairHandshakeLongTermRefactor);
COMPONENT_EXPORT(ASH_CONSTANTS)
BASE_DECLARE_FEATURE(kFastPairHID);
Expand Down
18 changes: 7 additions & 11 deletions ash/quick_pair/pairing/pairer_broker_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,13 @@ void PairerBrokerImpl::OnHandshakeFailure(scoped_refptr<Device> device,
PairFailure failure) {
if (num_handshake_attempts_[device->metadata_id()] <
kMaxNumHandshakeAttempts) {
if (ash::features::IsFastPairHandshakeRefactorEnabled()) {
// Directly calling CreateHandshake() from here will cause the new
// handshake to be nested inside the failed handshake. Use a timer to give
// the failed handshake time to cleanup and avoid nesting.
retry_handshake_timer_.Start(
FROM_HERE, kRetryHandshakeDelay,
base::BindOnce(&PairerBrokerImpl::CreateHandshake,
weak_pointer_factory_.GetWeakPtr(), device));
} else {
CreateHandshake(device);
}
// Directly calling CreateHandshake() from here will cause the new
// handshake to be nested inside the failed handshake. Use a timer to give
// the failed handshake time to cleanup and avoid nesting.
retry_handshake_timer_.Start(
FROM_HERE, kRetryHandshakeDelay,
base::BindOnce(&PairerBrokerImpl::CreateHandshake,
weak_pointer_factory_.GetWeakPtr(), device));
return;
}

Expand Down
9 changes: 0 additions & 9 deletions ash/quick_pair/pairing/pairer_broker_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,6 @@ TEST_F(PairerBrokerImplTest, ReuseHandshake_Retroactive) {

TEST_F(PairerBrokerImplTest,
PairAfterTwoHandshakeFailuresWithHandshakeRefactor_Initial) {
base::test::ScopedFeatureList feature_list{
ash::features::kFastPairHandshakeRefactor};

histogram_tester_.ExpectTotalCount(kHandshakeEffectiveSuccessRate, 0);
histogram_tester_.ExpectTotalCount(kHandshakeAttemptCount, 0);

Expand Down Expand Up @@ -859,9 +856,6 @@ TEST_F(PairerBrokerImplTest,

TEST_F(PairerBrokerImplTest,
PairAfterTwoHandshakeFailuresWithHandshakeRefactor_Subsequent) {
base::test::ScopedFeatureList feature_list{
ash::features::kFastPairHandshakeRefactor};

histogram_tester_.ExpectTotalCount(kHandshakeEffectiveSuccessRate, 0);
histogram_tester_.ExpectTotalCount(kHandshakeAttemptCount, 0);

Expand Down Expand Up @@ -896,9 +890,6 @@ TEST_F(PairerBrokerImplTest,

TEST_F(PairerBrokerImplTest,
PairAfterTwoHandshakeFailuresWithHandshakeRefactor_Retroactive) {
base::test::ScopedFeatureList feature_list{
ash::features::kFastPairHandshakeRefactor};

histogram_tester_.ExpectTotalCount(kHandshakeEffectiveSuccessRate, 0);
histogram_tester_.ExpectTotalCount(kHandshakeAttemptCount, 0);

Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7572,11 +7572,6 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kFastPairDevicesBluetoothSettingsDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kFastPairDevicesBluetoothSettings)},

{"fast-pair-handshake-refactor",
flag_descriptions::kFastPairHandshakeRefactorName,
flag_descriptions::kFastPairHandshakeRefactorDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kFastPairHandshakeRefactor)},

{"fast-pair-handshake-long-term-refactor",
flag_descriptions::kFastPairHandshakeLongTermRefactorName,
flag_descriptions::kFastPairHandshakeLongTermRefactorDescription, kOsCrOS,
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5804,11 +5804,6 @@ const char kFastPairDescription[] =
"Enables Google Fast Pair service which uses BLE to discover supported "
"nearby Bluetooth devices and surfaces a notification for quick pairing.";

const char kFastPairHandshakeRefactorName[] =
"Enable Fast Pair Handshake Refactor";
const char kFastPairHandshakeRefactorDescription[] =
"Enables refactored handshake logic for Google Fast Pair service.";

const char kFastPairHandshakeLongTermRefactorName[] =
"Enable Fast Pair Handshake Long Term Refactor";
const char kFastPairHandshakeLongTermRefactorDescription[] =
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3345,9 +3345,6 @@ extern const char kDropdownPanelDescription[];
extern const char kFastPairName[];
extern const char kFastPairDescription[];

extern const char kFastPairHandshakeRefactorName[];
extern const char kFastPairHandshakeRefactorDescription[];

extern const char kFastPairHandshakeLongTermRefactorName[];
extern const char kFastPairHandshakeLongTermRefactorDescription[];

Expand Down

0 comments on commit 7a7b6ed

Please sign in to comment.