Skip to content

Commit

Permalink
[M71 merge] assistant: Check status before starting service
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
wutao committed Oct 16, 2018
1 parent 2d3251e commit 34fe7f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chrome/browser/ui/ash/assistant/assistant_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <utility>

#include "ash/public/interfaces/voice_interaction_controller.mojom.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/arc/voice_interaction/voice_interaction_controller_client.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/assistant/assistant_context_util.h"
#include "chrome/browser/ui/ash/assistant/assistant_image_downloader.h"
#include "chrome/browser/ui/ash/assistant/assistant_setup.h"
Expand Down Expand Up @@ -38,6 +40,12 @@ AssistantClient::~AssistantClient() {
}

void AssistantClient::MaybeInit(service_manager::Connector* connector) {
if (arc::IsAssistantAllowedForProfile(
ProfileManager::GetActiveUserProfile()) !=
ash::mojom::AssistantAllowedState::ALLOWED) {
return;
}

if (initialized_)
return;

Expand Down

0 comments on commit 34fe7f7

Please sign in to comment.