summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Behnam Heydarshahi <bhnm@google.com> 2023-12-05 22:12:46 +0000
committer Behnam Heydarshahi <bhnm@google.com> 2023-12-05 23:28:57 +0000
commit8f7c7b8a99ec004eabb84a2f3bdada78c8245cfc (patch)
treeb233b93d07e7bdcf2b2e8d7b25b897616b34ff36
parent6c1bd4b3a2e928b1f745e2ca126c2dbdc9244fab (diff)
Allow SystemUIDialog.Factory to create with context from client
Change-Id: I00438cff0525337f8f35ce19991cdf5fa39d7f91 Flag: None Fixes: 315029242 Test: atest SystemUIDialogTest
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java
index 93bc96022292..af6da3fb6e51 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java
@@ -146,7 +146,7 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh
* When you just need a dialog, call this.
*/
public SystemUIDialog create() {
- return create(new DialogDelegate<>(){});
+ return create(new DialogDelegate<>(){}, mContext);
}
/**
@@ -155,13 +155,18 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh
*
* When you need to customize the dialog, pass it a delegate.
*/
+ public SystemUIDialog create(Delegate delegate, Context context) {
+ return create((DialogDelegate<SystemUIDialog>) delegate, context);
+ }
+
public SystemUIDialog create(Delegate delegate) {
- return create((DialogDelegate<SystemUIDialog>) delegate);
+ return create(delegate, mContext);
}
- private SystemUIDialog create(DialogDelegate<SystemUIDialog> dialogDelegate) {
+ private SystemUIDialog create(DialogDelegate<SystemUIDialog> dialogDelegate,
+ Context context) {
return new SystemUIDialog(
- mContext,
+ context,
DEFAULT_THEME,
DEFAULT_DISMISS_ON_DEVICE_LOCK,
mFeatureFlags,