diff options
author | Yingjie Wang <yingjiewang@codeaurora.org> | 2019-04-11 08:33:46 +0800 |
---|---|---|
committer | Yingjie Wang <yingjiewang@codeaurora.org> | 2019-06-05 08:10:23 +0800 |
commit | 2e7c04a82d85a3ddec7a7a024e00f65e1ee0b0c3 (patch) | |
tree | 281675ab3a2b61d3f3a9e7a3d8d214e66f5afd3c /android/1.1/Gnss.cpp | |
parent | 052afd6e47e58c88f00ea353f601592d308cbc72 (diff) | |
download | gps-2e7c04a82d85a3ddec7a7a024e00f65e1ee0b0c3.tar.gz |
Update SystemStatus with battery info in HealthHAL
Change-Id: Ibc2157f1834eb65da48f9375e497628411a185c9
CRs-fixed: 2433570
Diffstat (limited to 'android/1.1/Gnss.cpp')
-rw-r--r-- | android/1.1/Gnss.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/android/1.1/Gnss.cpp b/android/1.1/Gnss.cpp index f0d74da..bea556f 100644 --- a/android/1.1/Gnss.cpp +++ b/android/1.1/Gnss.cpp @@ -41,6 +41,7 @@ namespace gnss { namespace V1_1 { namespace implementation { +static sp<Gnss> sGnss; static std::string getVersionString() { static std::string version; if (!version.empty()) @@ -88,10 +89,14 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who } void location_on_battery_status_changed(bool charging) { - LOC_LOGd("%s: battery status changed to %s charging", __func__, charging ? "" : "not "); + LOC_LOGd("battery status changed to %s charging", charging ? "" : "not"); + if (sGnss != nullptr) { + sGnss->getGnssInterface()->updateBatteryStatus(charging); + } } Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); + sGnss = this; // register health client to listen on battery change loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig @@ -106,6 +111,7 @@ Gnss::~Gnss() { delete mApi; mApi = nullptr; } + sGnss = nullptr; } GnssAPIClient* Gnss::getApi() { |