diff options
| author | Albert Chaulk <achaulk@google.com> | 2017-06-20 14:39:29 -0400 |
|---|---|---|
| committer | Albert Chaulk <achaulk@google.com> | 2017-06-29 13:44:19 -0400 |
| commit | 2ccb0b72e385d23e1e8c2aafa8b48c328e6f847d (patch) | |
| tree | 38998e9d257705e9b550c40d538b403e48914722 /core/java/android/view/WindowManager.java | |
| parent | d20db5a0bd7f6560656f0da8637592143278e44d (diff) | |
Add getCurrentImeTouchRegion to the WindowManager API
This is a followup to ag/2370980/ to expose the API more
externally as a WindowManager API. This allows application
access without needing to reflect on IWindowManager.Stub.
We require this to get the current IME touch region to
display it properly in VR contexts.
Test: Manual
Bug: 62194867
Change-Id: Ibbf336e1e473b65d4c76a1492da187d50cfda424
Diffstat (limited to 'core/java/android/view/WindowManager.java')
| -rw-r--r-- | core/java/android/view/WindowManager.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 4c0a1902d6a4..48f3973e87fe 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -18,6 +18,7 @@ package android.view; import android.annotation.IntDef; import android.annotation.NonNull; +import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; @@ -27,6 +28,7 @@ import android.content.Context; import android.content.pm.ActivityInfo; import android.graphics.PixelFormat; import android.graphics.Rect; +import android.graphics.Region; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; @@ -169,6 +171,18 @@ public interface WindowManager extends ViewManager { */ public void requestAppKeyboardShortcuts(final KeyboardShortcutsReceiver receiver, int deviceId); + /** + * Return the touch region for the current IME window, or an empty region if there is none. + * + * @return The region of the IME that is accepting touch inputs, or null if there is no IME, no + * region or there was an error. + * + * @hide + */ + @SystemApi + @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) + public Region getCurrentImeTouchRegion(); + public static class LayoutParams extends ViewGroup.LayoutParams implements Parcelable { /** * X position for this window. With the default gravity it is ignored. |
