Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +18 −17 Original line number Diff line number Diff line Loading @@ -148,6 +148,7 @@ import java.util.Set; import java.util.concurrent.Executor; import javax.inject.Inject; import javax.inject.Provider; /** * Helper to show the global actions dialog. Each item is an {@link Action} that may show depending Loading Loading @@ -401,7 +402,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, if (mDialog != null) { if (!mDialog.isShowingControls() && shouldShowControls()) { mDialog.showControls(mControlsUiControllerOptional.get()); } else if (shouldShowLockMessage()) { } else if (shouldShowLockMessage(mDialog)) { mDialog.showLockMessage(); } } Loading Loading @@ -698,19 +699,17 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mPowerAdapter = new MyPowerOptionsAdapter(); mDepthController.setShowingHomeControls(true); GlobalActionsPanelPlugin.PanelViewController walletViewController = getWalletViewController(); ControlsUiController uiController = null; if (mControlsUiControllerOptional.isPresent() && shouldShowControls()) { uiController = mControlsUiControllerOptional.get(); } ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, mOverflowAdapter, walletViewController, mDepthController, mSysuiColorExtractor, this::getWalletViewController, mDepthController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, controlsAvailable(), uiController, mSysUiState, this::onRotate, mKeyguardShowing, mPowerAdapter); if (shouldShowLockMessage()) { if (shouldShowLockMessage(dialog)) { dialog.showLockMessage(); } dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. Loading Loading @@ -2124,7 +2123,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private MultiListLayout mGlobalActionsLayout; private Drawable mBackgroundDrawable; private final SysuiColorExtractor mColorExtractor; private final GlobalActionsPanelPlugin.PanelViewController mWalletViewController; private final Provider<GlobalActionsPanelPlugin.PanelViewController> mWalletFactory; @Nullable private GlobalActionsPanelPlugin.PanelViewController mWalletViewController; private boolean mKeyguardShowing; private boolean mShowing; private float mScrimAlpha; Loading @@ -2144,7 +2144,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private TextView mLockMessage; ActionsDialog(Context context, MyAdapter adapter, MyOverflowAdapter overflowAdapter, GlobalActionsPanelPlugin.PanelViewController walletViewController, Provider<GlobalActionsPanelPlugin.PanelViewController> walletFactory, NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, Loading @@ -2165,6 +2165,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mSysUiState = sysuiState; mOnRotateCallback = onRotateCallback; mKeyguardShowing = keyguardShowing; mWalletFactory = walletFactory; // Window initialization Window window = getWindow(); Loading @@ -2187,7 +2188,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, window.getAttributes().setFitInsetsTypes(0 /* types */); setTitle(R.string.global_actions); mWalletViewController = walletViewController; initializeLayout(); } Loading @@ -2200,8 +2200,13 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mControlsUiController.show(mControlsView, this::dismissForControlsActivity); } private boolean isWalletViewAvailable() { return mWalletViewController != null && mWalletViewController.getPanelContent() != null; } private void initializeWalletView() { if (mWalletViewController == null || mWalletViewController.getPanelContent() == null) { mWalletViewController = mWalletFactory.get(); if (!isWalletViewAvailable()) { return; } Loading Loading @@ -2507,6 +2512,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private void dismissWallet() { if (mWalletViewController != null) { mWalletViewController.onDismissed(); // The wallet controller should not be re-used after being dismissed. mWalletViewController = null; } } Loading Loading @@ -2648,18 +2655,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, && !mControlsServiceInfos.isEmpty(); } private boolean walletViewAvailable() { GlobalActionsPanelPlugin.PanelViewController walletViewController = getWalletViewController(); return walletViewController != null && walletViewController.getPanelContent() != null; } private boolean shouldShowLockMessage() { private boolean shouldShowLockMessage(ActionsDialog dialog) { boolean isLockedAfterBoot = mLockPatternUtils.getStrongAuthForUser(getCurrentUser().id) == STRONG_AUTH_REQUIRED_AFTER_BOOT; return !mKeyguardStateController.isUnlocked() && (!mShowLockScreenCardsAndControls || isLockedAfterBoot) && (controlsAvailable() || walletViewAvailable()); && (controlsAvailable() || dialog.isWalletViewAvailable()); } private void onPowerMenuLockScreenSettingsChanged() { Loading Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +18 −17 Original line number Diff line number Diff line Loading @@ -148,6 +148,7 @@ import java.util.Set; import java.util.concurrent.Executor; import javax.inject.Inject; import javax.inject.Provider; /** * Helper to show the global actions dialog. Each item is an {@link Action} that may show depending Loading Loading @@ -401,7 +402,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, if (mDialog != null) { if (!mDialog.isShowingControls() && shouldShowControls()) { mDialog.showControls(mControlsUiControllerOptional.get()); } else if (shouldShowLockMessage()) { } else if (shouldShowLockMessage(mDialog)) { mDialog.showLockMessage(); } } Loading Loading @@ -698,19 +699,17 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mPowerAdapter = new MyPowerOptionsAdapter(); mDepthController.setShowingHomeControls(true); GlobalActionsPanelPlugin.PanelViewController walletViewController = getWalletViewController(); ControlsUiController uiController = null; if (mControlsUiControllerOptional.isPresent() && shouldShowControls()) { uiController = mControlsUiControllerOptional.get(); } ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, mOverflowAdapter, walletViewController, mDepthController, mSysuiColorExtractor, this::getWalletViewController, mDepthController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, controlsAvailable(), uiController, mSysUiState, this::onRotate, mKeyguardShowing, mPowerAdapter); if (shouldShowLockMessage()) { if (shouldShowLockMessage(dialog)) { dialog.showLockMessage(); } dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. Loading Loading @@ -2124,7 +2123,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private MultiListLayout mGlobalActionsLayout; private Drawable mBackgroundDrawable; private final SysuiColorExtractor mColorExtractor; private final GlobalActionsPanelPlugin.PanelViewController mWalletViewController; private final Provider<GlobalActionsPanelPlugin.PanelViewController> mWalletFactory; @Nullable private GlobalActionsPanelPlugin.PanelViewController mWalletViewController; private boolean mKeyguardShowing; private boolean mShowing; private float mScrimAlpha; Loading @@ -2144,7 +2144,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private TextView mLockMessage; ActionsDialog(Context context, MyAdapter adapter, MyOverflowAdapter overflowAdapter, GlobalActionsPanelPlugin.PanelViewController walletViewController, Provider<GlobalActionsPanelPlugin.PanelViewController> walletFactory, NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, Loading @@ -2165,6 +2165,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mSysUiState = sysuiState; mOnRotateCallback = onRotateCallback; mKeyguardShowing = keyguardShowing; mWalletFactory = walletFactory; // Window initialization Window window = getWindow(); Loading @@ -2187,7 +2188,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, window.getAttributes().setFitInsetsTypes(0 /* types */); setTitle(R.string.global_actions); mWalletViewController = walletViewController; initializeLayout(); } Loading @@ -2200,8 +2200,13 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mControlsUiController.show(mControlsView, this::dismissForControlsActivity); } private boolean isWalletViewAvailable() { return mWalletViewController != null && mWalletViewController.getPanelContent() != null; } private void initializeWalletView() { if (mWalletViewController == null || mWalletViewController.getPanelContent() == null) { mWalletViewController = mWalletFactory.get(); if (!isWalletViewAvailable()) { return; } Loading Loading @@ -2507,6 +2512,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private void dismissWallet() { if (mWalletViewController != null) { mWalletViewController.onDismissed(); // The wallet controller should not be re-used after being dismissed. mWalletViewController = null; } } Loading Loading @@ -2648,18 +2655,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, && !mControlsServiceInfos.isEmpty(); } private boolean walletViewAvailable() { GlobalActionsPanelPlugin.PanelViewController walletViewController = getWalletViewController(); return walletViewController != null && walletViewController.getPanelContent() != null; } private boolean shouldShowLockMessage() { private boolean shouldShowLockMessage(ActionsDialog dialog) { boolean isLockedAfterBoot = mLockPatternUtils.getStrongAuthForUser(getCurrentUser().id) == STRONG_AUTH_REQUIRED_AFTER_BOOT; return !mKeyguardStateController.isUnlocked() && (!mShowLockScreenCardsAndControls || isLockedAfterBoot) && (controlsAvailable() || walletViewAvailable()); && (controlsAvailable() || dialog.isWalletViewAvailable()); } private void onPowerMenuLockScreenSettingsChanged() { Loading