blob: dec88f0aaa1af63c169af09d3b2a2c8725193fa2 [file] [log] [blame]
Vishnu Naire6e2b0f2019-02-21 10:41:00 -08001/*
2 * Copyright (C) 2019 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
17package com.android.server.wm;
18
19import android.graphics.Matrix;
20import android.graphics.Rect;
21import android.graphics.Region;
22import android.os.IBinder;
23import android.os.Parcel;
24import android.view.InputWindowHandle;
25import android.view.Surface;
26import android.view.SurfaceControl;
27
28/**
29 * Stubbed {@link android.view.SurfaceControl.Transaction} class that can be used when unit
30 * testing to avoid calls to native code.
31 */
32public class StubTransaction extends SurfaceControl.Transaction {
33 @Override
34 public void apply() {
35 }
36
37 @Override
38 public void close() {
39 }
40
41 @Override
42 public void apply(boolean sync) {
43 }
44
45 @Override
46 public SurfaceControl.Transaction setVisibility(SurfaceControl sc, boolean visible) {
47 return this;
48 }
49
50 @Override
51 public SurfaceControl.Transaction show(SurfaceControl sc) {
52 return this;
53 }
54
55 @Override
56 public SurfaceControl.Transaction hide(SurfaceControl sc) {
57 return this;
58 }
59
60 @Override
61 public SurfaceControl.Transaction setPosition(SurfaceControl sc, float x, float y) {
62 return this;
63 }
64
65 @Override
66 public SurfaceControl.Transaction setBufferSize(SurfaceControl sc,
67 int w, int h) {
68 return this;
69 }
70
71 @Override
72 public SurfaceControl.Transaction setLayer(SurfaceControl sc, int z) {
73 return this;
74 }
75
76 @Override
77 public SurfaceControl.Transaction setRelativeLayer(SurfaceControl sc, SurfaceControl relativeTo,
78 int z) {
79 return this;
80 }
81
82 @Override
83 public SurfaceControl.Transaction setTransparentRegionHint(SurfaceControl sc,
84 Region transparentRegion) {
85 return this;
86 }
87
88 @Override
89 public SurfaceControl.Transaction setAlpha(SurfaceControl sc, float alpha) {
90 return this;
91 }
92
93 @Override
94 public SurfaceControl.Transaction setInputWindowInfo(SurfaceControl sc,
95 InputWindowHandle handle) {
96 return this;
97 }
98
99 @Override
100 public SurfaceControl.Transaction transferTouchFocus(IBinder fromToken, IBinder toToken) {
101 return this;
102 }
103
104 @Override
105 public SurfaceControl.Transaction setGeometry(SurfaceControl sc, Rect sourceCrop,
106 Rect destFrame, @Surface.Rotation int orientation) {
107 return this;
108 }
109
110 @Override
111 public SurfaceControl.Transaction setMatrix(SurfaceControl sc,
112 float dsdx, float dtdx, float dtdy, float dsdy) {
113 return this;
114 }
115
116 @Override
117 public SurfaceControl.Transaction setMatrix(SurfaceControl sc, Matrix matrix, float[] float9) {
118 return this;
119 }
120
121 @Override
122 public SurfaceControl.Transaction setColorTransform(SurfaceControl sc, float[] matrix,
123 float[] translation) {
124 return this;
125 }
126
127 @Override
128 public SurfaceControl.Transaction setWindowCrop(SurfaceControl sc, Rect crop) {
129 return this;
130 }
131
132 @Override
133 public SurfaceControl.Transaction setWindowCrop(SurfaceControl sc, int width, int height) {
134 return this;
135 }
136
137 @Override
138 public SurfaceControl.Transaction setCornerRadius(SurfaceControl sc, float cornerRadius) {
139 return this;
140 }
141
142 @Override
143 public SurfaceControl.Transaction setLayerStack(SurfaceControl sc, int layerStack) {
144 return this;
145 }
146
147 @Override
148 public SurfaceControl.Transaction deferTransactionUntil(SurfaceControl sc, IBinder handle,
149 long frameNumber) {
150 return this;
151 }
152
153 @Override
154 public SurfaceControl.Transaction deferTransactionUntilSurface(SurfaceControl sc,
155 Surface barrierSurface,
156 long frameNumber) {
157 return this;
158 }
159
160 @Override
161 public SurfaceControl.Transaction reparentChildren(SurfaceControl sc, IBinder newParentHandle) {
162 return this;
163 }
164
165 @Override
166 public SurfaceControl.Transaction reparent(SurfaceControl sc, SurfaceControl newParent) {
167 return this;
168 }
169
170 @Override
171 public SurfaceControl.Transaction detachChildren(SurfaceControl sc) {
172 return this;
173 }
174
175 @Override
176 public SurfaceControl.Transaction setOverrideScalingMode(SurfaceControl sc,
177 int overrideScalingMode) {
178 return this;
179 }
180
181 @Override
182 public SurfaceControl.Transaction setColor(SurfaceControl sc, float[] color) {
183 return this;
184 }
185
186 @Override
187 public SurfaceControl.Transaction setGeometryAppliesWithResize(SurfaceControl sc) {
188 return this;
189 }
190
191 @Override
192 public SurfaceControl.Transaction setSecure(SurfaceControl sc, boolean isSecure) {
193 return this;
194 }
195
196 @Override
197 public SurfaceControl.Transaction setOpaque(SurfaceControl sc, boolean isOpaque) {
198 return this;
199 }
200
201 @Override
202 public SurfaceControl.Transaction setDisplaySurface(IBinder displayToken, Surface surface) {
203 return this;
204 }
205
206 @Override
207 public SurfaceControl.Transaction setDisplayLayerStack(IBinder displayToken, int layerStack) {
208 return this;
209 }
210
211 @Override
212 public SurfaceControl.Transaction setDisplayProjection(IBinder displayToken,
213 int orientation, Rect layerStackRect, Rect displayRect) {
214 return this;
215 }
216
217 @Override
218 public SurfaceControl.Transaction setDisplaySize(IBinder displayToken, int width, int height) {
219 return this;
220 }
221
222 @Override
223 public SurfaceControl.Transaction setAnimationTransaction() {
224 return this;
225 }
226
227 @Override
228 public SurfaceControl.Transaction setEarlyWakeup() {
229 return this;
230 }
231
232 @Override
Evan Roskyb51e2462019-04-03 19:27:18 -0700233 public SurfaceControl.Transaction setMetadata(SurfaceControl sc, int key, int data) {
Vishnu Naire6e2b0f2019-02-21 10:41:00 -0800234 return this;
235 }
236
237 @Override
Evan Roskyb51e2462019-04-03 19:27:18 -0700238 public SurfaceControl.Transaction setMetadata(SurfaceControl sc, int key, Parcel data) {
Vishnu Naire6e2b0f2019-02-21 10:41:00 -0800239 return this;
240 }
241
242 @Override
243 public SurfaceControl.Transaction merge(SurfaceControl.Transaction other) {
244 return this;
245 }
246
247 @Override
248 public SurfaceControl.Transaction remove(SurfaceControl sc) {
249 return this;
250 }
251}