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
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 @@
                 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 @@
             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 @@
         mutable SystemStatusOsObserver* mParent;
         IDataItemObserver* mClient;
         const unordered_set<DataItemId> mDataItemSet;
+        const list<DataItemId> diItemlist;
         bool mToRequestData;
     };