Remove getShadeViewController calls

Bug: 288868098
Test: updated and ran affected test
Change-Id: I5b10c8f05749afea3a1ca0b43b3f6cefd0aa71e0
This commit is contained in:
Justin Weir
2023-07-17 16:32:50 -04:00
parent 1fb1192d4b
commit 06db41a823
2 changed files with 5 additions and 9 deletions

View File

@@ -37,12 +37,15 @@ import javax.inject.Named;
*/
public class ShadeTouchHandler implements DreamTouchHandler {
private final Optional<CentralSurfaces> mSurfaces;
private final ShadeViewController mShadeViewController;
private final int mInitiationHeight;
@Inject
ShadeTouchHandler(Optional<CentralSurfaces> centralSurfaces,
ShadeViewController shadeViewController,
@Named(NOTIFICATION_SHADE_GESTURE_INITIATION_HEIGHT) int initiationHeight) {
mSurfaces = centralSurfaces;
mShadeViewController = shadeViewController;
mInitiationHeight = initiationHeight;
}
@@ -54,12 +57,7 @@ public class ShadeTouchHandler implements DreamTouchHandler {
}
session.registerInputListener(ev -> {
final ShadeViewController viewController =
mSurfaces.map(CentralSurfaces::getShadeViewController).orElse(null);
if (viewController != null) {
viewController.handleExternalTouch((MotionEvent) ev);
}
mShadeViewController.handleExternalTouch((MotionEvent) ev);
if (ev instanceof MotionEvent) {
if (((MotionEvent) ev).getAction() == MotionEvent.ACTION_UP) {

View File

@@ -61,10 +61,8 @@ public class ShadeTouchHandlerTest extends SysuiTestCase {
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces),
mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces), mShadeViewController,
TOUCH_HEIGHT);
when(mCentralSurfaces.getShadeViewController())
.thenReturn(mShadeViewController);
}
/**