From d08d53efce148bfa49f26b1c54b5228e22d80a0a Mon Sep 17 00:00:00 2001 From: hyunho Date: Wed, 9 Sep 2020 10:00:48 +0900 Subject: [PATCH] Fix current buffer assign position - current buffer should be assigned before OnChanged Change-Id: I5e755d7d0da3a25b9a3f7c9aa46fa4433f68e9d3 Signed-off-by: hyunho --- watch-holder-base/src/watch_base.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/watch-holder-base/src/watch_base.cc b/watch-holder-base/src/watch_base.cc index 4eae633..1c7d5a4 100644 --- a/watch-holder-base/src/watch_base.cc +++ b/watch-holder-base/src/watch_base.cc @@ -169,11 +169,12 @@ void WatchBase::OnBufferChanged(int type, if (impl_->current_buffer_ == nullptr) { LOGD("first added !!!! %d %s", type, GetAppId().c_str()); + impl_->current_buffer_ = tbm; OnAdded(GetAppId(), GetInstId(), GetPid(), tbm); } else { + impl_->current_buffer_ = tbm; OnChanged(GetAppId(), GetInstId(), GetPid(), tbm); } - impl_->current_buffer_ = tbm; } void WatchBase::OnAdded(const std::string& appId, const std::string& instId, -- 2.7.4