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