summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Justin Weir <justinweir@google.com> 2023-07-17 12:14:53 -0400
committer Justin Weir <justinweir@google.com> 2023-07-20 19:19:24 +0000
commit1fb1192d4b8e43f47d63730f4295eb2814fc7c49 (patch)
treeab60aa0eb58155a8f20f01f347c1c02fc93b7c9e
parent2e4f665635a714950bb5f418e2ad21646b967b5f (diff)
Remove getShadeViewController calls
Bug: 288868098 Test: updated and ran affected test Change-Id: Ibd10284d5821be5d29431cd08fbeebca06e1c212
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java7
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/accessibility/SystemActionsTest.java6
2 files changed, 10 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java
index 2f6a68c3ff8d..03ad132c452c 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java
@@ -54,6 +54,7 @@ import com.android.systemui.recents.Recents;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
+import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
@@ -188,6 +189,7 @@ public class SystemActions implements CoreStartable {
private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
private final NotificationShadeWindowController mNotificationShadeController;
private final ShadeController mShadeController;
+ private final Lazy<ShadeViewController> mShadeViewController;
private final StatusBarWindowCallback mNotificationShadeCallback;
private boolean mDismissNotificationShadeActionRegistered;
@@ -196,12 +198,14 @@ public class SystemActions implements CoreStartable {
UserTracker userTracker,
NotificationShadeWindowController notificationShadeController,
ShadeController shadeController,
+ Lazy<ShadeViewController> shadeViewController,
Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
Optional<Recents> recentsOptional,
DisplayTracker displayTracker) {
mContext = context;
mUserTracker = userTracker;
mShadeController = shadeController;
+ mShadeViewController = shadeViewController;
mRecentsOptional = recentsOptional;
mDisplayTracker = displayTracker;
mReceiver = new SystemActionsBroadcastReceiver();
@@ -330,8 +334,7 @@ public class SystemActions implements CoreStartable {
final Optional<CentralSurfaces> centralSurfacesOptional =
mCentralSurfacesOptionalLazy.get();
if (centralSurfacesOptional.isPresent()
- && centralSurfacesOptional.get().getShadeViewController() != null
- && centralSurfacesOptional.get().getShadeViewController().isPanelExpanded()
+ && mShadeViewController.get().isPanelExpanded()
&& !centralSurfacesOptional.get().isKeyguardShowing()) {
if (!mDismissNotificationShadeActionRegistered) {
mA11yManager.registerSystemAction(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/SystemActionsTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/SystemActionsTest.java
index 025c88c36203..576f689a16d0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/SystemActionsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/SystemActionsTest.java
@@ -39,6 +39,7 @@ import com.android.systemui.recents.Recents;
import com.android.systemui.settings.FakeDisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
+import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
@@ -65,6 +66,8 @@ public class SystemActionsTest extends SysuiTestCase {
@Mock
private ShadeController mShadeController;
@Mock
+ private ShadeViewController mShadeViewController;
+ @Mock
private Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
@Mock
private Optional<Recents> mRecentsOptional;
@@ -82,7 +85,8 @@ public class SystemActionsTest extends SysuiTestCase {
mContext.addMockSystemService(TelecomManager.class, mTelecomManager);
mContext.addMockSystemService(InputManager.class, mInputManager);
mSystemActions = new SystemActions(mContext, mUserTracker, mNotificationShadeController,
- mShadeController, mCentralSurfacesOptionalLazy, mRecentsOptional, mDisplayTracker);
+ mShadeController, () -> mShadeViewController, mCentralSurfacesOptionalLazy,
+ mRecentsOptional, mDisplayTracker);
}
@Test