BaseIWindow.java revision a53146c5569f8ff5f7eb55e9ad35d23ddacf2add
1/*
2 * Copyright (C) 2009 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.internal.view;
18
19import android.content.ClipData;
20import android.content.ClipDescription;
21import android.content.res.Configuration;
22import android.graphics.Rect;
23import android.os.Bundle;
24import android.os.ParcelFileDescriptor;
25import android.os.RemoteException;
26import android.view.DragEvent;
27import android.view.IWindow;
28import android.view.IWindowSession;
29import android.view.KeyEvent;
30import android.view.MotionEvent;
31
32public class BaseIWindow extends IWindow.Stub {
33    private IWindowSession mSession;
34
35    public void setSession(IWindowSession session) {
36        mSession = session;
37    }
38
39    public void resized(int w, int h, Rect coveredInsets,
40            Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
41        if (reportDraw) {
42            try {
43                mSession.finishDrawing(this);
44            } catch (RemoteException e) {
45            }
46        }
47    }
48
49    public void dispatchAppVisibility(boolean visible) {
50    }
51
52    public void dispatchGetNewSurface() {
53    }
54
55    public void windowFocusChanged(boolean hasFocus, boolean touchEnabled) {
56    }
57
58    public void executeCommand(String command, String parameters, ParcelFileDescriptor out) {
59    }
60
61    public void closeSystemDialogs(String reason) {
62    }
63
64    public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) {
65        if (sync) {
66            try {
67                mSession.wallpaperOffsetsComplete(asBinder());
68            } catch (RemoteException e) {
69            }
70        }
71    }
72
73    public void dispatchDragEvent(DragEvent event) {
74    }
75
76    public void dispatchWallpaperCommand(String action, int x, int y,
77            int z, Bundle extras, boolean sync) {
78        if (sync) {
79            try {
80                mSession.wallpaperCommandComplete(asBinder(), null);
81            } catch (RemoteException e) {
82            }
83        }
84    }
85}
86