Commit 3d13904e authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Commit Bot

assistant: reset data when disabled

Bug: b:126587141
Test: locally build and run. See dir removed when disabled.
Change-Id: Ic67d30d9a786078e90aac67447cec0b5e8187f6f
Reviewed-on: https://chromium-review.googlesource.com/c/1492050Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636261}
parent da178087
...@@ -160,6 +160,12 @@ void AssistantManagerServiceImpl::Stop() { ...@@ -160,6 +160,12 @@ void AssistantManagerServiceImpl::Stop() {
state_ = State::STOPPED; state_ = State::STOPPED;
// When user disables the feature, we also deletes all data.
if (!service_->assistant_state()->settings_enabled().value() &&
assistant_manager_) {
assistant_manager_->ResetAllDataAndShutdown();
}
assistant_manager_internal_ = nullptr; assistant_manager_internal_ = nullptr;
assistant_manager_.reset(nullptr); assistant_manager_.reset(nullptr);
} }
......
Markdown is supported
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