Revert "sanders: GPS: Update from LA.UM.7.6.2.r1-04200-89xx.0 and update GPS packages"
This reverts commit a6c556a56ededa4a5d41912ad966e67e3ce655d6.
This commit is contained in:
10
device.mk
10
device.mk
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017-2018 The LineageOS Project
|
||||
# Copyright (C) 2017 The LineageOS Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -183,14 +183,12 @@ PRODUCT_PACKAGES += \
|
||||
android.hardware.gatekeeper@1.0-impl \
|
||||
android.hardware.gatekeeper@1.0-service
|
||||
|
||||
# GPS / Location
|
||||
# GPS
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gnss@1.0-impl-qti \
|
||||
android.hardware.gnss@1.0-service-qti \
|
||||
libgnss \
|
||||
libgnsspps \
|
||||
libcurl \
|
||||
libqsap_shim
|
||||
android.hardware.gnss@1.1-impl-qti \
|
||||
android.hardware.gnss@1.1-service-qti
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/gps/etc/cacert_location.pem:$(TARGET_COPY_OUT_VENDOR)/etc/cacert_location.pem \
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
static AGnss* spAGnss = nullptr;
|
||||
@@ -197,7 +197,7 @@ Return<bool> AGnss::setServer(IAGnssCallback::AGnssType type,
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IAGnss.h>
|
||||
#include <hidl/Status.h>
|
||||
@@ -28,7 +28,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnss;
|
||||
@@ -71,9 +71,9 @@ struct AGnss : public IAGnss {
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef void* (getLocationInterface)();
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRil;
|
||||
@@ -75,7 +75,7 @@ struct AGnssRil : public IAGnssRil {
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
|
||||
LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_SRC_FILES := \
|
||||
@@ -38,6 +38,7 @@ LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
libutils \
|
||||
android.hardware.gnss@1.0 \
|
||||
android.hardware.gnss@1.1 \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libloc_core \
|
||||
@@ -57,10 +58,10 @@ endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET
|
||||
|
||||
ifeq ($(BUILD_GNSS_HIDL_SERVICE), true)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
|
||||
LOCAL_MODULE := android.hardware.gnss@1.1-service-qti
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc
|
||||
LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc
|
||||
LOCAL_SRC_FILES := \
|
||||
service.cpp \
|
||||
|
||||
@@ -85,6 +86,7 @@ LOCAL_SHARED_LIBRARIES += \
|
||||
libhidlbase \
|
||||
libhidltransport \
|
||||
android.hardware.gnss@1.0 \
|
||||
android.hardware.gnss@1.1 \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
@@ -29,12 +29,52 @@
|
||||
|
||||
typedef void* (getLocationInterface)();
|
||||
|
||||
#define IMAGES_INFO_FILE "/sys/devices/soc0/images"
|
||||
#define DELIMITER ";"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
static std::string getVersionString() {
|
||||
static std::string version;
|
||||
if (!version.empty())
|
||||
return version;
|
||||
|
||||
char value[PROPERTY_VALUE_MAX] = {0};
|
||||
property_get("ro.hardware", value, "unknown");
|
||||
version.append(value).append(DELIMITER);
|
||||
|
||||
std::ifstream in(IMAGES_INFO_FILE);
|
||||
std::string s;
|
||||
while(getline(in, s)) {
|
||||
std::size_t found = s.find("CRM:");
|
||||
if (std::string::npos == found) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip over space characters after "CRM:"
|
||||
const char* substr = s.c_str();
|
||||
found += 4;
|
||||
while (0 != substr[found] && isspace(substr[found])) {
|
||||
found++;
|
||||
}
|
||||
if (s.find("11:") != found) {
|
||||
continue;
|
||||
}
|
||||
s.erase(0, found + 3);
|
||||
|
||||
found = s.find_first_of("\r\n");
|
||||
if (std::string::npos != found) {
|
||||
s.erase(s.begin() + found, s.end());
|
||||
}
|
||||
version.append(s).append(DELIMITER);
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
@@ -326,6 +366,75 @@ Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
|
||||
return mGnssRil;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnss follow.
|
||||
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();
|
||||
if (nullptr != gnssInterface) {
|
||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||
odcpiRequestCb(odcpiRequest);
|
||||
};
|
||||
gnssInterface->odcpiInit(cb);
|
||||
}
|
||||
return setCallback(callback);
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs,
|
||||
bool /*lowPowerMode*/) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
return setPositionMode(mode, recurrence, minIntervalMs,
|
||||
preferredAccuracyMeters, preferredTimeMs);
|
||||
}
|
||||
|
||||
Return<sp<V1_1::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_1_1() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasurement == nullptr)
|
||||
mGnssMeasurement = new GnssMeasurement();
|
||||
return mGnssMeasurement;
|
||||
}
|
||||
|
||||
Return<sp<V1_1::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_1_1() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssConfig == nullptr)
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
return mGnssConfig;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectBestLocation(const GnssLocation& gnssLocation) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
Location location = {};
|
||||
convertGnssLocation(gnssLocation, location);
|
||||
gnssInterface->odcpiInject(location);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssCbIface_1_1 != nullptr) {
|
||||
// For emergency mode, request DBH (Device based hybrid) location
|
||||
// Mark Independent from GNSS flag to false.
|
||||
if (ODCPI_REQUEST_TYPE_START == request.type) {
|
||||
auto r = mGnssCbIface_1_1->gnssRequestLocationCb(!request.isEmergencyMode);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGe("Error invoking gnssRequestLocationCb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGv("Unsupported ODCPI request type: %d", request.type);
|
||||
}
|
||||
} else {
|
||||
LOC_LOGe("ODCPI request not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
IGnss* HIDL_FETCH_IGnss(const char* hal) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
IGnss* iface = nullptr;
|
||||
@@ -337,7 +446,7 @@ IGnss* HIDL_FETCH_IGnss(const char* hal) {
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
|
||||
#include <AGnss.h>
|
||||
#include <AGnssRil.h>
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <GnssNi.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_array;
|
||||
@@ -95,6 +95,16 @@ struct Gnss : public IGnss {
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> getExtensionGnssDebug() override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnss follow.
|
||||
Return<bool> setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) override;
|
||||
Return<bool> setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs, bool lowPowerMode) override;
|
||||
Return<sp<V1_1::IGnssMeasurement>> getExtensionGnssMeasurement_1_1() override;
|
||||
Return<sp<V1_1::IGnssConfiguration>> getExtensionGnssConfiguration_1_1() override;
|
||||
Return<bool> injectBestLocation(const GnssLocation& location) override;
|
||||
|
||||
// These methods are not part of the IGnss base class.
|
||||
GnssAPIClient* getApi();
|
||||
Return<bool> setGnssNiCb(const sp<IGnssNiCallback>& niCb);
|
||||
@@ -127,6 +137,7 @@ struct Gnss : public IGnss {
|
||||
|
||||
GnssAPIClient* mApi = nullptr;
|
||||
sp<V1_0::IGnssCallback> mGnssCbIface = nullptr;
|
||||
sp<V1_1::IGnssCallback> mGnssCbIface_1_1 = nullptr;
|
||||
sp<V1_0::IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
GnssConfig mPendingConfig;
|
||||
GnssInterface* mGnssInterface = nullptr;
|
||||
@@ -135,9 +146,9 @@ struct Gnss : public IGnss {
|
||||
extern "C" IGnss* HIDL_FETCH_IGnss(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssBatching::GnssBatchingDeathRecipient::serviceDied(
|
||||
@@ -124,7 +124,7 @@ Return<void> GnssBatching::cleanup() {
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||
#include <hidl/Status.h>
|
||||
@@ -28,7 +28,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
@@ -72,9 +72,9 @@ struct GnssBatching : public IGnssBatching {
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
|
||||
@@ -220,8 +220,16 @@ Return<bool> GnssConfiguration::setEmergencySuplPdn(bool enabled) {
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setBlacklist(
|
||||
const hidl_vec<GnssConfiguration::BlacklistedSource>& /*blacklist*/) {
|
||||
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -19,19 +19,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssConfiguration.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssConfiguration.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssConfiguration;
|
||||
using ::android::hardware::gnss::V1_1::IGnssConfiguration;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
@@ -58,14 +58,18 @@ struct GnssConfiguration : public IGnssConfiguration {
|
||||
Return<bool> setEmergencySuplPdn(bool enable) override;
|
||||
Return<bool> setGpsLock(uint8_t lock) override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow.
|
||||
Return<bool> setBlacklist(
|
||||
const hidl_vec<GnssConfiguration::BlacklistedSource>& blacklist) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_vec;
|
||||
@@ -184,7 +184,7 @@ Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssDebug.h>
|
||||
@@ -24,7 +24,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssDebug;
|
||||
@@ -51,9 +51,9 @@ private:
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
|
||||
@@ -135,7 +135,7 @@ Return<void> GnssGeofencing::removeAllGeofences() {
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofencing.h>
|
||||
#include <hidl/Status.h>
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
@@ -83,9 +83,9 @@ struct GnssGeofencing : public IGnssGeofencing {
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
|
||||
@@ -89,13 +89,43 @@ Return<void> GnssMeasurement::close() {
|
||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
}
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
}
|
||||
mApi->measurementClose();
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
||||
const sp<IGnssMeasurementCallback>& callback, bool /*enableFullTracking*/) {
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
||||
}
|
||||
|
||||
if (callback == nullptr) {
|
||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mGnssMeasurementCbIface_1_1 = callback;
|
||||
mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
return mApi->measurementSetCallback_1_1(callback);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -18,21 +18,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
@@ -52,6 +52,11 @@ struct GnssMeasurement : public IGnssMeasurement {
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback) override;
|
||||
Return<void> close() override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> setCallback_1_1(
|
||||
const sp<IGnssMeasurementCallback>& callback,
|
||||
bool enableFullTracking) override;
|
||||
|
||||
private:
|
||||
struct GnssMeasurementDeathRecipient : hidl_death_recipient {
|
||||
GnssMeasurementDeathRecipient(sp<GnssMeasurement> gnssMeasurement) :
|
||||
@@ -65,13 +70,14 @@ struct GnssMeasurement : public IGnssMeasurement {
|
||||
private:
|
||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
MeasurementAPIClient* mApi;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
|
||||
@@ -79,7 +79,7 @@ Return<void> GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseT
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssNi.h>
|
||||
#include <hidl/Status.h>
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssNi;
|
||||
@@ -67,9 +67,9 @@ struct GnssNi : public IGnssNi {
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti
|
||||
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti
|
||||
class hal
|
||||
user gps
|
||||
group system gps radio
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
@@ -190,7 +190,7 @@ static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
class BatchingAPIClient : public LocationAPIClientBase
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
@@ -269,7 +269,7 @@ void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors,
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnss;
|
||||
@@ -531,7 +531,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssCallback.h>
|
||||
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssCallback.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssNiCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
@@ -182,7 +182,7 @@ void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEph
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void convertGnssLocation(Location& in, V1_0::GnssLocation& out);
|
||||
@@ -48,7 +48,7 @@ void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEph
|
||||
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -39,20 +39,23 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback;
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssData_1_1(GnssMeasurementsNotification& in,
|
||||
IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssMeasurement& out);
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
|
||||
|
||||
MeasurementAPIClient::MeasurementAPIClient() :
|
||||
mGnssMeasurementCbIface(nullptr),
|
||||
mGnssMeasurementCbIface_1_1(nullptr),
|
||||
mTracking(false)
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
@@ -76,6 +79,18 @@ MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCall
|
||||
return startTracking();
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback_1_1(const sp<IGnssMeasurementCallback>& callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssMeasurementCbIface_1_1 = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
return startTracking();
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::startTracking()
|
||||
{
|
||||
@@ -93,7 +108,7 @@ MeasurementAPIClient::startTracking()
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) {
|
||||
locationCallbacks.gnssMeasurementsCb =
|
||||
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
||||
onGnssMeasurementsCb(gnssMeasurementsNotification);
|
||||
@@ -129,12 +144,23 @@ void MeasurementAPIClient::onGnssMeasurementsCb(
|
||||
if (mTracking) {
|
||||
mMutex.lock();
|
||||
sp<V1_0::IGnssMeasurementCallback> gnssMeasurementCbIface = nullptr;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
sp<IGnssMeasurementCallback> gnssMeasurementCbIface_1_1 = nullptr;
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1;
|
||||
} else if (mGnssMeasurementCbIface != nullptr) {
|
||||
gnssMeasurementCbIface = mGnssMeasurementCbIface;
|
||||
}
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssMeasurementCbIface != nullptr) {
|
||||
if (gnssMeasurementCbIface_1_1 != nullptr) {
|
||||
IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData_1_1(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface_1_1->gnssMeasurementCb(gnssData);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssMeasurementCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssMeasurementCbIface != nullptr) {
|
||||
V1_0::IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData);
|
||||
@@ -268,8 +294,18 @@ static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
static void convertGnssData_1_1(GnssMeasurementsNotification& in,
|
||||
IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
out.measurements.resize(in.count);
|
||||
for (size_t i = 0; i < in.count; i++) {
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0);
|
||||
}
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
#define MEASUREMENT_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurementCallback.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssMeasurementCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
@@ -55,6 +55,8 @@ public:
|
||||
// for GpsMeasurementInterface
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback);
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_1_1(
|
||||
const sp<IGnssMeasurementCallback>& callback);
|
||||
void measurementClose();
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking();
|
||||
|
||||
@@ -64,12 +66,13 @@ public:
|
||||
private:
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface;
|
||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1;
|
||||
|
||||
bool mTracking;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
|
||||
using android::hardware::gnss::V1_0::IGnss;
|
||||
using android::hardware::gnss::V1_1::IGnss;
|
||||
using android::hardware::defaultPassthroughServiceImplementation;
|
||||
|
||||
int main() {
|
||||
|
||||
@@ -328,12 +328,9 @@ void SystemStatusOsObserver::notify(const list<IDataItemCore*>& dlist)
|
||||
for (auto client : clientSet) {
|
||||
unordered_set<DataItemId> dataItemIdsForThisClient(
|
||||
mParent->mClientToDataItems.getValSet(client));
|
||||
for (auto itr = dataItemIdsForThisClient.begin();
|
||||
itr != dataItemIdsForThisClient.end(); ) {
|
||||
if (dataItemIdsToBeSent.find(*itr) == dataItemIdsToBeSent.end()) {
|
||||
itr = dataItemIdsForThisClient.erase(itr);
|
||||
} else {
|
||||
itr++;
|
||||
for (auto id : dataItemIdsForThisClient) {
|
||||
if (dataItemIdsToBeSent.find(id) == dataItemIdsToBeSent.end()) {
|
||||
dataItemIdsForThisClient.erase(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -766,9 +766,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
err = mApi.setGpsLock(mConfig.gpsLock);
|
||||
}
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
||||
uint32_t newSuplVersion = mAdapter.convertSuplVersion(mConfig.suplVersion);
|
||||
@@ -780,9 +779,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
}
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||
if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) {
|
||||
@@ -810,9 +808,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
err = LOCATION_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
||||
uint32_t newLppProfile = mAdapter.convertLppProfile(mConfig.lppProfile);
|
||||
@@ -824,9 +821,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
}
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
||||
uint32_t newLppeControlPlaneMask =
|
||||
@@ -838,9 +834,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
}
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
||||
uint32_t newLppeUserPlaneMask =
|
||||
@@ -852,9 +847,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
}
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
||||
uint32_t newAGloProtMask =
|
||||
@@ -867,9 +861,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
}
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) {
|
||||
uint32_t newEP4ES = mAdapter.convertEP4ES(mConfig.emergencyPdnForEmergencySupl);
|
||||
@@ -878,9 +871,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
}
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) {
|
||||
uint32_t newSuplEs = mAdapter.convertSuplEs(mConfig.suplEmergencyServices);
|
||||
@@ -889,9 +881,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
}
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) {
|
||||
uint32_t newSuplMode = mAdapter.convertSuplMode(mConfig.suplModeMask);
|
||||
@@ -903,9 +894,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||
}
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
if (index < mCount) {
|
||||
errs[index] = err;
|
||||
errs[index++] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
mAdapter.reportResponse(index, errs, mIds);
|
||||
|
||||
@@ -160,13 +160,13 @@ extern char* get_timestamp(char* str, unsigned long buf_size);
|
||||
|
||||
|
||||
// Used for logging callflow from Android Framework
|
||||
#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __FUNCTION__, %s, "")
|
||||
#define ENTRY_LOG_CALLFLOW() LOG_V(FROM_AFW, __FUNCTION__, %s, "")
|
||||
// Used for logging callflow to Modem
|
||||
#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __FUNCTION__, SPEC, VAL)
|
||||
#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_V(TO_MODEM, __FUNCTION__, SPEC, VAL)
|
||||
// Used for logging callflow from Modem(TO_MODEM, __FUNCTION__, %s, "")
|
||||
#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __FUNCTION__, SPEC, VAL)
|
||||
#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_V(FROM_MODEM, __FUNCTION__, SPEC, VAL)
|
||||
// Used for logging callflow to Android Framework
|
||||
#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL)
|
||||
#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_V(TO_AFW, CB, SPEC, VAL)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user