Add a WM API to query the touch region for the input method window

This is needed by VR to handle keyboards that display a window larger
than the interactable region

Bug: 62194867
Test: Manually with prints
Change-Id: I7288956ed8da8d24e7c46ffa8f27461f7abbca5e
This commit is contained in:
Albert Chaulk
2017-06-05 19:35:23 -04:00
parent 972bad878e
commit 56162a0a51
2 changed files with 17 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ import android.graphics.Bitmap;
import android.graphics.GraphicBuffer;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.Bundle;
import android.os.IRemoteCallback;
import android.os.ParcelFileDescriptor;
@@ -377,4 +378,9 @@ interface IWindowManager
* associated with that InputConsumer.
*/
boolean destroyInputConsumer(String name);
/**
* Return the touch region for the current IME window, or an empty region if there is none.
*/
Region getCurrentImeTouchRegion();
}

View File

@@ -6168,6 +6168,17 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
@Override
public Region getCurrentImeTouchRegion() {
synchronized (mWindowMap) {
final Region r = new Region();
if (mInputMethodWindow != null) {
mInputMethodWindow.getTouchableRegion(r);
}
return r;
}
}
@Override
public boolean hasNavigationBar() {
return mPolicy.hasNavigationBar();