Skip to content

Commit 4234539

Browse files
Xiaohui ChenXiaohui Chen
authored andcommitted
Revert "Enable Assistant for child accounts."
This reverts commit 7c4d25d. Reason for revert: feature punted to M74 Bug: 914210 Original change's description: > Enable Assistant for child accounts. > > This reverts commit 71f820a ("Disable assistant for child account"). > > Bug: b:120075638 > Test: built and tested locally > Change-Id: I59d3d4869ba596fa462a904b8a64a88230c28325 > Reviewed-on: https://chromium-review.googlesource.com/c/1351155 > Commit-Queue: Henrique Nazaré Santos <[email protected]> > Reviewed-by: Xiyuan Xia <[email protected]> > Reviewed-by: Xiaohui Chen <[email protected]> > Reviewed-by: Sam McNally <[email protected]> > Cr-Commit-Position: refs/heads/master@{#613206} [email protected],[email protected],[email protected],[email protected] Bug: b:120075638 Change-Id: I452fba75870677ec70fc3d1bcec3ab433c5361fd Reviewed-on: https://chromium-review.googlesource.com/c/1447270 Reviewed-by: Xiaohui Chen <[email protected]> Cr-Commit-Position: refs/branch-heads/3683@{#84} Cr-Branched-From: e510299-refs/heads/master@{#625896}
1 parent 90a4cdd commit 4234539

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

ash/accelerators/accelerator_controller.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ void HandleToggleVoiceInteraction(const ui::Accelerator& accelerator) {
709709
case mojom::AssistantAllowedState::DISALLOWED_BY_ARC_DISALLOWED:
710710
case mojom::AssistantAllowedState::DISALLOWED_BY_FLAG:
711711
case mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER:
712+
case mojom::AssistantAllowedState::DISALLOWED_BY_CHILD_USER:
712713
case mojom::AssistantAllowedState::DISALLOWED_BY_INCOGNITO:
713714
// TODO(xiaohuic): show a specific toast.
714715
return;

ash/public/interfaces/voice_interaction_controller.mojom

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ enum AssistantAllowedState {
3939
DISALLOWED_BY_NONPRIMARY_USER,
4040
// Disallowed because current user is supervised user.
4141
DISALLOWED_BY_SUPERVISED_USER,
42+
// Disallowed because current user is child user.
43+
DISALLOWED_BY_CHILD_USER,
4244
// Disallowed because incognito mode.
4345
DISALLOWED_BY_INCOGNITO,
4446
// Disallowed because the device is in demo mode.

chrome/browser/chromeos/arc/arc_util.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,9 @@ ash::mojom::AssistantAllowedState IsAssistantAllowedForProfile(
597597
if (profile->IsLegacySupervised())
598598
return ash::mojom::AssistantAllowedState::DISALLOWED_BY_SUPERVISED_USER;
599599

600+
if (profile->IsChild())
601+
return ash::mojom::AssistantAllowedState::DISALLOWED_BY_CHILD_USER;
602+
600603
if (chromeos::DemoSession::IsDeviceInDemoMode())
601604
return ash::mojom::AssistantAllowedState::DISALLOWED_BY_DEMO_MODE;
602605

chrome/browser/chromeos/arc/arc_util_unittest.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "chrome/browser/policy/profile_policy_connector.h"
3030
#include "chrome/browser/policy/profile_policy_connector_factory.h"
3131
#include "chrome/browser/profiles/profile.h"
32+
#include "chrome/browser/supervised_user/supervised_user_constants.h"
3233
#include "chrome/test/base/testing_browser_process.h"
3334
#include "chrome/test/base/testing_profile.h"
3435
#include "chrome/test/base/testing_profile_manager.h"
@@ -531,6 +532,18 @@ TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_SupervisedUser) {
531532
IsAssistantAllowedForProfile(profile()));
532533
}
533534

535+
TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_ChildUser) {
536+
base::CommandLine::ForCurrentProcess()->InitFromArgv(
537+
{"", "--arc-availability=officially-supported",
538+
"--enable-voice-interaction"});
539+
ScopedLogIn login(GetFakeUserManager(),
540+
AccountId::FromUserEmailGaiaId(
541+
profile()->GetProfileUserName(), kTestGaiaId));
542+
profile()->SetSupervisedUserId(supervised_users::kChildAccountSUID);
543+
EXPECT_EQ(ash::mojom::AssistantAllowedState::DISALLOWED_BY_CHILD_USER,
544+
IsAssistantAllowedForProfile(profile()));
545+
}
546+
534547
TEST_F(ChromeArcUtilTest, IsAssistantAllowedForProfile_Locale) {
535548
profile()->GetTestingPrefService()->SetString(
536549
language::prefs::kApplicationLocale, "he");

0 commit comments

Comments
 (0)