Add content description for battery charging status icon

BUG: 372622360
Test: atest AdvancedBluetoothDetailsHeaderControllerTest
Flag: EXEMPT minor fix
Change-Id: I23a889e1576c0625cefb91386987df8826c1935f
This commit is contained in:
Haijie Hong
2024-12-30 15:07:10 +08:00
parent 75cae48694
commit cc28aba208
3 changed files with 29 additions and 9 deletions

View File

@@ -626,6 +626,11 @@ public class AdvancedBluetoothDetailsHeaderController extends BasePreferenceCont
imageView.setLayoutParams(layoutParams);
} else {
imageView.setImageDrawable(createBtBatteryIcon(mContext, level, charging));
imageView.setContentDescription(
mContext.getString(
charging
? R.string.device_details_battery_charging
: R.string.device_details_battery));
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
imageView.setLayoutParams(layoutParams);