summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Lorenz <jlorenz@de.adit-jv.com>2017-03-20 20:23:02 +0100
committerJens Lorenz <jlorenz@de.adit-jv.com>2017-04-11 21:37:17 +0200
commitb0196808d2164d282c434b92fe5db34078f1a80e (patch)
tree2c1e2c0160b0bd7bf528a779ab7e5c168a6d7268
parent698bf42333c7f75873c455cc1321ee722b2771b2 (diff)
downloadaudiomanager-b0196808d2164d282c434b92fe5db34078f1a80e.tar.gz
AMCore: Fix connection state notification on remove connection
The CS_DISCONNECTED was notified even in case WITH_DATABASE_CHANGE_CHECK flag was activated and the main connection was already disconnected by controller. Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
-rw-r--r--AudioManagerCore/src/CAmDatabaseHandlerMap.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp
index 2427630..48ef37b 100644
--- a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp
+++ b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp
@@ -55,6 +55,7 @@
(true)
#endif
+
#define NOTIFY_OBSERVERS(CALL)\
for(AmDatabaseObserverCallbacks * nextObserver: mDatabaseObservers)\
if(nextObserver->CALL)\
@@ -1505,12 +1506,14 @@ am_Error_e CAmDatabaseHandlerMap::removeMainConnectionDB(const am_mainConnection
return (E_NON_EXISTENT);
}
- mMappedData.mMainConnectionMap.erase(mainConnectionID);
+ DB_COND_UPDATE_INIT;
+ DB_COND_UPDATE(mMappedData.mMainConnectionMap[mainConnectionID].mainConnectionID, CS_DISCONNECTED);
+ if (DB_COND_ISMODIFIED)
+ NOTIFY_OBSERVERS2(dboMainConnectionStateChanged, mainConnectionID, CS_DISCONNECTED)
+ mMappedData.mMainConnectionMap.erase(mainConnectionID);
logVerbose("DatabaseHandler::removeMainConnectionDB removed:", mainConnectionID);
-
- NOTIFY_OBSERVERS2(dboMainConnectionStateChanged, mainConnectionID, CS_DISCONNECTED)
- NOTIFY_OBSERVERS1(dboRemovedMainConnection, mainConnectionID)
+ NOTIFY_OBSERVERS1(dboRemovedMainConnection, mainConnectionID)
return (E_OK);
}