wayne-common: Update GPS from LA.UM.7.2.r1-05800-sdm660.0
Change-Id: Idaec6889200d67c776222aebecdc9c0255e2b963 Signed-off-by: PIPIPIG233666 <2212848813@qq.com>
This commit is contained in:
parent
b460d319e8
commit
e5b5dcfa26
33 changed files with 123 additions and 322 deletions
|
@ -27,7 +27,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
static AGnss* spAGnss = nullptr;
|
||||
|
@ -197,7 +197,7 @@ Return<bool> AGnss::setServer(IAGnssCallback::AGnssType type,
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_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_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnss;
|
||||
|
@ -71,9 +71,9 @@ struct AGnss : public IAGnss {
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef void* (getLocationInterface)();
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
|
||||
|
@ -87,7 +87,7 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRil;
|
||||
|
@ -75,7 +75,7 @@ struct AGnssRil : public IAGnssRil {
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_SRC_FILES := \
|
||||
|
@ -38,7 +38,6 @@ LOCAL_SHARED_LIBRARIES := \
|
|||
libcutils \
|
||||
libutils \
|
||||
android.hardware.gnss@1.0 \
|
||||
android.hardware.gnss@1.1 \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libloc_core \
|
||||
|
@ -58,10 +57,10 @@ endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET
|
|||
|
||||
ifeq ($(BUILD_GNSS_HIDL_SERVICE), true)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.1-service-qti
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc
|
||||
LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc
|
||||
LOCAL_SRC_FILES := \
|
||||
service.cpp \
|
||||
|
||||
|
@ -86,7 +85,6 @@ LOCAL_SHARED_LIBRARIES += \
|
|||
libhidlbase \
|
||||
libhidltransport \
|
||||
android.hardware.gnss@1.0 \
|
||||
android.hardware.gnss@1.1 \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
|
|
@ -29,52 +29,12 @@
|
|||
|
||||
typedef void* (getLocationInterface)();
|
||||
|
||||
#define IMAGES_INFO_FILE "/sys/devices/soc0/images"
|
||||
#define DELIMITER ";"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
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);
|
||||
|
@ -366,75 +326,6 @@ 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;
|
||||
|
@ -446,7 +337,7 @@ IGnss* HIDL_FETCH_IGnss(const char* hal) {
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
|
||||
#include <AGnss.h>
|
||||
#include <AGnssRil.h>
|
||||
|
@ -30,7 +30,7 @@
|
|||
#include <GnssNi.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_array;
|
||||
|
@ -95,16 +95,6 @@ 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);
|
||||
|
@ -137,7 +127,6 @@ 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;
|
||||
|
@ -146,9 +135,9 @@ struct Gnss : public IGnss {
|
|||
extern "C" IGnss* HIDL_FETCH_IGnss(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssBatching::GnssBatchingDeathRecipient::serviceDied(
|
||||
|
@ -124,7 +124,7 @@ Return<void> GnssBatching::cleanup() {
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_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_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
|
@ -72,9 +72,9 @@ struct GnssBatching : public IGnssBatching {
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
|
||||
|
@ -220,16 +220,8 @@ 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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -19,19 +19,19 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
|
||||
#include <android/hardware/gnss/1.1/IGnssConfiguration.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssConfiguration.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_1::IGnssConfiguration;
|
||||
using ::android::hardware::gnss::V1_0::IGnssConfiguration;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
|
@ -58,18 +58,14 @@ 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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_vec;
|
||||
|
@ -184,7 +184,7 @@ Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssDebug.h>
|
||||
|
@ -24,7 +24,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssDebug;
|
||||
|
@ -51,9 +51,9 @@ private:
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
|
||||
|
@ -135,7 +135,7 @@ Return<void> GnssGeofencing::removeAllGeofences() {
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_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_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
|
@ -83,9 +83,9 @@ struct GnssGeofencing : public IGnssGeofencing {
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
|
||||
|
@ -89,43 +89,13 @@ 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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -18,21 +18,21 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
|
||||
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback;
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
|
@ -52,11 +52,6 @@ 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) :
|
||||
|
@ -70,14 +65,13 @@ 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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_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_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssNi;
|
||||
|
@ -67,9 +67,9 @@ struct GnssNi : public IGnssNi {
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti
|
||||
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti
|
||||
class hal
|
||||
user gps
|
||||
group system gps radio
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
class BatchingAPIClient : public LocationAPIClientBase
|
||||
|
@ -67,7 +67,7 @@ private:
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
@ -69,7 +69,7 @@ private:
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnss;
|
||||
|
@ -531,7 +531,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -32,15 +32,15 @@
|
|||
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssCallback.h>
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssCallback.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssNiCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
@ -101,7 +101,7 @@ private:
|
|||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
@ -182,7 +182,7 @@ void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEph
|
|||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -39,23 +39,20 @@
|
|||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback;
|
||||
using ::android::hardware::gnss::V1_0::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__);
|
||||
|
@ -79,18 +76,6 @@ 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()
|
||||
{
|
||||
|
@ -108,7 +93,7 @@ MeasurementAPIClient::startTracking()
|
|||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) {
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
locationCallbacks.gnssMeasurementsCb =
|
||||
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
||||
onGnssMeasurementsCb(gnssMeasurementsNotification);
|
||||
|
@ -144,23 +129,12 @@ void MeasurementAPIClient::onGnssMeasurementsCb(
|
|||
if (mTracking) {
|
||||
mMutex.lock();
|
||||
sp<V1_0::IGnssMeasurementCallback> gnssMeasurementCbIface = nullptr;
|
||||
sp<IGnssMeasurementCallback> gnssMeasurementCbIface_1_1 = nullptr;
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1;
|
||||
} else if (mGnssMeasurementCbIface != nullptr) {
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
gnssMeasurementCbIface = mGnssMeasurementCbIface;
|
||||
}
|
||||
mMutex.unlock();
|
||||
|
||||
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) {
|
||||
if (gnssMeasurementCbIface != nullptr) {
|
||||
V1_0::IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData);
|
||||
|
@ -294,18 +268,8 @@ 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_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -31,15 +31,15 @@
|
|||
#define MEASUREMENT_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssMeasurementCallback.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurementCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
@ -55,8 +55,6 @@ 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();
|
||||
|
||||
|
@ -66,13 +64,12 @@ public:
|
|||
private:
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface;
|
||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1;
|
||||
|
||||
bool mTracking;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
|
||||
using android::hardware::gnss::V1_1::IGnss;
|
||||
using android::hardware::gnss::V1_0::IGnss;
|
||||
using android::hardware::defaultPassthroughServiceImplementation;
|
||||
|
||||
int main() {
|
||||
|
|
|
@ -766,8 +766,9 @@ 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);
|
||||
|
@ -779,8 +780,9 @@ 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) {
|
||||
|
@ -808,8 +810,9 @@ 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);
|
||||
|
@ -821,8 +824,9 @@ 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 =
|
||||
|
@ -834,8 +838,9 @@ 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 =
|
||||
|
@ -847,8 +852,9 @@ 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 =
|
||||
|
@ -861,8 +867,9 @@ 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);
|
||||
|
@ -871,8 +878,9 @@ 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);
|
||||
|
@ -881,8 +889,9 @@ 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);
|
||||
|
@ -894,8 +903,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
|||
}
|
||||
err = LOCATION_ERROR_SUCCESS;
|
||||
if (index < mCount) {
|
||||
errs[index++] = err;
|
||||
errs[index] = err;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
mAdapter.reportResponse(index, errs, mIds);
|
||||
|
@ -1957,7 +1967,6 @@ GnssAdapter::enableCommand(LocationTechnologyType techType)
|
|||
} else if (powerVoteId > 0) {
|
||||
err = LOCATION_ERROR_ALREADY_STARTED;
|
||||
} else {
|
||||
mContext.modemPowerVote(true);
|
||||
mAdapter.setPowerVoteId(mSessionId);
|
||||
mApi.setGpsLock(GNSS_CONFIG_GPS_LOCK_NONE);
|
||||
mAdapter.mXtraObserver.updateLockStatus(
|
||||
|
@ -1969,6 +1978,7 @@ GnssAdapter::enableCommand(LocationTechnologyType techType)
|
|||
|
||||
if (mContext != NULL) {
|
||||
sendMsg(new MsgEnableGnss(*this, *mLocApi, *mContext, sessionId, techType));
|
||||
mContext->modemPowerVote(true);
|
||||
} else {
|
||||
LOC_LOGE("%s]: Context is NULL", __func__);
|
||||
}
|
||||
|
@ -2001,7 +2011,6 @@ GnssAdapter::disableCommand(uint32_t id)
|
|||
if (powerVoteId != mSessionId) {
|
||||
err = LOCATION_ERROR_ID_UNKNOWN;
|
||||
} else {
|
||||
mContext.modemPowerVote(false);
|
||||
mAdapter.setPowerVoteId(0);
|
||||
mApi.setGpsLock(mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK));
|
||||
mAdapter.mXtraObserver.updateLockStatus(
|
||||
|
@ -2013,6 +2022,7 @@ GnssAdapter::disableCommand(uint32_t id)
|
|||
|
||||
if (mContext != NULL) {
|
||||
sendMsg(new MsgDisableGnss(*this, *mLocApi, *mContext, id));
|
||||
mContext->modemPowerVote(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
4
wayne.mk
4
wayne.mk
|
@ -219,8 +219,8 @@ PRODUCT_PACKAGES += \
|
|||
|
||||
# GPS / Location
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gnss@1.1-impl-qti \
|
||||
android.hardware.gnss@1.1-service-qti \
|
||||
android.hardware.gnss@1.0-impl-qti \
|
||||
android.hardware.gnss@1.0-service-qti \
|
||||
libgnss \
|
||||
libgnsspps \
|
||||
libgps.utils \
|
||||
|
|
Loading…
Reference in a new issue