Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80ec0f80 authored by Benjamin Schwartz's avatar Benjamin Schwartz
Browse files

powerstats: Print exception message in wrapper

Bug: 182092453
Test: Presubmit
Change-Id: I0feed3dc1c6afa8bec1afa651e75b243a18441eb
parent b95b1a2e
Loading
Loading
Loading
Loading
+7 −10
Original line number Original line Diff line number Diff line
@@ -166,7 +166,7 @@ public final class PowerStatsHALWrapper {
                try {
                try {
                    powerEntityHAL = sVintfPowerStats.get().getPowerEntityInfo();
                    powerEntityHAL = sVintfPowerStats.get().getPowerEntityInfo();
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    if (DEBUG) Slog.d(TAG, "Failed to get power entity info from PowerStats HAL");
                    Slog.w(TAG, "Failed to get power entity info: ", e);
                }
                }
            }
            }


@@ -183,7 +183,7 @@ public final class PowerStatsHALWrapper {
                    stateResidencyResultHAL =
                    stateResidencyResultHAL =
                        sVintfPowerStats.get().getStateResidency(powerEntityIds);
                        sVintfPowerStats.get().getStateResidency(powerEntityIds);
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    if (DEBUG) Slog.d(TAG, "Failed to get state residency from PowerStats HAL");
                    Slog.w(TAG, "Failed to get state residency: ", e);
                }
                }
            }
            }


@@ -198,9 +198,7 @@ public final class PowerStatsHALWrapper {
                try {
                try {
                    energyConsumerHAL = sVintfPowerStats.get().getEnergyConsumerInfo();
                    energyConsumerHAL = sVintfPowerStats.get().getEnergyConsumerInfo();
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    if (DEBUG) {
                    Slog.w(TAG, "Failed to get energy consumer info: ", e);
                        Slog.d(TAG, "Failed to get energy consumer info from PowerStats HAL");
                    }
                }
                }
            }
            }


@@ -217,9 +215,7 @@ public final class PowerStatsHALWrapper {
                    energyConsumedHAL =
                    energyConsumedHAL =
                        sVintfPowerStats.get().getEnergyConsumed(energyConsumerIds);
                        sVintfPowerStats.get().getEnergyConsumed(energyConsumerIds);
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    if (DEBUG) {
                    Slog.w(TAG, "Failed to get energy consumer results: ", e);
                        Slog.d(TAG, "Failed to get energy consumer results from PowerStats HAL");
                    }
                }
                }
            }
            }


@@ -234,7 +230,7 @@ public final class PowerStatsHALWrapper {
                try {
                try {
                    energyMeterInfoHAL = sVintfPowerStats.get().getEnergyMeterInfo();
                    energyMeterInfoHAL = sVintfPowerStats.get().getEnergyMeterInfo();
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    if (DEBUG) Slog.d(TAG, "Failed to get energy meter info from PowerStats HAL");
                    Slog.w(TAG, "Failed to get energy meter info: ", e);
                }
                }
            }
            }


@@ -250,7 +246,7 @@ public final class PowerStatsHALWrapper {
                    energyMeasurementHAL =
                    energyMeasurementHAL =
                        sVintfPowerStats.get().readEnergyMeter(channelIds);
                        sVintfPowerStats.get().readEnergyMeter(channelIds);
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    if (DEBUG) Slog.d(TAG, "Failed to get energy measurements from PowerStats HAL");
                    Slog.w(TAG, "Failed to get energy measurements: ", e);
                }
                }
            }
            }


@@ -367,6 +363,7 @@ public final class PowerStatsHALWrapper {


        @Override
        @Override
        public synchronized void binderDied() {
        public synchronized void binderDied() {
            Slog.w(TAG, "PowerStats HAL died");
            mInstance = null;
            mInstance = null;
        }
        }
    }
    }