Loading core/java/android/view/InputApplicationHandle.java +7 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.view; import android.annotation.NonNull; import android.os.IBinder; /** Loading @@ -31,17 +32,20 @@ public final class InputApplicationHandle { private long ptr; // Application name. public String name; public final @NonNull String name; // Dispatching timeout. public long dispatchingTimeoutNanos; public final long dispatchingTimeoutNanos; public final IBinder token; private native void nativeDispose(); public InputApplicationHandle(IBinder token) { public InputApplicationHandle(@NonNull IBinder token, @NonNull String name, long dispatchingTimeoutNanos) { this.token = token; this.name = name; this.dispatchingTimeoutNanos = dispatchingTimeoutNanos; } public InputApplicationHandle(InputApplicationHandle handle) { Loading core/java/android/view/InputWindowHandle.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public final class InputWindowHandle { private long ptr; // The input application handle. public final InputApplicationHandle inputApplicationHandle; public InputApplicationHandle inputApplicationHandle; // The token associates input data with a window and its input channel. The client input // channel and the server input channel will both contain this token. Loading core/jni/android_hardware_input_InputApplicationHandle.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,11 @@ bool NativeInputApplicationHandle::updateInfo() { if (!obj) { return false; } if (mInfo.token.get() != nullptr) { // The java fields are immutable, so it doesn't need to update again. env->DeleteLocalRef(obj); return true; } mInfo.name = getStringField(env, obj, gInputApplicationHandleClassInfo.name, "<null>"); Loading services/core/java/com/android/server/wm/ActivityRecord.java +16 −2 Original line number Diff line number Diff line Loading @@ -416,7 +416,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // mOccludesParent field. final boolean hasWallpaper; // Input application handle used by the input dispatcher. final InputApplicationHandle mInputApplicationHandle; private InputApplicationHandle mInputApplicationHandle; final int launchedFromPid; // always the pid who started the activity. final int launchedFromUid; // always the uid who started the activity. Loading Loading @@ -1501,7 +1501,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A info = aInfo; mUserId = UserHandle.getUserId(info.applicationInfo.uid); packageName = info.applicationInfo.packageName; mInputApplicationHandle = new InputApplicationHandle(appToken); intent = _intent; // If the class name in the intent doesn't match that of the target, this is probably an Loading Loading @@ -1685,6 +1684,21 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return lockTaskLaunchMode; } @NonNull InputApplicationHandle getInputApplicationHandle(boolean update) { if (mInputApplicationHandle == null) { mInputApplicationHandle = new InputApplicationHandle(appToken, toString(), mInputDispatchingTimeoutNanos); } else if (update) { final String name = toString(); if (mInputDispatchingTimeoutNanos != mInputApplicationHandle.dispatchingTimeoutNanos || !name.equals(mInputApplicationHandle.name)) { mInputApplicationHandle = new InputApplicationHandle(appToken, name, mInputDispatchingTimeoutNanos); } } return mInputApplicationHandle; } @Override ActivityRecord asActivityRecord() { // I am an activity record! Loading services/core/java/com/android/server/wm/DragState.java +2 −4 Original line number Diff line number Diff line Loading @@ -269,10 +269,8 @@ class DragState { mInputEventReceiver = new DragInputEventReceiver(mClientChannel, mService.mH.getLooper(), mDragDropController); mDragApplicationHandle = new InputApplicationHandle(new Binder()); mDragApplicationHandle.name = "drag"; mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; mDragApplicationHandle = new InputApplicationHandle(new Binder(), "drag", WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS); mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, display.getDisplayId()); Loading Loading
core/java/android/view/InputApplicationHandle.java +7 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.view; import android.annotation.NonNull; import android.os.IBinder; /** Loading @@ -31,17 +32,20 @@ public final class InputApplicationHandle { private long ptr; // Application name. public String name; public final @NonNull String name; // Dispatching timeout. public long dispatchingTimeoutNanos; public final long dispatchingTimeoutNanos; public final IBinder token; private native void nativeDispose(); public InputApplicationHandle(IBinder token) { public InputApplicationHandle(@NonNull IBinder token, @NonNull String name, long dispatchingTimeoutNanos) { this.token = token; this.name = name; this.dispatchingTimeoutNanos = dispatchingTimeoutNanos; } public InputApplicationHandle(InputApplicationHandle handle) { Loading
core/java/android/view/InputWindowHandle.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public final class InputWindowHandle { private long ptr; // The input application handle. public final InputApplicationHandle inputApplicationHandle; public InputApplicationHandle inputApplicationHandle; // The token associates input data with a window and its input channel. The client input // channel and the server input channel will both contain this token. Loading
core/jni/android_hardware_input_InputApplicationHandle.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,11 @@ bool NativeInputApplicationHandle::updateInfo() { if (!obj) { return false; } if (mInfo.token.get() != nullptr) { // The java fields are immutable, so it doesn't need to update again. env->DeleteLocalRef(obj); return true; } mInfo.name = getStringField(env, obj, gInputApplicationHandleClassInfo.name, "<null>"); Loading
services/core/java/com/android/server/wm/ActivityRecord.java +16 −2 Original line number Diff line number Diff line Loading @@ -416,7 +416,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // mOccludesParent field. final boolean hasWallpaper; // Input application handle used by the input dispatcher. final InputApplicationHandle mInputApplicationHandle; private InputApplicationHandle mInputApplicationHandle; final int launchedFromPid; // always the pid who started the activity. final int launchedFromUid; // always the uid who started the activity. Loading Loading @@ -1501,7 +1501,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A info = aInfo; mUserId = UserHandle.getUserId(info.applicationInfo.uid); packageName = info.applicationInfo.packageName; mInputApplicationHandle = new InputApplicationHandle(appToken); intent = _intent; // If the class name in the intent doesn't match that of the target, this is probably an Loading Loading @@ -1685,6 +1684,21 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return lockTaskLaunchMode; } @NonNull InputApplicationHandle getInputApplicationHandle(boolean update) { if (mInputApplicationHandle == null) { mInputApplicationHandle = new InputApplicationHandle(appToken, toString(), mInputDispatchingTimeoutNanos); } else if (update) { final String name = toString(); if (mInputDispatchingTimeoutNanos != mInputApplicationHandle.dispatchingTimeoutNanos || !name.equals(mInputApplicationHandle.name)) { mInputApplicationHandle = new InputApplicationHandle(appToken, name, mInputDispatchingTimeoutNanos); } } return mInputApplicationHandle; } @Override ActivityRecord asActivityRecord() { // I am an activity record! Loading
services/core/java/com/android/server/wm/DragState.java +2 −4 Original line number Diff line number Diff line Loading @@ -269,10 +269,8 @@ class DragState { mInputEventReceiver = new DragInputEventReceiver(mClientChannel, mService.mH.getLooper(), mDragDropController); mDragApplicationHandle = new InputApplicationHandle(new Binder()); mDragApplicationHandle.name = "drag"; mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; mDragApplicationHandle = new InputApplicationHandle(new Binder(), "drag", WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS); mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, display.getDisplayId()); Loading