battery usage UI: use a fallback name for unknown components

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
Dmitry Muhomor
2022-11-13 20:24:05 +02:00
committed by Joey
parent 77909062da
commit a70aa305d2

View File

@@ -616,14 +616,10 @@ public class BatteryEntry {
iconId = R.drawable.ic_settings_aod;
break;
default:
Log.w(
TAG,
"unknown attribute:"
+ DebugUtils.constantToString(
BatteryConsumer.class,
"POWER_COMPONENT_",
powerComponentId));
name = null;
String fieldName = DebugUtils.constantToString(
BatteryConsumer.class, "POWER_COMPONENT_", powerComponentId);
Log.w(TAG, "unknown attribute:" + fieldName);
name = context.getResources().getString(R.string.header_category_system) + " (" + fieldName + ")";
iconId = R.drawable.ic_power_system;
break;
}