summaryrefslogtreecommitdiff
path: root/core/SystemStatusOsObserver.cpp
diff options
context:
space:
mode:
authorHarikrishnan Hariharan <hahariha@codeaurora.org>2018-11-16 17:58:35 +0530
committerHarikrishnan Hariharan <hahariha@codeaurora.org>2018-11-20 14:17:58 +0530
commit06d7e5bbba73be1399450ae1c3c077f7c177bf9b (patch)
treeb2e593247a81479c319b7b548be5bd5f812913c7 /core/SystemStatusOsObserver.cpp
parent272be96747a2b9fd33de8e46460f525d24bee11a (diff)
downloadgps-06d7e5bbba73be1399450ae1c3c077f7c177bf9b.tar.gz
Request for a data item value is not handle by SSO
Subscribe for a data item first time adds the DI to internal SSO client list. When the request comes for after this, since item is already added, dataItemsToSubscribe will be empty. So the code for request value for DI is not invoked. Handle this scenario in SSO. Change-Id: Ife04fe4eedc9b3132e7967f781b0e29ac41c01e7 CRs-Fixed: 2347338
Diffstat (limited to 'core/SystemStatusOsObserver.cpp')
-rw-r--r--core/SystemStatusOsObserver.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp
index 20ef1ae..3fdb513 100644
--- a/core/SystemStatusOsObserver.cpp
+++ b/core/SystemStatusOsObserver.cpp
@@ -97,6 +97,7 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
list<DataItemId>& l, IDataItemObserver* client, bool requestData) :
mParent(parent), mClient(client),
mDataItemSet(containerTransfer<list<DataItemId>, unordered_set<DataItemId>>(l)),
+ diItemlist(l),
mToRequestData(requestData) {}
void proc() const {
@@ -107,16 +108,13 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
mParent->sendCachedDataItems(mDataItemSet, mClient);
// Send subscription set to framework
- if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToSubscribe.empty()) {
- LOC_LOGD("Subscribe Request sent to framework for the following");
- mParent->logMe(dataItemsToSubscribe);
-
+ if (nullptr != mParent->mContext.mSubscriptionObj) {
if (mToRequestData) {
- mParent->mContext.mSubscriptionObj->requestData(
- containerTransfer<unordered_set<DataItemId>, list<DataItemId>>(
- std::move(dataItemsToSubscribe)),
- mParent);
- } else {
+ LOC_LOGD("Request Data sent to framework for the following");
+ mParent->mContext.mSubscriptionObj->requestData(diItemlist, mParent);
+ } else if (!dataItemsToSubscribe.empty()) {
+ LOC_LOGD("Subscribe Request sent to framework for the following");
+ mParent->logMe(dataItemsToSubscribe);
mParent->mContext.mSubscriptionObj->subscribe(
containerTransfer<unordered_set<DataItemId>, list<DataItemId>>(
std::move(dataItemsToSubscribe)),
@@ -127,6 +125,7 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
mutable SystemStatusOsObserver* mParent;
IDataItemObserver* mClient;
const unordered_set<DataItemId> mDataItemSet;
+ const list<DataItemId> diItemlist;
bool mToRequestData;
};