Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 "GnssHAL_GnssInterface" |
| 18 | |
| 19 | #include "Gnss.h" |
| 20 | #include <GnssUtils.h> |
| 21 | |
| 22 | namespace android { |
| 23 | namespace hardware { |
| 24 | namespace gnss { |
| 25 | namespace V1_0 { |
| 26 | namespace implementation { |
| 27 | |
| 28 | std::vector<std::unique_ptr<ThreadFuncArgs>> Gnss::sThreadFuncArgsList; |
| 29 | sp<IGnssCallback> Gnss::sGnssCbIface = nullptr; |
| 30 | bool Gnss::sInterfaceExists = false; |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 31 | bool Gnss::sWakelockHeldGnss = false; |
| 32 | bool Gnss::sWakelockHeldFused = false; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 33 | |
| 34 | GpsCallbacks Gnss::sGnssCb = { |
| 35 | .size = sizeof(GpsCallbacks), |
| 36 | .location_cb = locationCb, |
| 37 | .status_cb = statusCb, |
| 38 | .sv_status_cb = gpsSvStatusCb, |
| 39 | .nmea_cb = nmeaCb, |
| 40 | .set_capabilities_cb = setCapabilitiesCb, |
| 41 | .acquire_wakelock_cb = acquireWakelockCb, |
| 42 | .release_wakelock_cb = releaseWakelockCb, |
| 43 | .create_thread_cb = createThreadCb, |
| 44 | .request_utc_time_cb = requestUtcTimeCb, |
| 45 | .set_system_info_cb = setSystemInfoCb, |
| 46 | .gnss_sv_status_cb = gnssSvStatusCb, |
| 47 | }; |
| 48 | |
Wyatt Riley | 917640b | 2017-03-16 16:25:55 -0700 | [diff] [blame] | 49 | uint32_t Gnss::sCapabilitiesCached = 0; |
| 50 | uint16_t Gnss::sYearOfHwCached = 0; |
| 51 | |
| 52 | Gnss::Gnss(gps_device_t* gnssDevice) : |
| 53 | mDeathRecipient(new GnssHidlDeathRecipient(this)) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 54 | /* Error out if an instance of the interface already exists. */ |
| 55 | LOG_ALWAYS_FATAL_IF(sInterfaceExists); |
| 56 | sInterfaceExists = true; |
| 57 | |
| 58 | if (gnssDevice == nullptr) { |
| 59 | ALOGE("%s: Invalid device_t handle", __func__); |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | mGnssIface = gnssDevice->get_gps_interface(gnssDevice); |
| 64 | } |
| 65 | |
| 66 | Gnss::~Gnss() { |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 67 | sInterfaceExists = false; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 68 | sThreadFuncArgsList.clear(); |
| 69 | } |
| 70 | |
| 71 | void Gnss::locationCb(GpsLocation* location) { |
| 72 | if (sGnssCbIface == nullptr) { |
| 73 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 74 | return; |
| 75 | } |
| 76 | |
| 77 | if (location == nullptr) { |
| 78 | ALOGE("%s: Invalid location from GNSS HAL", __func__); |
| 79 | return; |
| 80 | } |
| 81 | |
| 82 | android::hardware::gnss::V1_0::GnssLocation gnssLocation = convertToGnssLocation(location); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 83 | auto ret = sGnssCbIface->gnssLocationCb(gnssLocation); |
| 84 | if (!ret.isOk()) { |
| 85 | ALOGE("%s: Unable to invoke callback", __func__); |
| 86 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | void Gnss::statusCb(GpsStatus* gnssStatus) { |
| 90 | if (sGnssCbIface == nullptr) { |
| 91 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | if (gnssStatus == nullptr) { |
| 96 | ALOGE("%s: Invalid GpsStatus from GNSS HAL", __func__); |
| 97 | return; |
| 98 | } |
| 99 | |
| 100 | IGnssCallback::GnssStatusValue status = |
| 101 | static_cast<IGnssCallback::GnssStatusValue>(gnssStatus->status); |
| 102 | |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 103 | auto ret = sGnssCbIface->gnssStatusCb(status); |
| 104 | if (!ret.isOk()) { |
| 105 | ALOGE("%s: Unable to invoke callback", __func__); |
| 106 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | void Gnss::gnssSvStatusCb(GnssSvStatus* status) { |
| 110 | if (sGnssCbIface == nullptr) { |
| 111 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 112 | return; |
| 113 | } |
| 114 | |
| 115 | if (status == nullptr) { |
| 116 | ALOGE("Invalid status from GNSS HAL %s", __func__); |
| 117 | return; |
| 118 | } |
| 119 | |
| 120 | IGnssCallback::GnssSvStatus svStatus; |
| 121 | svStatus.numSvs = status->num_svs; |
| 122 | |
| 123 | if (svStatus.numSvs > static_cast<uint32_t>(GnssMax::SVS_COUNT)) { |
| 124 | ALOGW("Too many satellites %zd. Clamps to %d.", svStatus.numSvs, GnssMax::SVS_COUNT); |
| 125 | svStatus.numSvs = static_cast<uint32_t>(GnssMax::SVS_COUNT); |
| 126 | } |
| 127 | |
| 128 | for (size_t i = 0; i < svStatus.numSvs; i++) { |
| 129 | auto svInfo = status->gnss_sv_list[i]; |
| 130 | IGnssCallback::GnssSvInfo gnssSvInfo = { |
| 131 | .svid = svInfo.svid, |
| 132 | .constellation = static_cast<android::hardware::gnss::V1_0::GnssConstellationType>( |
| 133 | svInfo.constellation), |
| 134 | .cN0Dbhz = svInfo.c_n0_dbhz, |
| 135 | .elevationDegrees = svInfo.elevation, |
| 136 | .azimuthDegrees = svInfo.azimuth, |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 137 | .svFlag = svInfo.flags, |
| 138 | // Older chipsets do not provide carrier frequency, hence HAS_CARRIER_FREQUENCY flag |
| 139 | // is not set and the carrierFrequencyHz field is set to zero |
| 140 | .carrierFrequencyHz = 0 |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 141 | }; |
| 142 | svStatus.gnssSvList[i] = gnssSvInfo; |
| 143 | } |
| 144 | |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 145 | auto ret = sGnssCbIface->gnssSvStatusCb(svStatus); |
| 146 | if (!ret.isOk()) { |
| 147 | ALOGE("%s: Unable to invoke callback", __func__); |
| 148 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | /* |
| 152 | * This enum is used by gpsSvStatusCb() method below to convert GpsSvStatus |
| 153 | * to GnssSvStatus for backward compatibility. It is only used by the default |
| 154 | * implementation and is not part of the GNSS interface. |
| 155 | */ |
| 156 | enum SvidValues : uint16_t { |
| 157 | GLONASS_SVID_OFFSET = 64, |
| 158 | GLONASS_SVID_COUNT = 24, |
| 159 | BEIDOU_SVID_OFFSET = 200, |
| 160 | BEIDOU_SVID_COUNT = 35, |
| 161 | SBAS_SVID_MIN = 33, |
| 162 | SBAS_SVID_MAX = 64, |
| 163 | SBAS_SVID_ADD = 87, |
| 164 | QZSS_SVID_MIN = 193, |
| 165 | QZSS_SVID_MAX = 200 |
| 166 | }; |
| 167 | |
| 168 | /* |
| 169 | * The following code that converts GpsSvStatus to GnssSvStatus is moved here from |
| 170 | * GnssLocationProvider. GnssLocationProvider does not require it anymore since GpsSvStatus is |
| 171 | * being deprecated and is no longer part of the GNSS interface. |
| 172 | */ |
| 173 | void Gnss::gpsSvStatusCb(GpsSvStatus* svInfo) { |
| 174 | if (sGnssCbIface == nullptr) { |
| 175 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 176 | return; |
| 177 | } |
| 178 | |
| 179 | if (svInfo == nullptr) { |
| 180 | ALOGE("Invalid status from GNSS HAL %s", __func__); |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | IGnssCallback::GnssSvStatus svStatus; |
| 185 | svStatus.numSvs = svInfo->num_svs; |
| 186 | /* |
| 187 | * Clamp the list size since GnssSvStatus can support a maximum of |
| 188 | * GnssMax::SVS_COUNT entries. |
| 189 | */ |
| 190 | if (svStatus.numSvs > static_cast<uint32_t>(GnssMax::SVS_COUNT)) { |
| 191 | ALOGW("Too many satellites %zd. Clamps to %d.", svStatus.numSvs, GnssMax::SVS_COUNT); |
| 192 | svStatus.numSvs = static_cast<uint32_t>(GnssMax::SVS_COUNT); |
| 193 | } |
| 194 | |
| 195 | uint32_t ephemerisMask = svInfo->ephemeris_mask; |
| 196 | uint32_t almanacMask = svInfo->almanac_mask; |
| 197 | uint32_t usedInFixMask = svInfo->used_in_fix_mask; |
| 198 | /* |
| 199 | * Conversion from GpsSvInfo to IGnssCallback::GnssSvInfo happens below. |
| 200 | */ |
| 201 | for (size_t i = 0; i < svStatus.numSvs; i++) { |
| 202 | IGnssCallback::GnssSvInfo& info = svStatus.gnssSvList[i]; |
| 203 | info.svid = svInfo->sv_list[i].prn; |
| 204 | if (info.svid >= 1 && info.svid <= 32) { |
| 205 | info.constellation = GnssConstellationType::GPS; |
| 206 | } else if (info.svid > GLONASS_SVID_OFFSET && |
| 207 | info.svid <= GLONASS_SVID_OFFSET + GLONASS_SVID_COUNT) { |
| 208 | info.constellation = GnssConstellationType::GLONASS; |
| 209 | info.svid -= GLONASS_SVID_OFFSET; |
| 210 | } else if (info.svid > BEIDOU_SVID_OFFSET && |
| 211 | info.svid <= BEIDOU_SVID_OFFSET + BEIDOU_SVID_COUNT) { |
| 212 | info.constellation = GnssConstellationType::BEIDOU; |
| 213 | info.svid -= BEIDOU_SVID_OFFSET; |
| 214 | } else if (info.svid >= SBAS_SVID_MIN && info.svid <= SBAS_SVID_MAX) { |
| 215 | info.constellation = GnssConstellationType::SBAS; |
| 216 | info.svid += SBAS_SVID_ADD; |
| 217 | } else if (info.svid >= QZSS_SVID_MIN && info.svid <= QZSS_SVID_MAX) { |
| 218 | info.constellation = GnssConstellationType::QZSS; |
| 219 | } else { |
| 220 | ALOGD("Unknown constellation type with Svid = %d.", info.svid); |
| 221 | info.constellation = GnssConstellationType::UNKNOWN; |
| 222 | } |
| 223 | |
| 224 | info.cN0Dbhz = svInfo->sv_list[i].snr; |
| 225 | info.elevationDegrees = svInfo->sv_list[i].elevation; |
| 226 | info.azimuthDegrees = svInfo->sv_list[i].azimuth; |
Yifan Hong | 35e2aac | 2016-12-05 12:35:05 -0800 | [diff] [blame] | 227 | // TODO: b/31702236 |
| 228 | info.svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE); |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 229 | |
| 230 | /* |
| 231 | * Only GPS info is valid for these fields, as these masks are just 32 |
| 232 | * bits, by GPS prn. |
| 233 | */ |
| 234 | if (info.constellation == GnssConstellationType::GPS) { |
| 235 | int32_t svidMask = (1 << (info.svid - 1)); |
| 236 | if ((ephemerisMask & svidMask) != 0) { |
| 237 | info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; |
| 238 | } |
| 239 | if ((almanacMask & svidMask) != 0) { |
| 240 | info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; |
| 241 | } |
| 242 | if ((usedInFixMask & svidMask) != 0) { |
| 243 | info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 248 | auto ret = sGnssCbIface->gnssSvStatusCb(svStatus); |
| 249 | if (!ret.isOk()) { |
| 250 | ALOGE("%s: Unable to invoke callback", __func__); |
| 251 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | void Gnss::nmeaCb(GpsUtcTime timestamp, const char* nmea, int length) { |
| 255 | if (sGnssCbIface == nullptr) { |
| 256 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | android::hardware::hidl_string nmeaString; |
| 261 | nmeaString.setToExternal(nmea, length); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 262 | auto ret = sGnssCbIface->gnssNmeaCb(timestamp, nmeaString); |
| 263 | if (!ret.isOk()) { |
| 264 | ALOGE("%s: Unable to invoke callback", __func__); |
| 265 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | void Gnss::setCapabilitiesCb(uint32_t capabilities) { |
| 269 | if (sGnssCbIface == nullptr) { |
| 270 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 271 | return; |
| 272 | } |
| 273 | |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 274 | auto ret = sGnssCbIface->gnssSetCapabilitesCb(capabilities); |
| 275 | if (!ret.isOk()) { |
| 276 | ALOGE("%s: Unable to invoke callback", __func__); |
| 277 | } |
Wyatt Riley | 917640b | 2017-03-16 16:25:55 -0700 | [diff] [blame] | 278 | |
| 279 | // Save for reconnection when some legacy hal's don't resend this info |
| 280 | sCapabilitiesCached = capabilities; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | void Gnss::acquireWakelockCb() { |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 284 | acquireWakelockGnss(); |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | void Gnss::releaseWakelockCb() { |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 288 | releaseWakelockGnss(); |
| 289 | } |
| 290 | |
| 291 | |
| 292 | void Gnss::acquireWakelockGnss() { |
| 293 | sWakelockHeldGnss = true; |
| 294 | updateWakelock(); |
| 295 | } |
| 296 | |
| 297 | void Gnss::releaseWakelockGnss() { |
| 298 | sWakelockHeldGnss = false; |
| 299 | updateWakelock(); |
| 300 | } |
| 301 | |
| 302 | void Gnss::acquireWakelockFused() { |
| 303 | sWakelockHeldFused = true; |
| 304 | updateWakelock(); |
| 305 | } |
| 306 | |
| 307 | void Gnss::releaseWakelockFused() { |
| 308 | sWakelockHeldFused = false; |
| 309 | updateWakelock(); |
| 310 | } |
| 311 | |
| 312 | void Gnss::updateWakelock() { |
| 313 | // Track the state of the last request - in case the wake lock in the layer above is reference |
| 314 | // counted. |
| 315 | static bool sWakelockHeld = false; |
| 316 | |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 317 | if (sGnssCbIface == nullptr) { |
| 318 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 319 | return; |
| 320 | } |
| 321 | |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 322 | if (sWakelockHeldGnss || sWakelockHeldFused) { |
| 323 | if (!sWakelockHeld) { |
| 324 | ALOGI("%s: GNSS HAL Wakelock acquired due to gps: %d, fused: %d", __func__, |
| 325 | sWakelockHeldGnss, sWakelockHeldFused); |
| 326 | sWakelockHeld = true; |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 327 | auto ret = sGnssCbIface->gnssAcquireWakelockCb(); |
| 328 | if (!ret.isOk()) { |
| 329 | ALOGE("%s: Unable to invoke callback", __func__); |
| 330 | } |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 331 | } |
| 332 | } else { |
| 333 | if (sWakelockHeld) { |
| 334 | ALOGI("%s: GNSS HAL Wakelock released", __func__); |
| 335 | } else { |
| 336 | // To avoid burning power, always release, even if logic got here with sWakelock false |
| 337 | // which it shouldn't, unless underlying *.h implementation makes duplicate requests. |
| 338 | ALOGW("%s: GNSS HAL Wakelock released, duplicate request", __func__); |
| 339 | } |
| 340 | sWakelockHeld = false; |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 341 | auto ret = sGnssCbIface->gnssReleaseWakelockCb(); |
| 342 | if (!ret.isOk()) { |
| 343 | ALOGE("%s: Unable to invoke callback", __func__); |
| 344 | } |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 345 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | void Gnss::requestUtcTimeCb() { |
| 349 | if (sGnssCbIface == nullptr) { |
| 350 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 351 | return; |
| 352 | } |
| 353 | |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 354 | auto ret = sGnssCbIface->gnssRequestTimeCb(); |
| 355 | if (!ret.isOk()) { |
| 356 | ALOGE("%s: Unable to invoke callback", __func__); |
| 357 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 358 | } |
| 359 | |
| 360 | pthread_t Gnss::createThreadCb(const char* name, void (*start)(void*), void* arg) { |
| 361 | return createPthread(name, start, arg, &sThreadFuncArgsList); |
| 362 | } |
| 363 | |
| 364 | void Gnss::setSystemInfoCb(const LegacyGnssSystemInfo* info) { |
| 365 | if (sGnssCbIface == nullptr) { |
| 366 | ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__); |
| 367 | return; |
| 368 | } |
| 369 | |
| 370 | if (info == nullptr) { |
| 371 | ALOGE("Invalid GnssSystemInfo from GNSS HAL %s", __func__); |
| 372 | return; |
| 373 | } |
| 374 | |
| 375 | IGnssCallback::GnssSystemInfo gnssInfo = { |
| 376 | .yearOfHw = info->year_of_hw |
| 377 | }; |
| 378 | |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 379 | auto ret = sGnssCbIface->gnssSetSystemInfoCb(gnssInfo); |
| 380 | if (!ret.isOk()) { |
| 381 | ALOGE("%s: Unable to invoke callback", __func__); |
| 382 | } |
Wyatt Riley | 917640b | 2017-03-16 16:25:55 -0700 | [diff] [blame] | 383 | |
| 384 | // Save for reconnection when some legacy hal's don't resend this info |
| 385 | sYearOfHwCached = info->year_of_hw; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | |
| 389 | // Methods from ::android::hardware::gnss::V1_0::IGnss follow. |
| 390 | Return<bool> Gnss::setCallback(const sp<IGnssCallback>& callback) { |
| 391 | if (mGnssIface == nullptr) { |
| 392 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 393 | return false; |
| 394 | } |
| 395 | |
Wyatt Riley | 917640b | 2017-03-16 16:25:55 -0700 | [diff] [blame] | 396 | if (callback == nullptr) { |
| 397 | ALOGE("%s: Null callback ignored", __func__); |
| 398 | return false; |
| 399 | } |
| 400 | |
| 401 | if (sGnssCbIface != NULL) { |
| 402 | ALOGW("%s called more than once. Unexpected unless test.", __func__); |
| 403 | sGnssCbIface->unlinkToDeath(mDeathRecipient); |
| 404 | } |
| 405 | |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 406 | sGnssCbIface = callback; |
Wyatt Riley | 917640b | 2017-03-16 16:25:55 -0700 | [diff] [blame] | 407 | callback->linkToDeath(mDeathRecipient, 0 /*cookie*/); |
| 408 | |
| 409 | // If this was received in the past, send it up again to refresh caller. |
| 410 | // mGnssIface will override after init() is called below, if needed |
| 411 | // (though it's unlikely the gps.h capabilities or system info will change.) |
| 412 | if (sCapabilitiesCached != 0) { |
| 413 | setCapabilitiesCb(sCapabilitiesCached); |
| 414 | } |
| 415 | if (sYearOfHwCached != 0) { |
| 416 | LegacyGnssSystemInfo info; |
| 417 | info.year_of_hw = sYearOfHwCached; |
| 418 | setSystemInfoCb(&info); |
| 419 | } |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 420 | |
| 421 | return (mGnssIface->init(&sGnssCb) == 0); |
| 422 | } |
| 423 | |
| 424 | Return<bool> Gnss::start() { |
| 425 | if (mGnssIface == nullptr) { |
| 426 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 427 | return false; |
| 428 | } |
| 429 | |
| 430 | return (mGnssIface->start() == 0); |
| 431 | } |
| 432 | |
| 433 | Return<bool> Gnss::stop() { |
| 434 | if (mGnssIface == nullptr) { |
| 435 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 436 | return false; |
| 437 | } |
| 438 | |
| 439 | return (mGnssIface->stop() == 0); |
| 440 | } |
| 441 | |
| 442 | Return<void> Gnss::cleanup() { |
| 443 | if (mGnssIface == nullptr) { |
| 444 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 445 | } else { |
| 446 | mGnssIface->cleanup(); |
| 447 | } |
| 448 | return Void(); |
| 449 | } |
| 450 | |
| 451 | Return<bool> Gnss::injectLocation(double latitudeDegrees, |
| 452 | double longitudeDegrees, |
| 453 | float accuracyMeters) { |
| 454 | if (mGnssIface == nullptr) { |
| 455 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 456 | return false; |
| 457 | } |
| 458 | |
| 459 | return (mGnssIface->inject_location(latitudeDegrees, longitudeDegrees, accuracyMeters) == 0); |
| 460 | } |
| 461 | |
| 462 | Return<bool> Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, |
| 463 | int32_t uncertaintyMs) { |
| 464 | if (mGnssIface == nullptr) { |
| 465 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 466 | return false; |
| 467 | } |
| 468 | |
| 469 | return (mGnssIface->inject_time(timeMs, timeReferenceMs, uncertaintyMs) == 0); |
| 470 | } |
| 471 | |
| 472 | Return<void> Gnss::deleteAidingData(IGnss::GnssAidingData aidingDataFlags) { |
| 473 | if (mGnssIface == nullptr) { |
| 474 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 475 | } else { |
| 476 | mGnssIface->delete_aiding_data(static_cast<GpsAidingData>(aidingDataFlags)); |
| 477 | } |
| 478 | return Void(); |
| 479 | } |
| 480 | |
| 481 | Return<bool> Gnss::setPositionMode(IGnss::GnssPositionMode mode, |
| 482 | IGnss::GnssPositionRecurrence recurrence, |
| 483 | uint32_t minIntervalMs, |
| 484 | uint32_t preferredAccuracyMeters, |
| 485 | uint32_t preferredTimeMs) { |
| 486 | if (mGnssIface == nullptr) { |
| 487 | ALOGE("%s: Gnss interface is unavailable", __func__); |
| 488 | return false; |
| 489 | } |
| 490 | |
| 491 | return (mGnssIface->set_position_mode(static_cast<GpsPositionMode>(mode), |
| 492 | static_cast<GpsPositionRecurrence>(recurrence), |
| 493 | minIntervalMs, |
| 494 | preferredAccuracyMeters, |
| 495 | preferredTimeMs) == 0); |
| 496 | } |
| 497 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 498 | Return<sp<IAGnssRil>> Gnss::getExtensionAGnssRil() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 499 | if (mGnssIface == nullptr) { |
| 500 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 501 | return nullptr; |
| 502 | } |
| 503 | |
| 504 | if (mGnssRil == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 505 | const AGpsRilInterface* agpsRilIface = static_cast<const AGpsRilInterface*>( |
| 506 | mGnssIface->get_extension(AGPS_RIL_INTERFACE)); |
| 507 | if (agpsRilIface == nullptr) { |
| 508 | ALOGE("%s GnssRil interface not implemented by GNSS HAL", __func__); |
| 509 | } else { |
| 510 | mGnssRil = new AGnssRil(agpsRilIface); |
| 511 | } |
| 512 | } |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 513 | return mGnssRil; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 514 | } |
| 515 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 516 | Return<sp<IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 517 | if (mGnssIface == nullptr) { |
| 518 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 519 | return nullptr; |
| 520 | } |
| 521 | |
| 522 | if (mGnssConfig == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 523 | const GnssConfigurationInterface* gnssConfigIface = |
| 524 | static_cast<const GnssConfigurationInterface*>( |
| 525 | mGnssIface->get_extension(GNSS_CONFIGURATION_INTERFACE)); |
| 526 | |
| 527 | if (gnssConfigIface == nullptr) { |
| 528 | ALOGE("%s GnssConfiguration interface not implemented by GNSS HAL", __func__); |
| 529 | } else { |
| 530 | mGnssConfig = new GnssConfiguration(gnssConfigIface); |
| 531 | } |
| 532 | } |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 533 | return mGnssConfig; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 534 | } |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 535 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 536 | Return<sp<IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 537 | if (mGnssIface == nullptr) { |
| 538 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 539 | return nullptr; |
| 540 | } |
| 541 | |
| 542 | if (mGnssGeofencingIface == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 543 | const GpsGeofencingInterface* gpsGeofencingIface = |
| 544 | static_cast<const GpsGeofencingInterface*>( |
| 545 | mGnssIface->get_extension(GPS_GEOFENCING_INTERFACE)); |
| 546 | |
| 547 | if (gpsGeofencingIface == nullptr) { |
| 548 | ALOGE("%s GnssGeofencing interface not implemented by GNSS HAL", __func__); |
| 549 | } else { |
| 550 | mGnssGeofencingIface = new GnssGeofencing(gpsGeofencingIface); |
| 551 | } |
| 552 | } |
| 553 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 554 | return mGnssGeofencingIface; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 555 | } |
| 556 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 557 | Return<sp<IAGnss>> Gnss::getExtensionAGnss() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 558 | if (mGnssIface == nullptr) { |
| 559 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 560 | return nullptr; |
| 561 | } |
| 562 | |
| 563 | if (mAGnssIface == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 564 | const AGpsInterface* agpsIface = static_cast<const AGpsInterface*>( |
| 565 | mGnssIface->get_extension(AGPS_INTERFACE)); |
| 566 | if (agpsIface == nullptr) { |
| 567 | ALOGE("%s AGnss interface not implemented by GNSS HAL", __func__); |
| 568 | } else { |
| 569 | mAGnssIface = new AGnss(agpsIface); |
| 570 | } |
| 571 | } |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 572 | return mAGnssIface; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 573 | } |
| 574 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 575 | Return<sp<IGnssNi>> Gnss::getExtensionGnssNi() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 576 | if (mGnssIface == nullptr) { |
| 577 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 578 | return nullptr; |
| 579 | } |
| 580 | |
| 581 | if (mGnssNi == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 582 | const GpsNiInterface* gpsNiIface = static_cast<const GpsNiInterface*>( |
| 583 | mGnssIface->get_extension(GPS_NI_INTERFACE)); |
| 584 | if (gpsNiIface == nullptr) { |
| 585 | ALOGE("%s GnssNi interface not implemented by GNSS HAL", __func__); |
| 586 | } else { |
| 587 | mGnssNi = new GnssNi(gpsNiIface); |
| 588 | } |
| 589 | } |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 590 | return mGnssNi; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 591 | } |
| 592 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 593 | Return<sp<IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 594 | if (mGnssIface == nullptr) { |
| 595 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 596 | return nullptr; |
| 597 | } |
| 598 | |
| 599 | if (mGnssMeasurement == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 600 | const GpsMeasurementInterface* gpsMeasurementIface = |
| 601 | static_cast<const GpsMeasurementInterface*>( |
| 602 | mGnssIface->get_extension(GPS_MEASUREMENT_INTERFACE)); |
| 603 | |
| 604 | if (gpsMeasurementIface == nullptr) { |
| 605 | ALOGE("%s GnssMeasurement interface not implemented by GNSS HAL", __func__); |
| 606 | } else { |
| 607 | mGnssMeasurement = new GnssMeasurement(gpsMeasurementIface); |
| 608 | } |
| 609 | } |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 610 | return mGnssMeasurement; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 611 | } |
| 612 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 613 | Return<sp<IGnssNavigationMessage>> Gnss::getExtensionGnssNavigationMessage() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 614 | if (mGnssIface == nullptr) { |
| 615 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 616 | return nullptr; |
| 617 | } |
| 618 | |
| 619 | if (mGnssNavigationMessage == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 620 | const GpsNavigationMessageInterface* gpsNavigationMessageIface = |
| 621 | static_cast<const GpsNavigationMessageInterface*>( |
| 622 | mGnssIface->get_extension(GPS_NAVIGATION_MESSAGE_INTERFACE)); |
| 623 | |
| 624 | if (gpsNavigationMessageIface == nullptr) { |
| 625 | ALOGE("%s GnssNavigationMessage interface not implemented by GNSS HAL", |
| 626 | __func__); |
| 627 | } else { |
| 628 | mGnssNavigationMessage = new GnssNavigationMessage(gpsNavigationMessageIface); |
| 629 | } |
| 630 | } |
| 631 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 632 | return mGnssNavigationMessage; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 633 | } |
| 634 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 635 | Return<sp<IGnssXtra>> Gnss::getExtensionXtra() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 636 | if (mGnssIface == nullptr) { |
| 637 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 638 | return nullptr; |
| 639 | } |
| 640 | |
| 641 | if (mGnssXtraIface == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 642 | const GpsXtraInterface* gpsXtraIface = static_cast<const GpsXtraInterface*>( |
| 643 | mGnssIface->get_extension(GPS_XTRA_INTERFACE)); |
| 644 | |
| 645 | if (gpsXtraIface == nullptr) { |
| 646 | ALOGE("%s GnssXtra interface not implemented by HAL", __func__); |
| 647 | } else { |
| 648 | mGnssXtraIface = new GnssXtra(gpsXtraIface); |
| 649 | } |
| 650 | } |
| 651 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 652 | return mGnssXtraIface; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 653 | } |
| 654 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 655 | Return<sp<IGnssDebug>> Gnss::getExtensionGnssDebug() { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 656 | if (mGnssIface == nullptr) { |
| 657 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 658 | return nullptr; |
| 659 | } |
| 660 | |
| 661 | if (mGnssDebug == nullptr) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 662 | const GpsDebugInterface* gpsDebugIface = static_cast<const GpsDebugInterface*>( |
| 663 | mGnssIface->get_extension(GPS_DEBUG_INTERFACE)); |
| 664 | |
| 665 | if (gpsDebugIface == nullptr) { |
| 666 | ALOGE("%s: GnssDebug interface is not implemented by HAL", __func__); |
| 667 | } else { |
| 668 | mGnssDebug = new GnssDebug(gpsDebugIface); |
| 669 | } |
| 670 | } |
| 671 | |
Martijn Coenen | 527924a | 2017-01-04 12:59:48 +0100 | [diff] [blame] | 672 | return mGnssDebug; |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 673 | } |
| 674 | |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 675 | Return<sp<IGnssBatching>> Gnss::getExtensionGnssBatching() { |
| 676 | if (mGnssIface == nullptr) { |
| 677 | ALOGE("%s: Gnss interface is unavailable", __func__); |
Hridya Valsaraju | e020ce2 | 2017-02-15 20:31:18 -0800 | [diff] [blame] | 678 | return nullptr; |
| 679 | } |
| 680 | |
| 681 | if (mGnssBatching == nullptr) { |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 682 | hw_module_t* module; |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 683 | const FlpLocationInterface* flpLocationIface = nullptr; |
Wyatt Riley | 8791e7b | 2017-01-17 12:12:25 -0800 | [diff] [blame] | 684 | int err = hw_get_module(FUSED_LOCATION_HARDWARE_MODULE_ID, (hw_module_t const**)&module); |
| 685 | |
| 686 | if (err != 0) { |
| 687 | ALOGE("gnss flp hw_get_module failed: %d", err); |
| 688 | } else if (module == nullptr) { |
| 689 | ALOGE("Fused Location hw_get_module returned null module"); |
| 690 | } else if (module->methods == nullptr) { |
| 691 | ALOGE("Fused Location hw_get_module returned null methods"); |
| 692 | } else { |
| 693 | hw_device_t* device; |
| 694 | err = module->methods->open(module, FUSED_LOCATION_HARDWARE_MODULE_ID, &device); |
| 695 | if (err != 0) { |
| 696 | ALOGE("flpDevice open failed: %d", err); |
| 697 | } else { |
| 698 | flp_device_t * flpDevice = reinterpret_cast<flp_device_t*>(device); |
| 699 | flpLocationIface = flpDevice->get_flp_interface(flpDevice); |
| 700 | } |
| 701 | } |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 702 | |
| 703 | if (flpLocationIface == nullptr) { |
| 704 | ALOGE("%s: GnssBatching interface is not implemented by HAL", __func__); |
| 705 | } else { |
| 706 | mGnssBatching = new GnssBatching(flpLocationIface); |
| 707 | } |
| 708 | } |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 709 | return mGnssBatching; |
| 710 | } |
| 711 | |
Wyatt Riley | 917640b | 2017-03-16 16:25:55 -0700 | [diff] [blame] | 712 | void Gnss::handleHidlDeath() { |
| 713 | ALOGW("GNSS service noticed HIDL death. Stopping all GNSS operations."); |
| 714 | |
| 715 | // commands down to the HAL implementation |
| 716 | stop(); // stop ongoing GPS tracking |
| 717 | if (mGnssMeasurement != nullptr) { |
| 718 | mGnssMeasurement->close(); |
| 719 | } |
| 720 | if (mGnssNavigationMessage != nullptr) { |
| 721 | mGnssNavigationMessage->close(); |
| 722 | } |
| 723 | if (mGnssBatching != nullptr) { |
| 724 | mGnssBatching->stop(); |
| 725 | mGnssBatching->cleanup(); |
| 726 | } |
| 727 | cleanup(); |
| 728 | |
| 729 | /* |
| 730 | * This has died, so close it off in case (race condition) callbacks happen |
| 731 | * before HAL processes above messages. |
| 732 | */ |
| 733 | sGnssCbIface = nullptr; |
| 734 | } |
| 735 | |
Chris Phoenix | ab5c1e1 | 2017-01-23 15:14:08 -0800 | [diff] [blame] | 736 | IGnss* HIDL_FETCH_IGnss(const char* /* hal */) { |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 737 | hw_module_t* module; |
| 738 | IGnss* iface = nullptr; |
| 739 | int err = hw_get_module(GPS_HARDWARE_MODULE_ID, (hw_module_t const**)&module); |
| 740 | |
| 741 | if (err == 0) { |
| 742 | hw_device_t* device; |
| 743 | err = module->methods->open(module, GPS_HARDWARE_MODULE_ID, &device); |
| 744 | if (err == 0) { |
| 745 | iface = new Gnss(reinterpret_cast<gps_device_t*>(device)); |
| 746 | } else { |
Chris Phoenix | ab5c1e1 | 2017-01-23 15:14:08 -0800 | [diff] [blame] | 747 | ALOGE("gnssDevice open %s failed: %d", GPS_HARDWARE_MODULE_ID, err); |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 748 | } |
| 749 | } else { |
Chris Phoenix | ab5c1e1 | 2017-01-23 15:14:08 -0800 | [diff] [blame] | 750 | ALOGE("gnss hw_get_module %s failed: %d", GPS_HARDWARE_MODULE_ID, err); |
Hridya Valsaraju | 29dc1e0 | 2016-10-21 14:41:12 -0700 | [diff] [blame] | 751 | } |
| 752 | return iface; |
| 753 | } |
| 754 | |
| 755 | } // namespace implementation |
| 756 | } // namespace V1_0 |
| 757 | } // namespace gnss |
| 758 | } // namespace hardware |
| 759 | } // namespace android |