diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2022-11-08 01:02:30 -0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2022-11-08 01:02:30 -0800 |
commit | 28fb84e8d1cb41e22e7f6210ea04190914db103f (patch) | |
tree | 5b738415dd104ede73fc0302be693557ad2cc3d5 /gnss | |
parent | c259797d7567e8fb71d46fb69a0fa941cdd4b72c (diff) | |
parent | ee0fa20a1d35466b22264116eaeb957495ce6667 (diff) |
Merge ee0fa20a1d35466b22264116eaeb957495ce6667 on remote branchHEADumineko-8350tachibana-8350
Change-Id: Ie3e99d857848862a71a6b35e4293b905b7fd9fd4
Diffstat (limited to 'gnss')
-rw-r--r-- | gnss/GnssAdapter.cpp | 78 | ||||
-rw-r--r-- | gnss/GnssAdapter.h | 39 |
2 files changed, 17 insertions, 100 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 0235d2c..f3ccd99 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -170,6 +170,7 @@ GnssAdapter::GnssAdapter() : readConfigCommand(); initDefaultAgpsCommand(); initEngHubProxyCommand(); + // at last step, let us inform adapater base that we are done // with initialization, e.g.: ready to process handleEngineUpEvent doneInit(); @@ -2564,51 +2565,15 @@ GnssAdapter::updateClientsEventMask() } void -GnssAdapter::handleEngineLockStatusEvent(EngineLockState engineLockState) { - - LOC_LOGD("%s]: Old Engine state %d, New Engine state : %d,", - __func__, mLocApi->getEngineLockState(), engineLockState); - - struct MsgEngineLockStateEvent : public LocMsg { - GnssAdapter& mAdapter; - EngineLockState mEngineLockState; - - inline MsgEngineLockStateEvent(GnssAdapter& adapter, EngineLockState engineLockState) : - LocMsg(), - mAdapter(adapter), - mEngineLockState(engineLockState) {} - - virtual void proc() const { - mAdapter.handleEngineLockStatus(mEngineLockState); - } - }; - - sendMsg(new MsgEngineLockStateEvent(*this, engineLockState)); -} - -void -GnssAdapter::handleEngineLockStatus(EngineLockState engineLockState) { - - if (ENGINE_LOCK_STATE_ENABLED == engineLockState) { - for (auto msg: mPendingGnssEnabledMsgs) { - sendMsg(msg); - } - mPendingGnssEnabledMsgs.clear(); - } -} - -void GnssAdapter::handleEngineUpEvent() { LOC_LOGD("%s]: ", __func__); struct MsgHandleEngineUpEvent : public LocMsg { GnssAdapter& mAdapter; - LocApiBase& mApi; - inline MsgHandleEngineUpEvent(GnssAdapter& adapter, LocApiBase& api) : + inline MsgHandleEngineUpEvent(GnssAdapter& adapter) : LocMsg(), - mAdapter(adapter), - mApi(api) {} + mAdapter(adapter) {} virtual void proc() const { mAdapter.setEngineCapabilitiesKnown(true); mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); @@ -2620,19 +2585,17 @@ GnssAdapter::handleEngineUpEvent() mAdapter.gnssSecondaryBandConfigUpdate(); // start CDFW service mAdapter.initCDFWService(); - - if (ENGINE_LOCK_STATE_ENABLED == mApi.getEngineLockState()) { - // restart sessions - mAdapter.restartSessions(true); - for (auto msg: mAdapter.mPendingMsgs) { - mAdapter.sendMsg(msg); - } + // restart sessions + mAdapter.restartSessions(true); + for (auto msg: mAdapter.mPendingMsgs) { + mAdapter.sendMsg(msg); } + mAdapter.mPendingMsgs.clear(); } }; readConfigCommand(); - sendMsg(new MsgHandleEngineUpEvent(*this, *mLocApi)); + sendMsg(new MsgHandleEngineUpEvent(*this)); } void @@ -3009,11 +2972,9 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, TrackingOptions& options) mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); mApi.startDistanceBasedTracking(mSessionId, mOptions, new LocApiResponse(*mAdapter.getContext(), - [&mAdapter = mAdapter, mSessionId = mSessionId, mClient = mClient, - &mApi = mApi] + [&mAdapter = mAdapter, mSessionId = mSessionId, mClient = mClient] (LocationError err) { - if (ENGINE_LOCK_STATE_ENABLED == mApi.getEngineLockState() && - LOCATION_ERROR_SUCCESS != err) { + if (LOCATION_ERROR_SUCCESS != err) { mAdapter.eraseTrackingSession(mClient, mSessionId); } mAdapter.reportResponse(mClient, err, mSessionId); @@ -3120,8 +3081,7 @@ GnssAdapter::startTimeBasedTracking(LocationAPI* client, uint32_t sessionId, if (!checkAndSetSPEToRunforNHz(tempOptions)) { mLocApi->startTimeBasedTracking(tempOptions, new LocApiResponse(*getContext(), [this, client, sessionId] (LocationError err) { - if (ENGINE_LOCK_STATE_ENABLED == mLocApi->getEngineLockState() && - LOCATION_ERROR_SUCCESS != err) { + if (LOCATION_ERROR_SUCCESS != err) { eraseTrackingSession(client, sessionId); } else { checkUpdateDgnssNtrip(false); @@ -3156,8 +3116,7 @@ GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, if(!checkAndSetSPEToRunforNHz(tempOptions)) { mLocApi->startTimeBasedTracking(tempOptions, new LocApiResponse(*getContext(), [this, client, sessionId, oldOptions] (LocationError err) { - if (ENGINE_LOCK_STATE_ENABLED == mLocApi->getEngineLockState() && - LOCATION_ERROR_SUCCESS != err) { + if (LOCATION_ERROR_SUCCESS != err) { // restore the old LocationOptions saveTrackingSession(client, sessionId, oldOptions); } @@ -3272,10 +3231,9 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, if (LOCATION_ERROR_SUCCESS == err) { mApi.startDistanceBasedTracking(mSessionId, mOptions, new LocApiResponse(*mAdapter.getContext(), - [&mAdapter, mClient, mSessionId, mOptions, &mApi = mApi] + [&mAdapter, mClient, mSessionId, mOptions] (LocationError err) { - if (ENGINE_LOCK_STATE_DISABLED == mApi.getEngineLockState() || - LOCATION_ERROR_SUCCESS == err) { + if (LOCATION_ERROR_SUCCESS == err) { mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); } mAdapter.reportResponse(mClient, err, mSessionId); @@ -3389,11 +3347,9 @@ GnssAdapter::stopTrackingCommand(LocationAPI* client, uint32_t id) } else if (isDistanceBased) { mApi.stopDistanceBasedTracking(mSessionId, new LocApiResponse( *mAdapter.getContext(), - [&mAdapter = mAdapter, mSessionId = mSessionId, mClient = mClient, - &mApi = mApi] + [&mAdapter = mAdapter, mSessionId = mSessionId, mClient = mClient] (LocationError err) { - if (ENGINE_LOCK_STATE_DISABLED == mApi.getEngineLockState() || - LOCATION_ERROR_SUCCESS == err) { + if (LOCATION_ERROR_SUCCESS == err) { mAdapter.eraseTrackingSession(mClient, mSessionId); } mAdapter.reportResponse(mClient, err, mSessionId); diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index a9d0456..d7b4275 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -26,43 +26,6 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - -/* -Changes from Qualcomm Innovation Center are provided under the following license: - -Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted (subject to the limitations in the -disclaimer below) provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE -GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT -HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - #ifndef GNSS_ADAPTER_H #define GNSS_ADAPTER_H @@ -524,8 +487,6 @@ public: void odcpiTimerExpireEvent(); /* ==== REPORTS ======================================================================== */ - virtual void handleEngineLockStatusEvent(EngineLockState engineLockState); - void handleEngineLockStatus(EngineLockState engineLockState); /* ======== EVENTS ====(Called from QMI/EngineHub Thread)===================================== */ virtual void reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, |