Loading gnss/2.0/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -8,14 +8,17 @@ hidl_interface { }, }, srcs: [ srcs: [ "IGnss.hal", "IGnss.hal", "IGnssCallback.hal", "IGnssMeasurement.hal", "IGnssMeasurement.hal", "IGnssMeasurementCallback.hal", "IGnssMeasurementCallback.hal", ], ], interfaces: [ interfaces: [ "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.1", "android.hidl.base@1.0", "android.hidl.base@1.0", ], ], gen_java: true, gen_java: true, gen_java_constants: true, } } gnss/2.0/IGnss.hal +20 −0 Original line number Original line Diff line number Diff line Loading @@ -16,12 +16,24 @@ package android.hardware.gnss@2.0; package android.hardware.gnss@2.0; import android.hardware.gnss.measurement_corrections@1.0::IMeasurementCorrections; import @1.1::IGnss; import @1.1::IGnss; import IGnssCallback; import IGnssMeasurement; import IGnssMeasurement; /** Represents the standard GNSS (Global Navigation Satellite System) interface. */ /** Represents the standard GNSS (Global Navigation Satellite System) interface. */ interface IGnss extends @1.1::IGnss { interface IGnss extends @1.1::IGnss { /** * Opens the interface and provides the callback routines to the implementation of this * interface. * * @param callback Callback interface for IGnss. * * @return success Returns true on success. */ setCallback_2_0(IGnssCallback callback) generates (bool success); /** /** * This method returns the IGnssMeasurement interface. * This method returns the IGnssMeasurement interface. * * Loading @@ -31,4 +43,12 @@ interface IGnss extends @1.1::IGnss { * @return gnssMeasurementIface Handle to the IGnssMeasurement interface. * @return gnssMeasurementIface Handle to the IGnssMeasurement interface. */ */ getExtensionGnssMeasurement_2_0() generates (IGnssMeasurement gnssMeasurementIface); getExtensionGnssMeasurement_2_0() generates (IGnssMeasurement gnssMeasurementIface); /** * This method returns the IMeasurementCorrections interface. * * @return measurementCorrectionsIface Handle to the IMeasurementCorrections interface. */ getExtensionMeasurementCorrections() generates (IMeasurementCorrections measurementCorrectionsIface); }; }; No newline at end of file gnss/2.0/IGnssCallback.hal 0 → 100644 +47 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.gnss@2.0; import @1.0::IGnssCallback; import @1.1::IGnssCallback; /** * The interface is required for the HAL to communicate certain information * like status and location info back to the platform, the platform implements * the interfaces and passes a handle to the HAL. */ interface IGnssCallback extends @1.1::IGnssCallback { /** Flags for the gnssSetCapabilities callback. */ @export(name="", value_prefix="GPS_CAPABILITY_") enum Capabilities : @1.0::IGnssCallback.Capabilities { /** GNSS supports line-of-sight satellite identification measurement Corrections */ MEASUREMENT_CORRECTIONS_LOS_SATS = 1 << 8, /** GNSS supports per satellite excess-path-length measurement Corrections */ MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH = 1 << 10, /** GNSS supports reflecting planes measurement Corrections */ MEASUREMENT_CORRECTIONS_REFLECTING_PLANE = 1 << 20 }; /** * Callback to inform framework of the GNSS engine's capabilities. * * @param capabilities Capability parameter is a bit field of the Capabilities enum. */ gnssSetCapabilitiesCb_2_0(bitfield<Capabilities> capabilities); }; No newline at end of file gnss/2.0/default/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ cc_binary { "libutils", "libutils", "liblog", "liblog", "android.hardware.gnss@2.0", "android.hardware.gnss@2.0", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.1", ], ], Loading gnss/2.0/default/Gnss.cpp +43 −5 Original line number Original line Diff line number Diff line Loading @@ -25,7 +25,8 @@ namespace gnss { namespace V2_0 { namespace V2_0 { namespace implementation { namespace implementation { sp<V1_1::IGnssCallback> Gnss::sGnssCallback = nullptr; sp<V2_0::IGnssCallback> Gnss::sGnssCallback_2_0 = nullptr; sp<V1_1::IGnssCallback> Gnss::sGnssCallback_1_1 = nullptr; // Methods from V1_0::IGnss follow. // Methods from V1_0::IGnss follow. Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>&) { Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>&) { Loading Loading @@ -128,23 +129,23 @@ Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) { return false; return false; } } sGnssCallback = callback; sGnssCallback_1_1 = callback; uint32_t capabilities = 0x0; uint32_t capabilities = 0x0; auto ret = sGnssCallback->gnssSetCapabilitesCb(capabilities); auto ret = sGnssCallback_1_1->gnssSetCapabilitesCb(capabilities); if (!ret.isOk()) { if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); ALOGE("%s: Unable to invoke callback", __func__); } } V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; ret = sGnssCallback->gnssSetSystemInfoCb(gnssInfo); ret = sGnssCallback_1_1->gnssSetSystemInfoCb(gnssInfo); if (!ret.isOk()) { if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); ALOGE("%s: Unable to invoke callback", __func__); } } auto gnssName = "Google Mock GNSS Implementation v2.0"; auto gnssName = "Google Mock GNSS Implementation v2.0"; ret = sGnssCallback->gnssNameCb(gnssName); ret = sGnssCallback_1_1->gnssNameCb(gnssName); if (!ret.isOk()) { if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); ALOGE("%s: Unable to invoke callback", __func__); } } Loading Loading @@ -180,6 +181,43 @@ Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() { return sp<V2_0::IGnssMeasurement>{}; return sp<V2_0::IGnssMeasurement>{}; } } Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>> Gnss::getExtensionMeasurementCorrections() { // TODO implement return sp<measurement_corrections::V1_0::IMeasurementCorrections>{}; } Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) { ALOGD("Gnss::setCallback_2_0"); if (callback == nullptr) { ALOGE("%s: Null callback ignored", __func__); return false; } sGnssCallback_2_0 = callback; uint32_t capabilities = 0x0; auto ret = sGnssCallback_2_0->gnssSetCapabilitesCb(capabilities); if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); } V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; ret = sGnssCallback_2_0->gnssSetSystemInfoCb(gnssInfo); if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); } auto gnssName = "Google Mock GNSS Implementation v2.0"; ret = sGnssCallback_2_0->gnssNameCb(gnssName); if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); } return true; } } // namespace implementation } // namespace implementation } // namespace V2_0 } // namespace V2_0 } // namespace gnss } // namespace gnss Loading Loading
gnss/2.0/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -8,14 +8,17 @@ hidl_interface { }, }, srcs: [ srcs: [ "IGnss.hal", "IGnss.hal", "IGnssCallback.hal", "IGnssMeasurement.hal", "IGnssMeasurement.hal", "IGnssMeasurementCallback.hal", "IGnssMeasurementCallback.hal", ], ], interfaces: [ interfaces: [ "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.1", "android.hidl.base@1.0", "android.hidl.base@1.0", ], ], gen_java: true, gen_java: true, gen_java_constants: true, } }
gnss/2.0/IGnss.hal +20 −0 Original line number Original line Diff line number Diff line Loading @@ -16,12 +16,24 @@ package android.hardware.gnss@2.0; package android.hardware.gnss@2.0; import android.hardware.gnss.measurement_corrections@1.0::IMeasurementCorrections; import @1.1::IGnss; import @1.1::IGnss; import IGnssCallback; import IGnssMeasurement; import IGnssMeasurement; /** Represents the standard GNSS (Global Navigation Satellite System) interface. */ /** Represents the standard GNSS (Global Navigation Satellite System) interface. */ interface IGnss extends @1.1::IGnss { interface IGnss extends @1.1::IGnss { /** * Opens the interface and provides the callback routines to the implementation of this * interface. * * @param callback Callback interface for IGnss. * * @return success Returns true on success. */ setCallback_2_0(IGnssCallback callback) generates (bool success); /** /** * This method returns the IGnssMeasurement interface. * This method returns the IGnssMeasurement interface. * * Loading @@ -31,4 +43,12 @@ interface IGnss extends @1.1::IGnss { * @return gnssMeasurementIface Handle to the IGnssMeasurement interface. * @return gnssMeasurementIface Handle to the IGnssMeasurement interface. */ */ getExtensionGnssMeasurement_2_0() generates (IGnssMeasurement gnssMeasurementIface); getExtensionGnssMeasurement_2_0() generates (IGnssMeasurement gnssMeasurementIface); /** * This method returns the IMeasurementCorrections interface. * * @return measurementCorrectionsIface Handle to the IMeasurementCorrections interface. */ getExtensionMeasurementCorrections() generates (IMeasurementCorrections measurementCorrectionsIface); }; }; No newline at end of file
gnss/2.0/IGnssCallback.hal 0 → 100644 +47 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.gnss@2.0; import @1.0::IGnssCallback; import @1.1::IGnssCallback; /** * The interface is required for the HAL to communicate certain information * like status and location info back to the platform, the platform implements * the interfaces and passes a handle to the HAL. */ interface IGnssCallback extends @1.1::IGnssCallback { /** Flags for the gnssSetCapabilities callback. */ @export(name="", value_prefix="GPS_CAPABILITY_") enum Capabilities : @1.0::IGnssCallback.Capabilities { /** GNSS supports line-of-sight satellite identification measurement Corrections */ MEASUREMENT_CORRECTIONS_LOS_SATS = 1 << 8, /** GNSS supports per satellite excess-path-length measurement Corrections */ MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH = 1 << 10, /** GNSS supports reflecting planes measurement Corrections */ MEASUREMENT_CORRECTIONS_REFLECTING_PLANE = 1 << 20 }; /** * Callback to inform framework of the GNSS engine's capabilities. * * @param capabilities Capability parameter is a bit field of the Capabilities enum. */ gnssSetCapabilitiesCb_2_0(bitfield<Capabilities> capabilities); }; No newline at end of file
gnss/2.0/default/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ cc_binary { "libutils", "libutils", "liblog", "liblog", "android.hardware.gnss@2.0", "android.hardware.gnss@2.0", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.1", ], ], Loading
gnss/2.0/default/Gnss.cpp +43 −5 Original line number Original line Diff line number Diff line Loading @@ -25,7 +25,8 @@ namespace gnss { namespace V2_0 { namespace V2_0 { namespace implementation { namespace implementation { sp<V1_1::IGnssCallback> Gnss::sGnssCallback = nullptr; sp<V2_0::IGnssCallback> Gnss::sGnssCallback_2_0 = nullptr; sp<V1_1::IGnssCallback> Gnss::sGnssCallback_1_1 = nullptr; // Methods from V1_0::IGnss follow. // Methods from V1_0::IGnss follow. Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>&) { Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>&) { Loading Loading @@ -128,23 +129,23 @@ Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) { return false; return false; } } sGnssCallback = callback; sGnssCallback_1_1 = callback; uint32_t capabilities = 0x0; uint32_t capabilities = 0x0; auto ret = sGnssCallback->gnssSetCapabilitesCb(capabilities); auto ret = sGnssCallback_1_1->gnssSetCapabilitesCb(capabilities); if (!ret.isOk()) { if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); ALOGE("%s: Unable to invoke callback", __func__); } } V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; ret = sGnssCallback->gnssSetSystemInfoCb(gnssInfo); ret = sGnssCallback_1_1->gnssSetSystemInfoCb(gnssInfo); if (!ret.isOk()) { if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); ALOGE("%s: Unable to invoke callback", __func__); } } auto gnssName = "Google Mock GNSS Implementation v2.0"; auto gnssName = "Google Mock GNSS Implementation v2.0"; ret = sGnssCallback->gnssNameCb(gnssName); ret = sGnssCallback_1_1->gnssNameCb(gnssName); if (!ret.isOk()) { if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); ALOGE("%s: Unable to invoke callback", __func__); } } Loading Loading @@ -180,6 +181,43 @@ Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() { return sp<V2_0::IGnssMeasurement>{}; return sp<V2_0::IGnssMeasurement>{}; } } Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>> Gnss::getExtensionMeasurementCorrections() { // TODO implement return sp<measurement_corrections::V1_0::IMeasurementCorrections>{}; } Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) { ALOGD("Gnss::setCallback_2_0"); if (callback == nullptr) { ALOGE("%s: Null callback ignored", __func__); return false; } sGnssCallback_2_0 = callback; uint32_t capabilities = 0x0; auto ret = sGnssCallback_2_0->gnssSetCapabilitesCb(capabilities); if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); } V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; ret = sGnssCallback_2_0->gnssSetSystemInfoCb(gnssInfo); if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); } auto gnssName = "Google Mock GNSS Implementation v2.0"; ret = sGnssCallback_2_0->gnssNameCb(gnssName); if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); } return true; } } // namespace implementation } // namespace implementation } // namespace V2_0 } // namespace V2_0 } // namespace gnss } // namespace gnss Loading