summaryrefslogtreecommitdiff
path: root/android/1.1/Gnss.cpp
diff options
context:
space:
mode:
authorHoss Zhou <zhouh@codeaurora.org>2019-04-04 14:22:23 +0800
committerHoss Zhou <zhouh@codeaurora.org>2019-04-10 13:52:29 +0800
commit313284b9ddbad37302a90bd53521f1046ba91834 (patch)
treea7c258ea0c689015aec02ccb43fcd8510faca67a /android/1.1/Gnss.cpp
parenta6c61bde6a815aa723fd3dc144875e5758349955 (diff)
downloadgps-313284b9ddbad37302a90bd53521f1046ba91834.tar.gz
fix CFI issues
Change-Id: I5b94804c381f1d26196ddf6dee97adbee36dc128 CRs-Fixed: 2353650
Diffstat (limited to 'android/1.1/Gnss.cpp')
-rw-r--r--android/1.1/Gnss.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/android/1.1/Gnss.cpp b/android/1.1/Gnss.cpp
index fca72e6..8d5d8a8 100644
--- a/android/1.1/Gnss.cpp
+++ b/android/1.1/Gnss.cpp
@@ -27,7 +27,7 @@
#include "Gnss.h"
#include <LocationUtil.h>
-typedef void* (getLocationInterface)();
+typedef const GnssInterface* (getLocationInterface)();
#define IMAGES_INFO_FILE "/sys/devices/soc0/images"
#define DELIMITER ";"
@@ -124,7 +124,7 @@ GnssAPIClient* Gnss::getApi() {
return mApi;
}
-GnssInterface* Gnss::getGnssInterface() {
+const GnssInterface* Gnss::getGnssInterface() {
static bool getGnssInterfaceFailed = false;
if (nullptr == mGnssInterface && !getGnssInterfaceFailed) {
LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__);
@@ -145,7 +145,7 @@ GnssInterface* Gnss::getGnssInterface() {
if (NULL == getter) {
getGnssInterfaceFailed = true;
} else {
- mGnssInterface = (GnssInterface*)(*getter)();
+ mGnssInterface = (const GnssInterface*)(*getter)();
}
}
return mGnssInterface;
@@ -278,7 +278,7 @@ Return<bool> Gnss::injectLocation(double latitudeDegrees,
double longitudeDegrees,
float accuracyMeters) {
ENTRY_LOG_CALLFLOW();
- GnssInterface* gnssInterface = getGnssInterface();
+ const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters);
return true;
@@ -290,7 +290,7 @@ Return<bool> Gnss::injectLocation(double latitudeDegrees,
Return<bool> Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs,
int32_t uncertaintyMs) {
ENTRY_LOG_CALLFLOW();
- GnssInterface* gnssInterface = getGnssInterface();
+ const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs);
return true;
@@ -375,7 +375,7 @@ Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) {
ENTRY_LOG_CALLFLOW();
callback->gnssNameCb(getVersionString());
mGnssCbIface_1_1 = callback;
- GnssInterface* gnssInterface = getGnssInterface();
+ const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
@@ -419,7 +419,7 @@ Return<sp<V1_1::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_1_1() {
Return<bool> Gnss::injectBestLocation(const GnssLocation& gnssLocation) {
ENTRY_LOG_CALLFLOW();
- GnssInterface* gnssInterface = getGnssInterface();
+ const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
Location location = {};
convertGnssLocation(gnssLocation, location);
@@ -446,9 +446,9 @@ void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) {
}
}
-IGnss* HIDL_FETCH_IGnss(const char* hal) {
+V1_0::IGnss* HIDL_FETCH_IGnss(const char* hal) {
ENTRY_LOG_CALLFLOW();
- IGnss* iface = nullptr;
+ V1_0::IGnss* iface = nullptr;
iface = new Gnss();
if (iface == nullptr) {
LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal);