Home | History | Annotate | Download | only in android
      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 
     17 package com.android.layoutlib.bridge.android;
     18 
     19 import android.content.ClipData;
     20 import android.content.res.Configuration;
     21 import android.graphics.Rect;
     22 import android.graphics.Region;
     23 import android.os.Bundle;
     24 import android.os.IBinder;
     25 import android.os.RemoteException;
     26 import android.view.IWindow;
     27 import android.view.IWindowId;
     28 import android.view.IWindowSession;
     29 import android.view.InputChannel;
     30 import android.view.Surface;
     31 import android.view.SurfaceView;
     32 import android.view.WindowManager.LayoutParams;
     33 
     34 /**
     35  * Implementation of {@link IWindowSession} so that mSession is not null in
     36  * the {@link SurfaceView}.
     37  */
     38 public final class BridgeWindowSession implements IWindowSession {
     39 
     40     @Override
     41     public int add(IWindow arg0, int seq, LayoutParams arg1, int arg2, Rect arg3,
     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, 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)
     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)
     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     @Override
     89     public int relayout(IWindow arg0, int seq, LayoutParams arg1, int arg2, int arg3, int arg4,
     90             int arg4_5, Rect arg5Z, Rect arg5, Rect arg6, Rect arg7, Configuration arg7b,
     91             Surface arg8) throws RemoteException {
     92         // pass for now.
     93         return 0;
     94     }
     95 
     96     @Override
     97     public void performDeferredDestroy(IWindow window) {
     98         // pass for now.
     99     }
    100 
    101     @Override
    102     public boolean outOfMemory(IWindow window) throws RemoteException {
    103         return false;
    104     }
    105 
    106     @Override
    107     public void getDisplayFrame(IWindow window, Rect outDisplayFrame) {
    108         // pass for now.
    109     }
    110 
    111     @Override
    112     public void remove(IWindow arg0) throws RemoteException {
    113         // pass for now.
    114     }
    115 
    116     @Override
    117     public void setInTouchMode(boolean arg0) throws RemoteException {
    118         // pass for now.
    119     }
    120 
    121     @Override
    122     public void setTransparentRegion(IWindow arg0, Region arg1) throws RemoteException {
    123         // pass for now.
    124     }
    125 
    126     @Override
    127     public void setInsets(IWindow window, int touchable, Rect contentInsets,
    128             Rect visibleInsets, Region touchableRegion) {
    129         // pass for now.
    130     }
    131 
    132     @Override
    133     public IBinder prepareDrag(IWindow window, int flags,
    134             int thumbnailWidth, int thumbnailHeight, Surface outSurface)
    135             throws RemoteException {
    136         // pass for now
    137         return null;
    138     }
    139 
    140     @Override
    141     public boolean performDrag(IWindow window, IBinder dragToken,
    142             float touchX, float touchY, float thumbCenterX, float thumbCenterY,
    143             ClipData data)
    144             throws RemoteException {
    145         // pass for now
    146         return false;
    147     }
    148 
    149     @Override
    150     public void reportDropResult(IWindow window, boolean consumed) throws RemoteException {
    151         // pass for now
    152     }
    153 
    154     @Override
    155     public void dragRecipientEntered(IWindow window) throws RemoteException {
    156         // pass for now
    157     }
    158 
    159     @Override
    160     public void dragRecipientExited(IWindow window) throws RemoteException {
    161         // pass for now
    162     }
    163 
    164     @Override
    165     public void setWallpaperPosition(IBinder window, float x, float y,
    166         float xStep, float yStep) {
    167         // pass for now.
    168     }
    169 
    170     @Override
    171     public void wallpaperOffsetsComplete(IBinder window) {
    172         // pass for now.
    173     }
    174 
    175     @Override
    176     public Bundle sendWallpaperCommand(IBinder window, String action, int x, int y,
    177             int z, Bundle extras, boolean sync) {
    178         // pass for now.
    179         return null;
    180     }
    181 
    182     @Override
    183     public void wallpaperCommandComplete(IBinder window, Bundle result) {
    184         // pass for now.
    185     }
    186 
    187     @Override
    188     public void setUniverseTransform(IBinder window, float alpha, float offx, float offy,
    189             float dsdx, float dtdx, float dsdy, float dtdy) {
    190         // pass for now.
    191     }
    192 
    193     @Override
    194     public IBinder asBinder() {
    195         // pass for now.
    196         return null;
    197     }
    198 
    199     @Override
    200     public void onRectangleOnScreenRequested(IBinder window, Rect rectangle, boolean immediate) {
    201         // pass for now.
    202     }
    203 
    204     @Override
    205     public IWindowId getWindowId(IBinder window) throws RemoteException {
    206         // pass for now.
    207         return null;
    208     }
    209 }
    210