1 /* 2 * Copyright (C) 2016 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.server.wm; 18 19 import android.os.Bundle; 20 import android.os.ParcelFileDescriptor; 21 import android.os.RemoteException; 22 import android.util.MergedConfiguration; 23 import android.view.DragEvent; 24 import android.view.IScrollCaptureResponseListener; 25 import android.view.IWindow; 26 import android.view.InsetsSourceControl; 27 import android.view.InsetsState; 28 import android.view.ScrollCaptureResponse; 29 import android.window.ClientWindowFrames; 30 31 import com.android.internal.os.IResultReceiver; 32 33 import java.util.ArrayList; 34 35 public class TestIWindow extends IWindow.Stub { 36 37 private ArrayList<DragEvent> mDragEvents; 38 39 @Override executeCommand(String command, String parameters, ParcelFileDescriptor descriptor)40 public void executeCommand(String command, String parameters, 41 ParcelFileDescriptor descriptor) throws RemoteException { 42 } 43 44 @Override resized(ClientWindowFrames frames, boolean reportDraw, MergedConfiguration mergedConfig, InsetsState insetsState, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode)45 public void resized(ClientWindowFrames frames, boolean reportDraw, 46 MergedConfiguration mergedConfig, InsetsState insetsState, boolean forceLayout, 47 boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode) 48 throws RemoteException { 49 } 50 51 @Override insetsControlChanged(InsetsState insetsState, InsetsSourceControl[] activeControls)52 public void insetsControlChanged(InsetsState insetsState, 53 InsetsSourceControl[] activeControls) { 54 } 55 56 @Override moved(int newX, int newY)57 public void moved(int newX, int newY) throws RemoteException { 58 } 59 60 @Override dispatchAppVisibility(boolean visible)61 public void dispatchAppVisibility(boolean visible) throws RemoteException { 62 } 63 64 @Override dispatchGetNewSurface()65 public void dispatchGetNewSurface() throws RemoteException { 66 } 67 68 @Override closeSystemDialogs(String reason)69 public void closeSystemDialogs(String reason) throws RemoteException { 70 } 71 72 @Override dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, float zoom, boolean sync)73 public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, float zoom, 74 boolean sync) 75 throws RemoteException { 76 } 77 78 @Override dispatchWallpaperCommand(String action, int x, int y, int z, Bundle extras, boolean sync)79 public void dispatchWallpaperCommand(String action, int x, int y, int z, Bundle extras, 80 boolean sync) throws RemoteException { 81 } 82 setDragEventJournal(ArrayList<DragEvent> journal)83 public void setDragEventJournal(ArrayList<DragEvent> journal) { 84 mDragEvents = journal; 85 } 86 87 @Override dispatchDragEvent(DragEvent event)88 public void dispatchDragEvent(DragEvent event) throws RemoteException { 89 if (mDragEvents != null) { 90 mDragEvents.add(DragEvent.obtain(event)); 91 } 92 } 93 94 @Override updatePointerIcon(float x, float y)95 public void updatePointerIcon(float x, float y) throws RemoteException { 96 } 97 98 @Override dispatchWindowShown()99 public void dispatchWindowShown() throws RemoteException { 100 } 101 102 @Override requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId)103 public void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId) 104 throws RemoteException { 105 } 106 107 @Override requestScrollCapture(IScrollCaptureResponseListener listener)108 public void requestScrollCapture(IScrollCaptureResponseListener listener) 109 throws RemoteException { 110 try { 111 listener.onScrollCaptureResponse( 112 new ScrollCaptureResponse.Builder().setDescription("Not Implemented").build()); 113 114 } catch (RemoteException ex) { 115 // ignore 116 } 117 } 118 119 @Override showInsets(int types, boolean fromIme)120 public void showInsets(int types, boolean fromIme) throws RemoteException { 121 } 122 123 @Override hideInsets(int types, boolean fromIme)124 public void hideInsets(int types, boolean fromIme) throws RemoteException { 125 } 126 } 127