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.graphics.Rect; 21import android.graphics.Region; 22import android.os.Bundle; 23import android.os.IBinder; 24import android.os.RemoteException; 25import android.util.MergedConfiguration; 26import android.view.IWindow; 27import android.view.IWindowId; 28import android.view.IWindowSession; 29import android.view.InputChannel; 30import android.view.Surface; 31import android.view.SurfaceView; 32import android.view.WindowManager.LayoutParams; 33 34/** 35 * Implementation of {@link IWindowSession} so that mSession is not null in 36 * the {@link SurfaceView}. 37 */ 38public final class BridgeWindowSession implements IWindowSession { 39 40 @Override 41 public int add(IWindow arg0, int seq, LayoutParams arg1, int arg2, Rect arg3, Rect arg4, 42 InputChannel outInputchannel) 43 throws RemoteException { 44 // pass for now. 45 return 0; 46 } 47 48 @Override 49 public int addToDisplay(IWindow arg0, int seq, LayoutParams arg1, int arg2, int displayId, 50 Rect arg3, Rect arg4, Rect arg5, InputChannel outInputchannel) 51 throws RemoteException { 52 // pass for now. 53 return 0; 54 } 55 56 @Override 57 public int addWithoutInputChannel(IWindow arg0, int seq, LayoutParams arg1, int arg2, 58 Rect arg3, Rect arg4) 59 throws RemoteException { 60 // pass for now. 61 return 0; 62 } 63 64 @Override 65 public int addToDisplayWithoutInputChannel(IWindow arg0, int seq, LayoutParams arg1, int arg2, 66 int displayId, Rect arg3, Rect arg4) 67 throws RemoteException { 68 // pass for now. 69 return 0; 70 } 71 72 @Override 73 public void finishDrawing(IWindow arg0) throws RemoteException { 74 // pass for now. 75 } 76 77 @Override 78 public boolean getInTouchMode() throws RemoteException { 79 // pass for now. 80 return false; 81 } 82 83 @Override 84 public boolean performHapticFeedback(IWindow window, int effectId, boolean always) { 85 // pass for now. 86 return false; 87 } 88 89 @Override 90 public int relayout(IWindow iWindow, int i, LayoutParams layoutParams, int i2, 91 int i3, int i4, int i5, Rect rect, Rect rect2, Rect rect3, Rect rect4, Rect rect5, 92 Rect rect6, Rect rect7, MergedConfiguration mergedConfig, Surface surface) 93 throws RemoteException { 94 // pass for now. 95 return 0; 96 } 97 98 @Override 99 public boolean outOfMemory(IWindow window) throws RemoteException { 100 return false; 101 } 102 103 @Override 104 public void getDisplayFrame(IWindow window, Rect outDisplayFrame) { 105 // pass for now. 106 } 107 108 @Override 109 public void remove(IWindow arg0) throws RemoteException { 110 // pass for now. 111 } 112 113 @Override 114 public void setInTouchMode(boolean arg0) throws RemoteException { 115 // pass for now. 116 } 117 118 @Override 119 public void setTransparentRegion(IWindow arg0, Region arg1) throws RemoteException { 120 // pass for now. 121 } 122 123 @Override 124 public void setInsets(IWindow window, int touchable, Rect contentInsets, 125 Rect visibleInsets, Region touchableRegion) { 126 // pass for now. 127 } 128 129 @Override 130 public IBinder prepareDrag(IWindow window, int flags, 131 int thumbnailWidth, int thumbnailHeight, Surface outSurface) 132 throws RemoteException { 133 // pass for now 134 return null; 135 } 136 137 @Override 138 public boolean performDrag(IWindow window, IBinder dragToken, 139 int touchSource, float touchX, float touchY, float thumbCenterX, float thumbCenterY, 140 ClipData data) 141 throws RemoteException { 142 // pass for now 143 return false; 144 } 145 146 @Override 147 public boolean startMovingTask(IWindow window, float startX, float startY) 148 throws RemoteException { 149 // pass for now 150 return false; 151 } 152 153 @Override 154 public void reportDropResult(IWindow window, boolean consumed) throws RemoteException { 155 // pass for now 156 } 157 158 @Override 159 public void cancelDragAndDrop(IBinder dragToken) throws RemoteException { 160 // pass for now 161 } 162 163 @Override 164 public void dragRecipientEntered(IWindow window) throws RemoteException { 165 // pass for now 166 } 167 168 @Override 169 public void dragRecipientExited(IWindow window) throws RemoteException { 170 // pass for now 171 } 172 173 @Override 174 public void setWallpaperPosition(IBinder window, float x, float y, 175 float xStep, float yStep) { 176 // pass for now. 177 } 178 179 @Override 180 public void wallpaperOffsetsComplete(IBinder window) { 181 // pass for now. 182 } 183 184 @Override 185 public void setWallpaperDisplayOffset(IBinder windowToken, int x, int y) { 186 // pass for now. 187 } 188 189 @Override 190 public Bundle sendWallpaperCommand(IBinder window, String action, int x, int y, 191 int z, Bundle extras, boolean sync) { 192 // pass for now. 193 return null; 194 } 195 196 @Override 197 public void wallpaperCommandComplete(IBinder window, Bundle result) { 198 // pass for now. 199 } 200 201 @Override 202 public IBinder asBinder() { 203 // pass for now. 204 return null; 205 } 206 207 @Override 208 public void onRectangleOnScreenRequested(IBinder window, Rect rectangle) { 209 // pass for now. 210 } 211 212 @Override 213 public IWindowId getWindowId(IBinder window) throws RemoteException { 214 // pass for now. 215 return null; 216 } 217 218 @Override 219 public void pokeDrawLock(IBinder window) { 220 // pass for now. 221 } 222 223 @Override 224 public void prepareToReplaceWindows(IBinder appToken, boolean childrenOnly) { 225 // pass for now. 226 } 227 228 @Override 229 public void updatePointerIcon(IWindow window) { 230 // pass for now. 231 } 232} 233