From 8fca8dc0924c667b5c3a86c9b6ba699dbc1d034d Mon Sep 17 00:00:00 2001 From: arangelov Date: Fri, 25 Jun 2021 18:54:28 +0100 Subject: [PATCH] [Settings] Pass the system user to launch the web help page Fixes: 191727929 Test: manually observed the policy transparency dialog with launching the admin policies screen Test: manually observed the policy transparency dialog with launching the web help page Change-Id: If0d10b30a5e5f2a1bade168f049c8613055289e7 --- .../settings/enterprise/ActionDisabledByAdminDialogHelper.java | 3 ++- .../ActionDisabledLearnMoreButtonLauncherImplTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java b/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java index ccc74367cdf..f898ab21408 100644 --- a/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java +++ b/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java @@ -65,7 +65,8 @@ public final class ActionDisabledByAdminDialogHelper { R.layout.admin_support_details_dialog, null); mActionDisabledByAdminController = ActionDisabledByAdminControllerFactory .createInstance(mActivity, restriction, - new DeviceAdminStringProviderImpl(mActivity)); + new DeviceAdminStringProviderImpl(mActivity), + UserHandle.SYSTEM); } private @UserIdInt int getEnforcementAdminUserId(@NonNull EnforcedAdmin admin) { diff --git a/tests/unit/src/com/android/settings/enterprise/ActionDisabledLearnMoreButtonLauncherImplTest.java b/tests/unit/src/com/android/settings/enterprise/ActionDisabledLearnMoreButtonLauncherImplTest.java index 4f7ecc8904e..0b0b8e5f91f 100644 --- a/tests/unit/src/com/android/settings/enterprise/ActionDisabledLearnMoreButtonLauncherImplTest.java +++ b/tests/unit/src/com/android/settings/enterprise/ActionDisabledLearnMoreButtonLauncherImplTest.java @@ -111,7 +111,7 @@ public class ActionDisabledLearnMoreButtonLauncherImplTest { @Test public void showHelpPage_works() { - mImpl.showHelpPage(mActivity, URL); + mImpl.showHelpPage(mActivity, URL, CONTEXT_USER); verify(mActivity).startActivityAsUser(mIntentCaptor.capture(), eq(CONTEXT_USER)); assertActionViewIntent(mIntentCaptor.getValue());