summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jordan Demeulenaere <jdemeulenaere@google.com> 2022-09-30 18:06:02 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-09-30 18:06:02 +0000
commitff01ca2e3ad10d0518a8cf4e76dc50989dfb68f4 (patch)
tree27ff8fc181a81547499e8c9848a28f5d7fa366be
parent88fa84315b8ad582b90011e512917709a050adad (diff)
parentd123ab726abdf5517ac48c6777816711f76f7d87 (diff)
Merge "Fix security dialog bug" into tm-qpr-dev am: 2afa837b22 am: d123ab726a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20082930 Change-Id: I0f64a3601cb9fbddbf569a4106e88d9fa0e68283 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooterUtils.java10
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java4
2 files changed, 7 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooterUtils.java b/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooterUtils.java
index bd75c75faa00..ae6ed2008a77 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooterUtils.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooterUtils.java
@@ -444,7 +444,7 @@ public class QSSecurityFooterUtils implements DialogInterface.OnClickListener {
mShouldUseSettingsButton.set(false);
mBgHandler.post(() -> {
String settingsButtonText = getSettingsButton();
- final View dialogView = createDialogView();
+ final View dialogView = createDialogView(quickSettingsContext);
mMainHandler.post(() -> {
mDialog = new SystemUIDialog(quickSettingsContext, 0);
mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@@ -469,14 +469,14 @@ public class QSSecurityFooterUtils implements DialogInterface.OnClickListener {
}
@VisibleForTesting
- View createDialogView() {
+ View createDialogView(Context quickSettingsContext) {
if (mSecurityController.isParentalControlsEnabled()) {
return createParentalControlsDialogView();
}
- return createOrganizationDialogView();
+ return createOrganizationDialogView(quickSettingsContext);
}
- private View createOrganizationDialogView() {
+ private View createOrganizationDialogView(Context quickSettingsContext) {
final boolean isDeviceManaged = mSecurityController.isDeviceManaged();
final boolean hasWorkProfile = mSecurityController.hasWorkProfile();
final CharSequence deviceOwnerOrganization =
@@ -487,7 +487,7 @@ public class QSSecurityFooterUtils implements DialogInterface.OnClickListener {
final String vpnName = mSecurityController.getPrimaryVpnName();
final String vpnNameWorkProfile = mSecurityController.getWorkProfileVpnName();
- View dialogView = LayoutInflater.from(mContext)
+ View dialogView = LayoutInflater.from(quickSettingsContext)
.inflate(R.layout.quick_settings_footer_dialog, null, false);
// device management section
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java
index 233c267c3be0..1c686c66e31e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java
@@ -726,7 +726,7 @@ public class QSSecurityFooterTest extends SysuiTestCase {
when(mSecurityController.isParentalControlsEnabled()).thenReturn(true);
when(mSecurityController.getLabel(any())).thenReturn(PARENTAL_CONTROLS_LABEL);
- View view = mFooterUtils.createDialogView();
+ View view = mFooterUtils.createDialogView(getContext());
TextView textView = (TextView) view.findViewById(R.id.parental_controls_title);
assertEquals(PARENTAL_CONTROLS_LABEL, textView.getText());
}
@@ -749,7 +749,7 @@ public class QSSecurityFooterTest extends SysuiTestCase {
when(mSecurityController.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
.thenReturn(DEVICE_OWNER_TYPE_FINANCED);
- View view = mFooterUtils.createDialogView();
+ View view = mFooterUtils.createDialogView(getContext());
TextView managementSubtitle = view.findViewById(R.id.device_management_subtitle);
assertEquals(View.VISIBLE, managementSubtitle.getVisibility());