sm8450-common: gps: Update to LA.VENDOR.1.0.r1-21900-WAIPIO.0

Change-Id: Ib431364a902ecd9b068e672978f5e24ecbf42160
This commit is contained in:
Arian
2024-02-27 23:45:03 +01:00
parent 36c55874bb
commit f518e7ef8f
29 changed files with 1500 additions and 168 deletions

View File

@@ -27,6 +27,12 @@
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#include "DataItemConcreteTypes.h"
#include <inttypes.h>
#include <log_util.h>
@@ -146,8 +152,26 @@ void ENHDataItem::stringify(string& valueStr) {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
valueStr.clear ();
valueStr = ENH_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mEnabled) ? ("true") : ("false");
if (!d->isEnabled()) {
Fields field = FIELD_MAX;
switch (mFieldUpdate) {
case FIELD_CONSENT:
valueStr += "_FIELD_CONSENT";
field = FIELD_CONSENT;
break;
case FIELD_REGION:
valueStr += "_FIELD_REGION";
field = FIELD_REGION;
break;
default:
break;
}
valueStr += ": ";
valueStr += (((1 << field) & d->mEnhFields) != 0) ? "true" : "false";
} else {
valueStr += ": ";
valueStr += "true";
}
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
@@ -582,8 +606,17 @@ int32_t ENHDataItem::copyFrom(IDataItemCore* src) {
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
if (s->mEnabled == d->mEnabled) { result = true; break; }
s->mEnabled = d->mEnabled;
if (s->mEnhFields == d->mEnhFields) { result = true; break; }
switch (d->mAction) {
case SET:
s->mEnhFields |= (1 << d->mFieldUpdate);
break;
case CLEAR:
s->mEnhFields &= ~(1 << d->mFieldUpdate);
break;
default:
break;
}
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);

View File

@@ -27,6 +27,12 @@
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef DATAITEM_CONCRETETYPES_H
#define DATAITEM_CONCRETETYPES_H
@@ -143,13 +149,46 @@ public:
class ENHDataItem: public IDataItemCore {
public:
ENHDataItem(bool enabled = false) :
mEnabled(enabled) {mId = ENH_DATA_ITEM_ID;}
enum Fields { FIELD_CONSENT, FIELD_REGION, FIELD_MAX };
enum Actions { NO_OP, SET, CLEAR };
ENHDataItem(bool enabled = false, Fields updateBit = FIELD_MAX) :
mEnhFields(0), mFieldUpdate(updateBit) {
mId = ENH_DATA_ITEM_ID;
setAction(enabled ? SET : CLEAR);
}
virtual ~ENHDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mEnabled;
inline bool isEnabled() const {
uint8_t combinedBits = (1 << FIELD_MAX) - 1;
return (combinedBits == (mEnhFields & combinedBits));
}
void setAction(Actions action = NO_OP) {
mAction = action;
if (NO_OP != mAction) {
updateFields();
}
}
void updateFields() {
if (FIELD_MAX > mFieldUpdate) {
switch (mAction) {
case SET:
mEnhFields |= (1 << mFieldUpdate);
break;
case CLEAR:
mEnhFields &= ~(1 << mFieldUpdate);
break;
case NO_OP:
default:
break;
}
}
}
// Data members
uint32_t mEnhFields;
private:
Actions mAction;
Fields mFieldUpdate;
};
class GPSStateDataItem: public IDataItemCore {