summaryrefslogtreecommitdiff
path: root/core/java/android/view/WindowlessViewRoot.java
diff options
context:
space:
mode:
authorVishnu Nair <vishnun@google.com>2019-11-07 15:33:20 -0800
committerVishnu Nair <vishnun@google.com>2019-11-07 15:54:27 -0800
commit5cf25319775616f88d59768bd9dd0753afd0359f (patch)
tree68482078dd710dab7c5f07a6ec9d9c56cabb8f74 /core/java/android/view/WindowlessViewRoot.java
parentf8a289110576dcff9c7486d8e4f80a85d9786f23 (diff)
Update input policy to handle embedded windows
ANR - If embedded windows are slow in handling inputs the system should blame the embedded app. PointerDownOutsideFocus - if a user taps outside the currently focused window onto an embedded window, treat it as if the host window was tapped. Rename blessInputSurface -> grantInputChannel and add a name to embedded windows. Bug: 134365580 Test: b WindowlessWmTest Test: atest CtsWindowManagerDeviceTestCases:WindowlessWmTests Change-Id: If88970cf6ce17669b41fec995535151a492fab12
Diffstat (limited to 'core/java/android/view/WindowlessViewRoot.java')
-rw-r--r--core/java/android/view/WindowlessViewRoot.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/core/java/android/view/WindowlessViewRoot.java b/core/java/android/view/WindowlessViewRoot.java
index c2500b89073e..addf8e242e3d 100644
--- a/core/java/android/view/WindowlessViewRoot.java
+++ b/core/java/android/view/WindowlessViewRoot.java
@@ -16,12 +16,11 @@
package android.view;
-import android.content.res.Resources;
-import android.content.Context;
-import android.view.SurfaceControl;
-import android.view.View;
-
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.TestApi;
+import android.content.Context;
+import android.os.IBinder;
/**
* Utility class for adding a view hierarchy to a SurfaceControl.
@@ -31,10 +30,13 @@ import android.annotation.TestApi;
*/
@TestApi
public class WindowlessViewRoot {
- ViewRootImpl mViewRoot;
- WindowlessWindowManager mWm;
- public WindowlessViewRoot(Context c, Display d, SurfaceControl rootSurface) {
- mWm = new WindowlessWindowManager(c.getResources().getConfiguration(), rootSurface);
+ private ViewRootImpl mViewRoot;
+ private WindowlessWindowManager mWm;
+ public WindowlessViewRoot(@NonNull Context c, @NonNull Display d,
+ @NonNull SurfaceControl rootSurface,
+ @Nullable IBinder hostInputToken) {
+ mWm = new WindowlessWindowManager(c.getResources().getConfiguration(), rootSurface,
+ hostInputToken);
mViewRoot = new ViewRootImpl(c, d, mWm);
}
@@ -49,4 +51,8 @@ public class WindowlessViewRoot {
t.apply();
});
}
+
+ public void dispose() {
+ mViewRoot.dispatchDetachedFromWindow();
+ }
}