1/*
2 * Copyright (C) 2010 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.layoutlib.bridge.android;
18
19import android.content.ClipData;
20import android.content.res.Configuration;
21import android.graphics.Rect;
22import android.graphics.Region;
23import android.os.Bundle;
24import android.os.IBinder;
25import android.os.RemoteException;
26import android.view.IWindow;
27import android.view.IWindowSession;
28import android.view.InputChannel;
29import android.view.Surface;
30import android.view.SurfaceView;
31import android.view.WindowManager.LayoutParams;
32
33/**
34 * Implementation of {@link IWindowSession} so that mSession is not null in
35 * the {@link SurfaceView}.
36 */
37public final class BridgeWindowSession implements IWindowSession {
38
39    @Override
40    public int add(IWindow arg0, int seq, LayoutParams arg1, int arg2, Rect arg3,
41            InputChannel outInputchannel)
42            throws RemoteException {
43        // pass for now.
44        return 0;
45    }
46
47    @Override
48    public int addToDisplay(IWindow arg0, int seq, LayoutParams arg1, int arg2, int displayId,
49                            Rect arg3, InputChannel outInputchannel)
50            throws RemoteException {
51        // pass for now.
52        return 0;
53    }
54
55    @Override
56    public int addWithoutInputChannel(IWindow arg0, int seq, LayoutParams arg1, int arg2,
57                                      Rect arg3)
58            throws RemoteException {
59        // pass for now.
60        return 0;
61    }
62
63    @Override
64    public int addToDisplayWithoutInputChannel(IWindow arg0, int seq, LayoutParams arg1, int arg2,
65                                               int displayId, Rect arg3)
66            throws RemoteException {
67        // pass for now.
68        return 0;
69    }
70
71    @Override
72    public void finishDrawing(IWindow arg0) throws RemoteException {
73        // pass for now.
74    }
75
76    @Override
77    public boolean getInTouchMode() throws RemoteException {
78        // pass for now.
79        return false;
80    }
81
82    @Override
83    public boolean performHapticFeedback(IWindow window, int effectId, boolean always) {
84        // pass for now.
85        return false;
86    }
87    @Override
88    public int relayout(IWindow arg0, int seq, LayoutParams arg1, int arg2, int arg3, int arg4,
89            int arg4_5, Rect arg5, Rect arg6, Rect arg7, Configuration arg7b,
90            Surface arg8) throws RemoteException {
91        // pass for now.
92        return 0;
93    }
94
95    @Override
96    public void performDeferredDestroy(IWindow window) {
97        // pass for now.
98    }
99
100    @Override
101    public boolean outOfMemory(IWindow window) throws RemoteException {
102        return false;
103    }
104
105    @Override
106    public void getDisplayFrame(IWindow window, Rect outDisplayFrame) {
107        // pass for now.
108    }
109
110    @Override
111    public void remove(IWindow arg0) throws RemoteException {
112        // pass for now.
113    }
114
115    @Override
116    public void setInTouchMode(boolean arg0) throws RemoteException {
117        // pass for now.
118    }
119
120    @Override
121    public void setTransparentRegion(IWindow arg0, Region arg1) throws RemoteException {
122        // pass for now.
123    }
124
125    @Override
126    public void setInsets(IWindow window, int touchable, Rect contentInsets,
127            Rect visibleInsets, Region touchableRegion) {
128        // pass for now.
129    }
130
131    @Override
132    public IBinder prepareDrag(IWindow window, int flags,
133            int thumbnailWidth, int thumbnailHeight, Surface outSurface)
134            throws RemoteException {
135        // pass for now
136        return null;
137    }
138
139    @Override
140    public boolean performDrag(IWindow window, IBinder dragToken,
141            float touchX, float touchY, float thumbCenterX, float thumbCenterY,
142            ClipData data)
143            throws RemoteException {
144        // pass for now
145        return false;
146    }
147
148    @Override
149    public void reportDropResult(IWindow window, boolean consumed) throws RemoteException {
150        // pass for now
151    }
152
153    @Override
154    public void dragRecipientEntered(IWindow window) throws RemoteException {
155        // pass for now
156    }
157
158    @Override
159    public void dragRecipientExited(IWindow window) throws RemoteException {
160        // pass for now
161    }
162
163    @Override
164    public void setWallpaperPosition(IBinder window, float x, float y,
165        float xStep, float yStep) {
166        // pass for now.
167    }
168
169    @Override
170    public void wallpaperOffsetsComplete(IBinder window) {
171        // pass for now.
172    }
173
174    @Override
175    public Bundle sendWallpaperCommand(IBinder window, String action, int x, int y,
176            int z, Bundle extras, boolean sync) {
177        // pass for now.
178        return null;
179    }
180
181    @Override
182    public void wallpaperCommandComplete(IBinder window, Bundle result) {
183        // pass for now.
184    }
185
186    @Override
187    public void setUniverseTransform(IBinder window, float alpha, float offx, float offy,
188            float dsdx, float dtdx, float dsdy, float dtdy) {
189        // pass for now.
190    }
191
192    @Override
193    public IBinder asBinder() {
194        // pass for now.
195        return null;
196    }
197
198    @Override
199    public void onRectangleOnScreenRequested(IBinder window, Rect rectangle, boolean immediate) {
200        // pass for now.
201    }
202}
203