Check gnssPowerStats increase after getting a location
Bug: 168123084
Test: on device
Change-Id: I5a306f91d1223cdc9f3616583d59cd2c707c80ea
diff --git a/gnss/aidl/default/GnssPowerIndication.cpp b/gnss/aidl/default/GnssPowerIndication.cpp
index 429cc8c..4dec1c6 100644
--- a/gnss/aidl/default/GnssPowerIndication.cpp
+++ b/gnss/aidl/default/GnssPowerIndication.cpp
@@ -50,13 +50,19 @@
};
GnssPowerStats gnssPowerStats = {
.elapsedRealtime = elapsedRealtime,
- .totalEnergyMilliJoule = 1.59975e+3,
- .singlebandTrackingModeEnergyMilliJoule = 1.2342e+3,
- .multibandTrackingModeEnergyMilliJoule = 3.653e+2,
+ .totalEnergyMilliJoule = 1.500e+3 + numLocationReported * 22.0,
+ .singlebandTrackingModeEnergyMilliJoule = 0.0,
+ .multibandTrackingModeEnergyMilliJoule = 1.28e+2 + numLocationReported * 4.0,
+ .singlebandAcquisitionModeEnergyMilliJoule = 0.0,
+ .multibandAcquisitionModeEnergyMilliJoule = 3.65e+2 + numLocationReported * 15.0,
.otherModesEnergyMilliJoule = {1.232e+2, 3.234e+3},
};
sCallback->gnssPowerStatsCb(gnssPowerStats);
return ndk::ScopedAStatus::ok();
}
+void GnssPowerIndication::notePowerConsumption() {
+ numLocationReported++;
+}
+
} // namespace aidl::android::hardware::gnss