Skip to content

Commit 34fe7f7

Browse files
author
wutao
committed
[M71 merge] assistant: Check status before starting service
This cl checks the |allowed_status| before starting assistant service. [email protected] Bug: b/117371953 Test: manual. Change-Id: I0b638db9d92abd5f54c5f7f41d5f66c25a719f77 Reviewed-on: https://chromium-review.googlesource.com/c/1278345 Commit-Queue: Tao Wu <[email protected]> Reviewed-by: Xiaohui Chen <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#599075}(cherry picked from commit 2a789a6) Reviewed-on: https://chromium-review.googlesource.com/c/1284431 Reviewed-by: Tao Wu <[email protected]> Cr-Commit-Position: refs/branch-heads/3578@{#61} Cr-Branched-From: 4226ddf-refs/heads/master@{#599034}
1 parent 2d3251e commit 34fe7f7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

chrome/browser/ui/ash/assistant/assistant_client.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#include <utility>
88

99
#include "ash/public/interfaces/voice_interaction_controller.mojom.h"
10+
#include "chrome/browser/chromeos/arc/arc_util.h"
1011
#include "chrome/browser/chromeos/arc/voice_interaction/voice_interaction_controller_client.h"
12+
#include "chrome/browser/profiles/profile_manager.h"
1113
#include "chrome/browser/ui/ash/assistant/assistant_context_util.h"
1214
#include "chrome/browser/ui/ash/assistant/assistant_image_downloader.h"
1315
#include "chrome/browser/ui/ash/assistant/assistant_setup.h"
@@ -38,6 +40,12 @@ AssistantClient::~AssistantClient() {
3840
}
3941

4042
void AssistantClient::MaybeInit(service_manager::Connector* connector) {
43+
if (arc::IsAssistantAllowedForProfile(
44+
ProfileManager::GetActiveUserProfile()) !=
45+
ash::mojom::AssistantAllowedState::ALLOWED) {
46+
return;
47+
}
48+
4149
if (initialized_)
4250
return;
4351

0 commit comments

Comments
 (0)