Add debug logs for updateBatteryStatus and TopLevelBatteryPreferenceController updating.
Bug: 271665638 Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.fuelgauge" Change-Id: I1c9cc3cfcb54051223df2ad46947d7f0c1ebbdb0
This commit is contained in:
@@ -116,12 +116,21 @@ public class BatteryBroadcastReceiver extends BroadcastReceiver {
|
||||
return;
|
||||
}
|
||||
final String action = intent.getAction();
|
||||
Log.d(TAG, "updateBatteryStatus: action=" + action);
|
||||
if (Intent.ACTION_BATTERY_CHANGED.equals(action)) {
|
||||
final String batteryLevel = Utils.getBatteryPercentage(intent);
|
||||
final String batteryStatus =
|
||||
Utils.getBatteryStatus(mContext, intent, /* compactStatus= */ false);
|
||||
final int batteryHealth = intent.getIntExtra(
|
||||
BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_UNKNOWN);
|
||||
Log.d(
|
||||
TAG,
|
||||
"Battery changed: level="
|
||||
+ batteryLevel
|
||||
+ ", status="
|
||||
+ batteryStatus
|
||||
+ ", health="
|
||||
+ batteryHealth);
|
||||
if (!Utils.isBatteryPresent(intent)) {
|
||||
Log.w(TAG, "Problem reading the battery meter.");
|
||||
mBatteryListener.onBatteryChanged(BatteryUpdateType.BATTERY_NOT_PRESENT);
|
||||
|
||||
Reference in New Issue
Block a user