std::optional<DisplayViewport> TouchInputMapper::findViewport() {
if (mParameters.associatedDisplayIsExternal) {
viewportTypeToUse = ViewportType::EXTERNAL;
//input port and display bind
std::string location=getDeviceContext().getDeviceIdentifier().location;
const char *USB_TP_INPUT_1="usb-fc840000.usb-1/input0";
const char *USB_TP_INPUT_2="usb-fc8c0000.usb-1/input0";
if(strcmp(USB_TP_INPUT_1,location.c_str())==0){
ALOGI("findViewport %d , locatioin %s, port = 1.",__LINE__, USB_TP_INPUT_1);
return mConfig.getDisplayViewportByPort(1);
}
else if(strcmp(USB_TP_INPUT_2,location.c_str())==0){
ALOGI("findViewport %d , locatioin %s, port = 2.",__LINE__, USB_TP_INPUT_2);
return mConfig.getDisplayViewportByPort(2);
}
else
{
ALOGI("findViewport %d , not find port. location %s.",__LINE__,location.c_str());
}
}
}