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