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 resized(int w, int h, Rect coveredInsets, Rect visibleInsets, boolean reportDraw, Configuration newConfig)36 public void resized(int w, int h, Rect coveredInsets, 37 Rect visibleInsets, boolean reportDraw, Configuration newConfig) { 38 if (reportDraw) { 39 try { 40 mSession.finishDrawing(this); 41 } catch (RemoteException e) { 42 } 43 } 44 } 45 dispatchAppVisibility(boolean visible)46 public void dispatchAppVisibility(boolean visible) { 47 } 48 dispatchGetNewSurface()49 public void dispatchGetNewSurface() { 50 } 51 windowFocusChanged(boolean hasFocus, boolean touchEnabled)52 public void windowFocusChanged(boolean hasFocus, boolean touchEnabled) { 53 } 54 executeCommand(String command, String parameters, ParcelFileDescriptor out)55 public void executeCommand(String command, String parameters, ParcelFileDescriptor out) { 56 } 57 closeSystemDialogs(String reason)58 public void closeSystemDialogs(String reason) { 59 } 60 dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync)61 public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) { 62 if (sync) { 63 try { 64 mSession.wallpaperOffsetsComplete(asBinder()); 65 } catch (RemoteException e) { 66 } 67 } 68 } 69 dispatchDragEvent(DragEvent event)70 public void dispatchDragEvent(DragEvent event) { 71 } 72 dispatchSystemUiVisibilityChanged(int seq, int globalUi, int localValue, int localChanges)73 public void dispatchSystemUiVisibilityChanged(int seq, int globalUi, 74 int localValue, int localChanges) { 75 mSeq = seq; 76 } 77 dispatchWallpaperCommand(String action, int x, int y, int z, Bundle extras, boolean sync)78 public void dispatchWallpaperCommand(String action, int x, int y, 79 int z, Bundle extras, boolean sync) { 80 if (sync) { 81 try { 82 mSession.wallpaperCommandComplete(asBinder(), null); 83 } catch (RemoteException e) { 84 } 85 } 86 } 87 } 88