Commit c2220f93 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

account: emit state change signal on main thread

Change-Id: Idcf09e8b9773e422de3894ac85114e0140aa7004
parent a81e2cf5
......@@ -158,15 +158,21 @@ Account::setRegistrationState(RegistrationState state, unsigned detail_code, con
if (state != registrationState_) {
registrationState_ = state;
// Notify the client
emitSignal<DRing::ConfigurationSignal::RegistrationStateChanged>(
accountID_,
mapStateNumberToString(registrationState_),
detail_code,
detail_str);
emitSignal<DRing::ConfigurationSignal::VolatileDetailsChanged>(
accountID_,
getVolatileAccountDetails());
runOnMainThread([
accountId = accountID_,
state = mapStateNumberToString(registrationState_),
detail_code,
detail_str,
details = getVolatileAccountDetails()
]{
emitSignal<DRing::ConfigurationSignal::RegistrationStateChanged>(
accountId,
state,
detail_code,
detail_str);
emitSignal<DRing::ConfigurationSignal::VolatileDetailsChanged>(accountId, details);
});
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment