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 | |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 23 | #include "AGnss.h" |
Anil Admal | b02bcc1 | 2018-11-14 10:23:45 -0800 | [diff] [blame] | 24 | #include "AGnssRil.h" |
Anil Admal | 704bc61 | 2019-03-21 18:45:30 +0000 | [diff] [blame] | 25 | #include "GnssBatching.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 | |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 49 | Gnss::Gnss() : mMinIntervalMs(1000) {} |
| 50 | |
| 51 | Gnss::~Gnss() { |
| 52 | stop(); |
| 53 | } |
| 54 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 55 | // Methods from V1_0::IGnss follow. |
| 56 | Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>&) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 57 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 58 | return bool{}; |
| 59 | } |
| 60 | |
| 61 | Return<bool> Gnss::start() { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 62 | if (mIsActive) { |
| 63 | ALOGW("Gnss has started. Restarting..."); |
| 64 | stop(); |
| 65 | } |
| 66 | |
| 67 | mIsActive = true; |
| 68 | mThread = std::thread([this]() { |
| 69 | while (mIsActive == true) { |
Yu-Han Yang | c06b536 | 2019-10-25 14:14:35 -0700 | [diff] [blame] | 70 | const auto location = Utils::getMockLocationV2_0(); |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 71 | this->reportLocation(location); |
| 72 | |
| 73 | std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); |
| 74 | } |
| 75 | }); |
| 76 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | Return<bool> Gnss::stop() { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 80 | mIsActive = false; |
| 81 | if (mThread.joinable()) { |
| 82 | mThread.join(); |
| 83 | } |
| 84 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | Return<void> Gnss::cleanup() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 88 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 89 | return Void(); |
| 90 | } |
| 91 | |
| 92 | Return<bool> Gnss::injectTime(int64_t, int64_t, int32_t) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 93 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 94 | return bool{}; |
| 95 | } |
| 96 | |
| 97 | Return<bool> Gnss::injectLocation(double, double, float) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 98 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 99 | return bool{}; |
| 100 | } |
| 101 | |
| 102 | Return<void> Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 103 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 104 | return Void(); |
| 105 | } |
| 106 | |
| 107 | Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode, |
| 108 | V1_0::IGnss::GnssPositionRecurrence, uint32_t, uint32_t, |
| 109 | uint32_t) { |
Yu-Han Yang | 99f88da | 2019-02-27 12:36:55 -0800 | [diff] [blame] | 110 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 114 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 115 | return sp<V1_0::IAGnssRil>{}; |
| 116 | } |
| 117 | |
| 118 | Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 119 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 120 | return sp<V1_0::IGnssGeofencing>{}; |
| 121 | } |
| 122 | |
| 123 | Return<sp<V1_0::IAGnss>> Gnss::getExtensionAGnss() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 124 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 125 | return sp<V1_0::IAGnss>{}; |
| 126 | } |
| 127 | |
| 128 | Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() { |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 129 | // The IGnssNi.hal interface is deprecated in 2.0. |
| 130 | return nullptr; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() { |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 134 | // Not supported |
| 135 | return nullptr; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | Return<sp<V1_0::IGnssNavigationMessage>> Gnss::getExtensionGnssNavigationMessage() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 139 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 140 | return sp<V1_0::IGnssNavigationMessage>{}; |
| 141 | } |
| 142 | |
| 143 | Return<sp<V1_0::IGnssXtra>> Gnss::getExtensionXtra() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 144 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 145 | return sp<V1_0::IGnssXtra>{}; |
| 146 | } |
| 147 | |
| 148 | Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 149 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 150 | return sp<V1_0::IGnssConfiguration>{}; |
| 151 | } |
| 152 | |
| 153 | Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 154 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 155 | return sp<V1_0::IGnssDebug>{}; |
| 156 | } |
| 157 | |
| 158 | Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 159 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 160 | return sp<V1_0::IGnssBatching>{}; |
| 161 | } |
| 162 | |
| 163 | // Methods from V1_1::IGnss follow. |
| 164 | Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) { |
| 165 | ALOGD("Gnss::setCallback_1_1"); |
| 166 | if (callback == nullptr) { |
| 167 | ALOGE("%s: Null callback ignored", __func__); |
| 168 | return false; |
| 169 | } |
| 170 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 171 | sGnssCallback_1_1 = callback; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 172 | |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 173 | uint32_t capabilities = (uint32_t)V1_0::IGnssCallback::Capabilities::MEASUREMENTS; |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 174 | auto ret = sGnssCallback_1_1->gnssSetCapabilitesCb(capabilities); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 175 | if (!ret.isOk()) { |
| 176 | ALOGE("%s: Unable to invoke callback", __func__); |
| 177 | } |
| 178 | |
| 179 | V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; |
| 180 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 181 | ret = sGnssCallback_1_1->gnssSetSystemInfoCb(gnssInfo); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 182 | if (!ret.isOk()) { |
| 183 | ALOGE("%s: Unable to invoke callback", __func__); |
| 184 | } |
| 185 | |
| 186 | auto gnssName = "Google Mock GNSS Implementation v2.0"; |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 187 | ret = sGnssCallback_1_1->gnssNameCb(gnssName); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 188 | if (!ret.isOk()) { |
| 189 | ALOGE("%s: Unable to invoke callback", __func__); |
| 190 | } |
| 191 | |
| 192 | return true; |
| 193 | } |
| 194 | |
| 195 | Return<bool> Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode, |
| 196 | V1_0::IGnss::GnssPositionRecurrence, uint32_t, uint32_t, |
| 197 | uint32_t, bool) { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 198 | return true; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | Return<sp<V1_1::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_1_1() { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 202 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 203 | return sp<V1_1::IGnssConfiguration>{}; |
| 204 | } |
| 205 | |
| 206 | Return<sp<V1_1::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_1_1() { |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 207 | ALOGD("Gnss::getExtensionGnssMeasurement_1_1"); |
| 208 | return new GnssMeasurement(); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 209 | } |
| 210 | |
| 211 | Return<bool> Gnss::injectBestLocation(const V1_0::GnssLocation&) { |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 212 | // TODO(b/124012850): Implement function. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 213 | return bool{}; |
| 214 | } |
| 215 | |
| 216 | // Methods from V2_0::IGnss follow. |
Anil Admal | 4e50a4c | 2018-12-19 15:22:13 -0800 | [diff] [blame] | 217 | Return<sp<V2_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_2_0() { |
| 218 | return new GnssConfiguration{}; |
| 219 | } |
| 220 | |
Yu-Han Yang | 6999a0f | 2019-03-14 11:08:43 -0700 | [diff] [blame] | 221 | Return<sp<V2_0::IGnssDebug>> Gnss::getExtensionGnssDebug_2_0() { |
| 222 | // TODO(b/124012850): Implement function. |
| 223 | return sp<V2_0::IGnssDebug>{}; |
| 224 | } |
| 225 | |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 226 | Return<sp<V2_0::IAGnss>> Gnss::getExtensionAGnss_2_0() { |
| 227 | return new AGnss{}; |
| 228 | } |
| 229 | |
Anil Admal | b02bcc1 | 2018-11-14 10:23:45 -0800 | [diff] [blame] | 230 | Return<sp<V2_0::IAGnssRil>> Gnss::getExtensionAGnssRil_2_0() { |
| 231 | return new AGnssRil{}; |
| 232 | } |
| 233 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 234 | Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() { |
Yu-Han Yang | 030d033 | 2018-12-09 10:47:42 -0800 | [diff] [blame] | 235 | ALOGD("Gnss::getExtensionGnssMeasurement_2_0"); |
| 236 | return new GnssMeasurement(); |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 237 | } |
| 238 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 239 | Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>> |
| 240 | Gnss::getExtensionMeasurementCorrections() { |
Yu-Han Yang | 08642f9 | 2019-03-02 14:22:14 -0800 | [diff] [blame] | 241 | ALOGD("Gnss::getExtensionMeasurementCorrections"); |
| 242 | return new GnssMeasurementCorrections(); |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 243 | } |
| 244 | |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 245 | Return<sp<visibility_control::V1_0::IGnssVisibilityControl>> Gnss::getExtensionVisibilityControl() { |
| 246 | ALOGD("Gnss::getExtensionVisibilityControl"); |
| 247 | return new GnssVisibilityControl(); |
| 248 | } |
| 249 | |
Anil Admal | 704bc61 | 2019-03-21 18:45:30 +0000 | [diff] [blame] | 250 | Return<sp<V2_0::IGnssBatching>> Gnss::getExtensionGnssBatching_2_0() { |
| 251 | return new GnssBatching(); |
| 252 | } |
| 253 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 254 | Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) { |
| 255 | ALOGD("Gnss::setCallback_2_0"); |
| 256 | if (callback == nullptr) { |
| 257 | ALOGE("%s: Null callback ignored", __func__); |
| 258 | return false; |
| 259 | } |
| 260 | |
| 261 | sGnssCallback_2_0 = callback; |
| 262 | |
Anil Admal | 86450fa | 2019-03-11 15:31:05 -0700 | [diff] [blame] | 263 | using Capabilities = V2_0::IGnssCallback::Capabilities; |
Anil Admal | f45338a | 2019-04-03 14:43:30 -0700 | [diff] [blame] | 264 | const auto capabilities = Capabilities::MEASUREMENTS | Capabilities::MEASUREMENT_CORRECTIONS | |
| 265 | Capabilities::LOW_POWER_MODE | Capabilities::SATELLITE_BLACKLIST; |
Anil Admal | 86450fa | 2019-03-11 15:31:05 -0700 | [diff] [blame] | 266 | auto ret = sGnssCallback_2_0->gnssSetCapabilitiesCb_2_0(capabilities); |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 267 | if (!ret.isOk()) { |
| 268 | ALOGE("%s: Unable to invoke callback", __func__); |
| 269 | } |
| 270 | |
| 271 | V1_1::IGnssCallback::GnssSystemInfo gnssInfo = {.yearOfHw = 2019}; |
| 272 | |
| 273 | ret = sGnssCallback_2_0->gnssSetSystemInfoCb(gnssInfo); |
| 274 | if (!ret.isOk()) { |
| 275 | ALOGE("%s: Unable to invoke callback", __func__); |
| 276 | } |
| 277 | |
| 278 | auto gnssName = "Google Mock GNSS Implementation v2.0"; |
| 279 | ret = sGnssCallback_2_0->gnssNameCb(gnssName); |
| 280 | if (!ret.isOk()) { |
| 281 | ALOGE("%s: Unable to invoke callback", __func__); |
| 282 | } |
| 283 | |
| 284 | return true; |
| 285 | } |
| 286 | |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 287 | Return<void> Gnss::reportLocation(const V2_0::GnssLocation& location) const { |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 288 | std::unique_lock<std::mutex> lock(mMutex); |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 289 | if (sGnssCallback_2_0 == nullptr) { |
| 290 | ALOGE("%s: sGnssCallback 2.0 is null.", __func__); |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 291 | return Void(); |
| 292 | } |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 293 | sGnssCallback_2_0->gnssLocationCb_2_0(location); |
Yu-Han Yang | a509861 | 2019-02-08 16:22:07 -0800 | [diff] [blame] | 294 | return Void(); |
| 295 | } |
| 296 | |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 297 | Return<bool> Gnss::injectBestLocation_2_0(const V2_0::GnssLocation&) { |
| 298 | // TODO(b/124012850): Implement function. |
| 299 | return bool{}; |
| 300 | } |
| 301 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 302 | } // namespace implementation |
| 303 | } // namespace V2_0 |
| 304 | } // namespace gnss |
| 305 | } // namespace hardware |
| 306 | } // namespace android |