[go: nahoru, domu]

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.res.Configuration;
20import android.graphics.Rect;
21import android.os.Bundle;
22import android.os.ParcelFileDescriptor;
23import android.os.RemoteException;
24import android.view.DragEvent;
25import android.view.IWindow;
26import android.view.IWindowSession;
27
28import com.android.internal.os.IResultReceiver;
29
30public class BaseIWindow extends IWindow.Stub {
31    private IWindowSession mSession;
32    public int mSeq;
33
34    public void setSession(IWindowSession session) {
35        mSession = session;
36    }
37
38    @Override
39    public void resized(Rect frame, Rect overscanInsets, Rect contentInsets, Rect visibleInsets,
40            Rect stableInsets, Rect outsets, boolean reportDraw, Configuration newConfig,
41            Rect backDropFrame, boolean forceLayout, boolean alwaysConsumeNavBar) {
42        if (reportDraw) {
43            try {
44                mSession.finishDrawing(this);
45            } catch (RemoteException e) {
46            }
47        }
48    }
49
50    @Override
51    public void moved(int newX, int newY) {
52    }
53
54    @Override
55    public void dispatchAppVisibility(boolean visible) {
56    }
57
58    @Override
59    public void dispatchGetNewSurface() {
60    }
61
62    @Override
63    public void windowFocusChanged(boolean hasFocus, boolean touchEnabled) {
64    }
65
66    @Override
67    public void executeCommand(String command, String parameters, ParcelFileDescriptor out) {
68    }
69
70    @Override
71    public void closeSystemDialogs(String reason) {
72    }
73
74    @Override
75    public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) {
76        if (sync) {
77            try {
78                mSession.wallpaperOffsetsComplete(asBinder());
79            } catch (RemoteException e) {
80            }
81        }
82    }
83
84    @Override
85    public void dispatchDragEvent(DragEvent event) {
86    }
87
88    @Override
89    public void updatePointerIcon(float x, float y) {
90    }
91
92    @Override
93    public void dispatchSystemUiVisibilityChanged(int seq, int globalUi,
94            int localValue, int localChanges) {
95        mSeq = seq;
96    }
97
98    @Override
99    public void dispatchWallpaperCommand(String action, int x, int y,
100            int z, Bundle extras, boolean sync) {
101        if (sync) {
102            try {
103                mSession.wallpaperCommandComplete(asBinder(), null);
104            } catch (RemoteException e) {
105            }
106        }
107    }
108
109    @Override
110    public void dispatchWindowShown() {
111    }
112
113    @Override
114    public void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId) {
115    }
116}
117