RK3288实现TP双屏触摸

diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
old mode 100644
new mode 100755
index 4d70d5f..5325bd5
— a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -999,7 +999,7 @@ static const int32_t GAMEPAD_KEYCODES = {

status_t EventHub::openDeviceLocked(const char *devicePath) {
char buffer[80];

  • static int TouchDevDisplayID = 1;
    ALOGV(“Opening device: %s”, devicePath);

    int fd = open(devicePath, O_RDWR | O_CLOEXEC);
    @@ -1132,6 +1132,11 @@ status_t EventHub::openDeviceLocked(const char *devicePath) {
    // a touch screen.
    if (test_bit(BTN_TOUCH, device->keyBitmask) || !haveGamepadButtons) {
    device->classes |= INPUT_DEVICE_CLASS_TOUCH | INPUT_DEVICE_CLASS_TOUCH_MT;

  •        if(TouchDevDisplayID == 1){
    
  •            device->classes |= INPUT_DEVICE_CLASS_EXTERNAL;
    
  •            ALOGD(" %d  name:       \"%s\"\n",__LINE__, device->identifier.name.string());
    
  •            TouchDevDisplayID = 0;
    
  •        }
       }
    

    // Is this an old style single-touch driver?
    } else if (test_bit(BTN_TOUCH, device->keyBitmask)
    diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
    index 8d89fcb..b35e497 100755
    — a/services/input/InputDispatcher.cpp
    +++ b/services/input/InputDispatcher.cpp
    @@ -829,6 +829,7 @@ void InputDispatcher::logOutboundKeyDetailsLocked(const char* prefix, const KeyE
    bool InputDispatcher::dispatchMotionLocked(
    nsecs_t currentTime, MotionEntry* entry, DropReason* dropReason, nsecs_t* nextWakeupTime) {
    // Preprocessing.

  • if (! entry->dispatchInProgress) {
    entry->dispatchInProgress = true;

@@ -891,9 +892,9 @@ bool InputDispatcher::dispatchMotionLocked(
}

 // TODO: support sending secondary display events to input monitors
  • if (isMainDisplay(entry->displayId)) {
  • // if (isMainDisplay(entry->displayId)) {
    addMonitoringTargetsLocked(inputTargets);
  • }
  • // }

    // Dispatch the motion.
    if (conflictingPointerActions) {
    @@ -911,13 +912,13 @@ void InputDispatcher::logOutboundMotionDetailsLocked(const char* prefix, const M
    ALOGD("%seventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
    "action=0x%x, flags=0x%x, "
    "metaState=0x%x, buttonState=0x%x, "

  •        "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%lld",
    
  •        "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%lld,displayId = %d",
           prefix,
           entry->eventTime, entry->deviceId, entry->source, entry->policyFlags,
           entry->action, entry->flags,
           entry->metaState, entry->buttonState,
           entry->edgeFlags, entry->xPrecision, entry->yPrecision,
    
  •        entry->downTime);
    
  •        entry->downTime,entry->displayId);
    

    for (uint32_t i = 0; i < entry->pointerCount; i++) {
    ALOGD(" Pointer %d: id=%d, toolType=%d, "
    @@ -1141,8 +1142,8 @@ Unresponsive:
    injectionResult, timeSpentWaitingForApplication);
    #if DEBUG_FOCUS
    ALOGD("findFocusedWindow finished: injectionResult=%d, "

  •        "timeSpentWaitingForApplication=%0.1fms",
    
  •        injectionResult, timeSpentWaitingForApplication / 1000000.0);
    
  •        "timeSpentWaitingForApplication=%0.1fms,mFocusedWindowHandle->name = %s",
    
  •        injectionResult, timeSpentWaitingForApplication / 1000000.0,mFocusedWindowHandle->getName().string());
    

#endif
return injectionResult;
}
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp
old mode 100644
new mode 100755
diff --git a/services/java/com/android/server/input/InputWindowHandle.java b/services/java/com/android/server/input/InputWindowHandle.java
index 2903779..cee8733 100755
— a/services/java/com/android/server/input/InputWindowHandle.java
+++ b/services/java/com/android/server/input/InputWindowHandle.java
@@ -92,7 +92,8 @@ public final class InputWindowHandle {
public int inputFeatures;

 // Display this input is on.
  • public final int displayId;
  • //public final int displayId;

  • public int displayId;

    private native void nativeDispose();

diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index c587da0..529af5f 100755
— a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -13215,6 +13215,7 @@ if(mCurConfiguration.enableMultiWindow()){
if(mGroupId == groupId){
windows.remove(win);
win.mDisplayContent = secondDisplayContent;

  •                                              win.mInputWindowHandle.displayId = displayId;
      			if(win.mWinAnimator != null){
      				int layerStack = secondDisplayContent.getDisplay().getLayerStack();
      				if(win.mWinAnimator.mSurfaceControl!= null){
    

赞一个,有机会试试

佩服。先马后看。

楼主可以研究下双USB异触,I2c和USB异触