Add testcase for StylusPointer
add testcases for styluspointer
Test: atest inputflinger_tests
Bug: b/215436642
Change-Id: I898f2af2ba81ef4048281baf105fcbba6269ec47
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index 9b2cf02..b789156 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -3709,7 +3709,8 @@
const int32_t displayId = getAssociatedDisplayId().value_or(ADISPLAY_ID_NONE);
const bool showDirectStylusPointer = mConfig.stylusPointerIconEnabled &&
mDeviceMode == DeviceMode::DIRECT && isStylusEvent(source, action, pointerProperties) &&
- displayId != ADISPLAY_ID_NONE && displayId == mPointerController->getDisplayId();
+ mPointerController && displayId != ADISPLAY_ID_NONE &&
+ displayId == mPointerController->getDisplayId();
if (showDirectStylusPointer) {
switch (action & AMOTION_EVENT_ACTION_MASK) {
case AMOTION_EVENT_ACTION_HOVER_ENTER: