Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "Gnss" |
| 18 | |
| 19 | #include "Gnss.h" |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 20 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 21 | #include <log/log.h> |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 22 | #include <utils/SystemClock.h> |
| 23 | |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 24 | #include "AGnss.h" |
Anil Admal | b02bcc1 | 2018-11-14 10:23:45 -0800 | [diff] [blame] | 25 | #include "AGnssRil.h" |
Anil Admal | 4e50a4c | 2018-12-19 15:22:13 -0800 | [diff] [blame] | 26 | #include "GnssConfiguration.h" |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 27 | #include "GnssMeasurement.h" |
Yu-Han Yang | 08642f9 | 2019-03-02 14:22:14 -0800 | [diff] [blame] | 28 | #include "GnssMeasurementCorrections.h" |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 29 | #include "GnssVisibilityControl.h" |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 30 | #include "Utils.h" |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 31 | |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 32 | using ::android::hardware::Status; |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 33 | using ::android::hardware::gnss::common::Utils; |
Yu-Han Yang | 08642f9 | 2019-03-02 14:22:14 -0800 | [diff] [blame] | 34 | using ::android::hardware::gnss::measurement_corrections::V1_0::implementation:: |
| 35 | GnssMeasurementCorrections; |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 36 | using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl; |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 37 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 38 | namespace android { |
| 39 | namespace hardware { |
| 40 | namespace gnss { |
| 41 | namespace V2_0 { |
| 42 | namespace implementation { |
| 43 | |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 44 | using GnssSvFlags = IGnssCallback::GnssSvFlags; |
| 45 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 46 | sp<V2_0::IGnssCallback> Gnss::sGnssCallback_2_0 = nullptr; |
| 47 | sp<V1_1::IGnssCallback> Gnss::sGnssCallback_1_1 = nullptr; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 48 | |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 49 | namespace { |
| 50 | |
| 51 | V2_0::GnssLocation getMockLocationV2_0() { |
| 52 | const ElapsedRealtime timestamp = { |
| 53 | .flags = ElapsedRealtimeFlags::HAS_TIMESTAMP_NS | |
| 54 | ElapsedRealtimeFlags::HAS_TIME_UNCERTAINTY_NS, |
| 55 | .timestampNs = static_cast<uint64_t>(::android::elapsedRealtimeNano()), |
| 56 | // This is an hardcoded value indicating a 1ms of uncertainty between the two clocks. |
| 57 | // In an actual implementation provide an estimate of the synchronization uncertainty |
| 58 | // or don't set the field. |
| 59 | .timeUncertaintyNs = 1000000}; |
| 60 | |
| 61 | V2_0::GnssLocation location = {.v1_0 = Utils::getMockLocation(), .elapsedRealtime = timestamp}; |
| 62 | return location; |
| 63 | } |
| 64 | |
| 65 | } // namespace |
| 66 | |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 67 | Gnss::Gnss() : mMinIntervalMs(1000) {} |
| 68 | |
| 69 | Gnss::~Gnss() { |
| 70 | stop(); |
| 71 | } |
| 72 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 73 | // Methods from V1_0::IGnss follow. |
| 74 | Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>&) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 75 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 76 | return bool{}; |
| 77 | } |
| 78 | |
| 79 | Return<bool> Gnss::start() { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 80 | if (mIsActive) { |
| 81 | ALOGW("Gnss has started. Restarting..."); |
| 82 | stop(); |
| 83 | } |
| 84 | |
| 85 | mIsActive = true; |
| 86 | mThread = std::thread([this]() { |
| 87 | while (mIsActive == true) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 88 | const auto location = getMockLocationV2_0(); |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 89 | this->reportLocation(location); |
| 90 | |
| 91 | std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); |
| 92 | } |
| 93 | }); |
| 94 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | Return<bool> Gnss::stop() { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 98 | mIsActive = false; |
| 99 | if (mThread.joinable()) { |
| 100 | mThread.join(); |
| 101 | } |
| 102 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | Return<void> Gnss::cleanup() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 106 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 107 | return Void(); |
| 108 | } |
| 109 | |
| 110 | Return<bool> Gnss::injectTime(int64_t, int64_t, int32_t) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 111 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 112 | return bool{}; |
| 113 | } |
| 114 | |
| 115 | Return<bool> Gnss::injectLocation(double, double, float) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 116 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 117 | return bool{}; |
| 118 | } |
| 119 | |
| 120 | Return<void> Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 121 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 122 | return Void(); |
| 123 | } |
| 124 | |
| 125 | Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode, |
| 126 | V1_0::IGnss::GnssPositionRecurrence, uint32_t, uint32_t, |
| 127 | uint32_t) { |
Yu-Han Yang | 99f88da | 2019-02-27 12:36:55 -0800 | [diff] [blame] | 128 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 132 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 133 | return sp<V1_0::IAGnssRil>{}; |
| 134 | } |
| 135 | |
| 136 | Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 137 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 138 | return sp<V1_0::IGnssGeofencing>{}; |
| 139 | } |
| 140 | |
| 141 | Return<sp<V1_0::IAGnss>> Gnss::getExtensionAGnss() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 142 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 143 | return sp<V1_0::IAGnss>{}; |
| 144 | } |
| 145 | |
| 146 | Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() { |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 147 | // The IGnssNi.hal interface is deprecated in 2.0. |
| 148 | return nullptr; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() { |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 152 | // Not supported |
| 153 | return nullptr; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | Return<sp<V1_0::IGnssNavigationMessage>> Gnss::getExtensionGnssNavigationMessage() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 157 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 158 | return sp<V1_0::IGnssNavigationMessage>{}; |
| 159 | } |
| 160 | |
| 161 | Return<sp<V1_0::IGnssXtra>> Gnss::getExtensionXtra() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 162 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 163 | return sp<V1_0::IGnssXtra>{}; |
| 164 | } |
| 165 | |
| 166 | Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 167 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 168 | return sp<V1_0::IGnssConfiguration>{}; |
| 169 | } |
| 170 | |
| 171 | Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 172 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 173 | return sp<V1_0::IGnssDebug>{}; |
| 174 | } |
| 175 | |
| 176 | Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 177 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 178 | return sp<V1_0::IGnssBatching>{}; |
| 179 | } |
| 180 | |
| 181 | // Methods from V1_1::IGnss follow. |
| 182 | Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) { |
| 183 | ALOGD("Gnss::setCallback_1_1"); |
| 184 | if (callback == nullptr) { |
| 185 | ALOGE("%s: Null callback ignored", __func__); |
| 186 | return false; |
| 187 | } |
| 188 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 189 | sGnssCallback_1_1 = callback; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 190 | |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 191 | uint32_t capabilities = (uint32_t)V1_0::IGnssCallback::Capabilities::MEASUREMENTS; |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 192 | auto ret = sGnssCallback_1_1->gnssSetCapabilitesCb(capabilities); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 193 | if (!ret.isOk()) { |
| 194 | ALOGE("%s: Unable to invoke callback", __func__); |
| 195 | } |
| 196 | |
| 197 | V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; |
| 198 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 199 | ret = sGnssCallback_1_1->gnssSetSystemInfoCb(gnssInfo); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 200 | if (!ret.isOk()) { |
| 201 | ALOGE("%s: Unable to invoke callback", __func__); |
| 202 | } |
| 203 | |
| 204 | auto gnssName = "Google Mock GNSS Implementation v2.0"; |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 205 | ret = sGnssCallback_1_1->gnssNameCb(gnssName); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 206 | if (!ret.isOk()) { |
| 207 | ALOGE("%s: Unable to invoke callback", __func__); |
| 208 | } |
| 209 | |
| 210 | return true; |
| 211 | } |
| 212 | |
| 213 | Return<bool> Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode, |
| 214 | V1_0::IGnss::GnssPositionRecurrence, uint32_t, uint32_t, |
| 215 | uint32_t, bool) { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 216 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | Return<sp<V1_1::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_1_1() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 220 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 221 | return sp<V1_1::IGnssConfiguration>{}; |
| 222 | } |
| 223 | |
| 224 | Return<sp<V1_1::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_1_1() { |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 225 | ALOGD("Gnss::getExtensionGnssMeasurement_1_1"); |
| 226 | return new GnssMeasurement(); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | Return<bool> Gnss::injectBestLocation(const V1_0::GnssLocation&) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 230 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 231 | return bool{}; |
| 232 | } |
| 233 | |
| 234 | // Methods from V2_0::IGnss follow. |
Anil Admal | 4e50a4c | 2018-12-19 15:22:13 -0800 | [diff] [blame] | 235 | Return<sp<V2_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_2_0() { |
| 236 | return new GnssConfiguration{}; |
| 237 | } |
| 238 | |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 239 | Return<sp<V2_0::IAGnss>> Gnss::getExtensionAGnss_2_0() { |
| 240 | return new AGnss{}; |
| 241 | } |
| 242 | |
Anil Admal | b02bcc1 | 2018-11-14 10:23:45 -0800 | [diff] [blame] | 243 | Return<sp<V2_0::IAGnssRil>> Gnss::getExtensionAGnssRil_2_0() { |
| 244 | return new AGnssRil{}; |
| 245 | } |
| 246 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 247 | Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() { |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 248 | ALOGD("Gnss::getExtensionGnssMeasurement_2_0"); |
| 249 | return new GnssMeasurement(); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 250 | } |
| 251 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 252 | Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>> |
| 253 | Gnss::getExtensionMeasurementCorrections() { |
Yu-Han Yang | 08642f9 | 2019-03-02 14:22:14 -0800 | [diff] [blame] | 254 | ALOGD("Gnss::getExtensionMeasurementCorrections"); |
| 255 | return new GnssMeasurementCorrections(); |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 256 | } |
| 257 | |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 258 | Return<sp<visibility_control::V1_0::IGnssVisibilityControl>> Gnss::getExtensionVisibilityControl() { |
| 259 | ALOGD("Gnss::getExtensionVisibilityControl"); |
| 260 | return new GnssVisibilityControl(); |
| 261 | } |
| 262 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 263 | Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) { |
| 264 | ALOGD("Gnss::setCallback_2_0"); |
| 265 | if (callback == nullptr) { |
| 266 | ALOGE("%s: Null callback ignored", __func__); |
| 267 | return false; |
| 268 | } |
| 269 | |
| 270 | sGnssCallback_2_0 = callback; |
| 271 | |
Anil Admal | 86450fa | 2019-03-11 15:31:05 -0700 | [diff] [blame^] | 272 | using Capabilities = V2_0::IGnssCallback::Capabilities; |
| 273 | const auto capabilities = Capabilities::LOW_POWER_MODE | Capabilities::SATELLITE_BLACKLIST; |
| 274 | auto ret = sGnssCallback_2_0->gnssSetCapabilitiesCb_2_0(capabilities); |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 275 | if (!ret.isOk()) { |
| 276 | ALOGE("%s: Unable to invoke callback", __func__); |
| 277 | } |
| 278 | |
| 279 | V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; |
| 280 | |
| 281 | ret = sGnssCallback_2_0->gnssSetSystemInfoCb(gnssInfo); |
| 282 | if (!ret.isOk()) { |
| 283 | ALOGE("%s: Unable to invoke callback", __func__); |
| 284 | } |
| 285 | |
| 286 | auto gnssName = "Google Mock GNSS Implementation v2.0"; |
| 287 | ret = sGnssCallback_2_0->gnssNameCb(gnssName); |
| 288 | if (!ret.isOk()) { |
| 289 | ALOGE("%s: Unable to invoke callback", __func__); |
| 290 | } |
| 291 | |
| 292 | return true; |
| 293 | } |
| 294 | |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 295 | Return<void> Gnss::reportLocation(const V2_0::GnssLocation& location) const { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 296 | std::unique_lock<std::mutex> lock(mMutex); |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 297 | if (sGnssCallback_2_0 == nullptr) { |
| 298 | ALOGE("%s: sGnssCallback 2.0 is null.", __func__); |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 299 | return Void(); |
| 300 | } |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 301 | sGnssCallback_2_0->gnssLocationCb_2_0(location); |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 302 | return Void(); |
| 303 | } |
| 304 | |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 305 | Return<bool> Gnss::injectBestLocation_2_0(const V2_0::GnssLocation&) { |
| 306 | // TODO(b/124012850): Implement function. |
| 307 | return bool{}; |
| 308 | } |
| 309 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 310 | } // namespace implementation |
| 311 | } // namespace V2_0 |
| 312 | } // namespace gnss |
| 313 | } // namespace hardware |
| 314 | } // namespace android |