Do not cancel bonding during bt pairing when orientation happens.
Flag: com.android.settings.flags.disable_bonding_cancellation_for_orientation_change Bug: b/349542301 Test: locally tested. Change-Id: I56867eb39ca783b23853318c39e0f25ce1a80e6f
This commit is contained in:
@@ -31,3 +31,13 @@ flag {
|
|||||||
description: "Gates whether to enable bluetooth device details polish"
|
description: "Gates whether to enable bluetooth device details polish"
|
||||||
bug: "343317785"
|
bug: "343317785"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flag {
|
||||||
|
name: "disable_bonding_cancellation_for_orientation_change"
|
||||||
|
namespace: "cross_device_experiences"
|
||||||
|
description: "Stop cancelling bonding process when there is an orientation change"
|
||||||
|
bug: "349542301"
|
||||||
|
metadata {
|
||||||
|
purpose: PURPOSE_BUGFIX
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -41,6 +41,7 @@ import androidx.appcompat.app.AlertDialog;
|
|||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||||
|
import com.android.settings.flags.Flags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A dialogFragment used by {@link BluetoothPairingDialog} to create an appropriately styled dialog
|
* A dialogFragment used by {@link BluetoothPairingDialog} to create an appropriately styled dialog
|
||||||
@@ -87,12 +88,15 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (mPairingController.getDialogType()
|
/* Cancel pairing unless 1) explicitly accepted by user 2) the event is triggered by
|
||||||
!= BluetoothPairingController.DISPLAY_PASSKEY_DIALOG) {
|
* orientation change. */
|
||||||
/* Cancel pairing unless explicitly accepted by user */
|
boolean shouldCancelPairing =
|
||||||
if (!mPositiveClicked) {
|
Flags.disableBondingCancellationForOrientationChange()
|
||||||
mPairingController.onCancel();
|
? !mPositiveClicked && !getActivity().isChangingConfigurations()
|
||||||
}
|
: !mPositiveClicked;
|
||||||
|
if (mPairingController.getDialogType() != BluetoothPairingController.DISPLAY_PASSKEY_DIALOG
|
||||||
|
&& shouldCancelPairing) {
|
||||||
|
mPairingController.onCancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user