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
This commit is contained in:
Harikrishnan Hariharan 2018-11-16 17:58:35 +05:30
parent 272be96747
commit 06d7e5bbba

View file

@ -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;
};