Merge "Fix b/257404630 Inconsistent strings in battery chart"
diff --git a/res/layout/homepage_preference.xml b/res/layout/homepage_preference.xml
index ed1a2f1..18ecdcf 100644
--- a/res/layout/homepage_preference.xml
+++ b/res/layout/homepage_preference.xml
@@ -39,8 +39,8 @@
 
         <androidx.preference.internal.PreferenceImageView
             android:id="@android:id/icon"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
             app:maxWidth="48dp"
             app:maxHeight="48dp"/>
 
diff --git a/src/com/android/settings/bluetooth/Utils.java b/src/com/android/settings/bluetooth/Utils.java
index 24fe4e1..9aa363a 100644
--- a/src/com/android/settings/bluetooth/Utils.java
+++ b/src/com/android/settings/bluetooth/Utils.java
@@ -203,7 +203,7 @@
     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/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index 80c9ec6..f6dd0b7 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -382,10 +382,8 @@
         // Icon provided by the content provider overrides any static icon.
         if (tile.getMetaData() != null
                 && tile.getMetaData().containsKey(META_DATA_PREFERENCE_ICON_URI)) {
-            // Set a transparent color before starting to fetch the real icon, this is necessary
-            // to avoid preference padding change.
-            setPreferenceIcon(preference, tile, forceRoundedIcon, mContext.getPackageName(),
-                    Icon.createWithResource(mContext, android.R.color.transparent));
+            // Reserve the icon space to avoid preference padding change.
+            preference.setIconSpaceReserved(true);
 
             ThreadUtils.postOnBackgroundThread(() -> {
                 final Intent intent = tile.getIntent();
diff --git a/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java b/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java
index f1677f2..a1467c8 100644
--- a/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java
+++ b/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java
@@ -41,15 +41,13 @@
 
     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