blob: d396d11caa41748dc5daa976fb558fe6c3eb74c8 [file] [log] [blame]
Jeff Brown928e0542011-01-10 11:17:36 -08001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server;
18
19/**
20 * Functions as a handle for an application that can receive input.
21 * Enables the native input dispatcher to refer indirectly to the window manager's
22 * application window token.
23 * @hide
24 */
25public final class InputApplicationHandle {
26 // Pointer to the native input application handle.
27 // This field is lazily initialized via JNI.
28 @SuppressWarnings("unused")
29 private int ptr;
30
31 // The window manager's application window token.
32 public final WindowManagerService.AppWindowToken appWindowToken;
33
34 private native void nativeDispose();
35
36 public InputApplicationHandle(WindowManagerService.AppWindowToken appWindowToken) {
37 this.appWindowToken = appWindowToken;
38 }
39
40 @Override
41 protected void finalize() throws Throwable {
42 nativeDispose();
43 super.finalize();
44 }
45}