From 24278d16096a13aa925bc599687369313e3afb46 Mon Sep 17 00:00:00 2001 From: William Escande Date: Thu, 3 Nov 2022 21:31:17 -0700 Subject: [PATCH] Clean bluetooth code Fixing nit from Ib40a6264d8d6908103d76b6401ddcfd3ffa7dd88 Test: m ROBOTEST_FILTER="com.android.settings.bluetooth" RunSettingsRoboTests Test: Open developer settings Bug: 257158801 Change-Id: Id3521c423e5ab751633df627d113206f374fbe8e --- src/com/android/settings/bluetooth/Utils.java | 2 +- ...uetoothMaxConnectedAudioDevicesPreferenceController.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/bluetooth/Utils.java b/src/com/android/settings/bluetooth/Utils.java index 24fe4e151ff..9aa363a1ef5 100644 --- a/src/com/android/settings/bluetooth/Utils.java +++ b/src/com/android/settings/bluetooth/Utils.java @@ -203,7 +203,7 @@ public final class Utils { public static String findBluetoothPackageName(Context context) throws NameNotFoundException { // this activity will always be in the package where the rest of Bluetooth lives - String sentinelActivity = "com.android.bluetooth.opp.BluetoothOppLauncherActivity"; + final String sentinelActivity = "com.android.bluetooth.opp.BluetoothOppLauncherActivity"; PackageManager packageManager = context.createContextAsUser(UserHandle.SYSTEM, 0) .getPackageManager(); String[] allPackages = packageManager.getPackagesForUid(BLUETOOTH_UID); diff --git a/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java b/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java index f1677f29509..a1467c80ac5 100644 --- a/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java +++ b/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java @@ -41,15 +41,13 @@ public class BluetoothMaxConnectedAudioDevicesPreferenceController extends private int mDefaultMaxConnectedAudioDevices = 0; - private final BluetoothManager mBluetoothManager; - public BluetoothMaxConnectedAudioDevicesPreferenceController(Context context) { super(context); - mBluetoothManager = context.getSystemService(BluetoothManager.class); + final BluetoothManager bluetoothManager = context.getSystemService(BluetoothManager.class); mDefaultMaxConnectedAudioDevices = - mBluetoothManager.getAdapter().getMaxConnectedAudioDevices(); + bluetoothManager.getAdapter().getMaxConnectedAudioDevices(); } @Override