From 7087388a0f9f876fdee688f732dcd5737fa6d08e Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Wed, 12 Oct 2022 22:34:22 +0800 Subject: [PATCH 1/2] [LE unicast] Using the pairDeviceByCsip API ag/20176285 changes the API flow. Bug: 253541065 Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=CachedBluetoothDeviceManagerTest local test and result is on bug (pass) Change-Id: I2354b464a93b3122b462dc9cc20556f621490d2a --- .../android/settings/bluetooth/BluetoothPairingRequest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java index d5de41a20f9..ed7a1fc9307 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java @@ -87,9 +87,7 @@ public final class BluetoothPairingRequest extends BroadcastReceiver { return; } - if (mBluetoothManager.getCachedDeviceManager().shouldPairByCsip(device, groupId)) { - device.createBond(BluetoothDevice.TRANSPORT_LE); - } + mBluetoothManager.getCachedDeviceManager().pairDeviceByCsip(device, groupId); } } } From 4884157649559076d9a362acae4529ef9c0925f8 Mon Sep 17 00:00:00 2001 From: Simon Wingrove Date: Mon, 17 Oct 2022 14:50:50 +0100 Subject: [PATCH 2/2] Don't trampoline twice when opening security or privacy Settings already trampolines to a two-pane version of deeplink activities, doing another trampoline will wind up creating a second task covering up the first, with the wrong layout. Bug: 253554698 Test: manually Change-Id: Ib7ba5c95cac2f644ade37a41f321d11c8f1d1b89 --- src/com/android/settings/Settings.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java index f1c11918884..50ffdc720eb 100644 --- a/src/com/android/settings/Settings.java +++ b/src/com/android/settings/Settings.java @@ -152,6 +152,11 @@ public class Settings extends SettingsActivity { /** Redirects to SafetyCenter if enabled. */ @VisibleForTesting public void handleSafetyCenterRedirection() { + if (isFinishing()) { + // Don't trampoline if already exiting this activity. + return; + } + if (SafetyCenterManagerWrapper.get().isEnabled(this)) { try { startActivity(new Intent(Intent.ACTION_SAFETY_CENTER)); @@ -213,6 +218,11 @@ public class Settings extends SettingsActivity { /** Redirects to SafetyCenter if enabled. */ @VisibleForTesting public void handleSafetyCenterRedirection() { + if (isFinishing()) { + // Don't trampoline if already exiting this activity. + return; + } + if (ACTION_PRIVACY_SETTINGS.equals(getIntent().getAction()) && SafetyCenterManagerWrapper.get().isEnabled(this)) { try {