Remove getShadeViewController calls
Bug: 288868098 Test: updated and ran affected test Change-Id: I5b10c8f05749afea3a1ca0b43b3f6cefd0aa71e0
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user