blob: f77eeb246c88d339bd6cbbc3d29001b82c62a45c [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2007 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// tag as surfaceflinger
18#define LOG_TAG "SurfaceFlinger"
19
20#include <stdint.h>
21#include <sys/types.h>
22
Mathias Agopianc5b2c0b2009-05-19 19:08:10 -070023#include <binder/Parcel.h>
Mathias Agopianc5b2c0b2009-05-19 19:08:10 -070024#include <binder/IPCThreadState.h>
25#include <binder/IServiceManager.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080026
Mathias Agopiand0566bc2011-11-17 17:49:17 -080027#include <gui/IDisplayEventConnection.h>
Andy McFadden2adaf042012-12-18 09:49:45 -080028#include <gui/IGraphicBufferProducer.h>
Dan Stoza84ab9372018-12-17 15:27:57 -080029#include <gui/IRegionSamplingListener.h>
Mathias Agopian2b5dd402017-02-07 17:36:19 -080030#include <gui/ISurfaceComposer.h>
31#include <gui/ISurfaceComposerClient.h>
Kalle Raitaa099a242017-01-11 11:17:29 -080032#include <gui/LayerDebugInfo.h>
Robert Carr4cdc58f2017-08-23 14:22:20 -070033#include <gui/LayerState.h>
Mathias Agopiand0566bc2011-11-17 17:49:17 -080034
Michael Wright28f24d02016-07-12 13:30:53 -070035#include <system/graphics.h>
36
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080037#include <ui/DisplayInfo.h>
Lajos Molnar67d8bd62014-09-11 14:58:45 -070038#include <ui/DisplayStatInfo.h>
Dan Stozac4f471e2016-03-24 09:31:08 -070039#include <ui/HdrCapabilities.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080040
Jamie Gennis134f0422011-03-08 12:18:54 -080041#include <utils/Log.h>
Mathias Agopian9cce3252010-02-09 17:46:37 -080042
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080043// ---------------------------------------------------------------------------
44
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080045namespace android {
46
Peiyong Lin9f034472018-03-28 15:29:00 -070047using ui::ColorMode;
48
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080049class BpSurfaceComposer : public BpInterface<ISurfaceComposer>
50{
51public:
Chih-Hung Hsiehe2347b72016-04-25 15:41:05 -070052 explicit BpSurfaceComposer(const sp<IBinder>& impl)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080053 : BpInterface<ISurfaceComposer>(impl)
54 {
55 }
56
Dan Stozad723bd72014-11-18 10:24:03 -080057 virtual ~BpSurfaceComposer();
58
Mathias Agopian7e27f052010-05-28 14:22:23 -070059 virtual sp<ISurfaceComposerClient> createConnection()
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080060 {
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080061 Parcel data, reply;
62 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
63 remote()->transact(BnSurfaceComposer::CREATE_CONNECTION, data, &reply);
Mathias Agopian7e27f052010-05-28 14:22:23 -070064 return interface_cast<ISurfaceComposerClient>(reply.readStrongBinder());
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080065 }
66
Marissa Wall713b63f2018-10-17 15:42:43 -070067 virtual void setTransactionState(const Vector<ComposerState>& state,
68 const Vector<DisplayState>& displays, uint32_t flags,
chaviw273171b2018-12-26 11:46:30 -080069 const sp<IBinder>& applyToken,
Marissa Wall17b4e452018-12-26 16:32:34 -080070 const InputWindowCommands& commands,
71 int64_t desiredPresentTime) {
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080072 Parcel data, reply;
73 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
Dan Stozad723bd72014-11-18 10:24:03 -080074
75 data.writeUint32(static_cast<uint32_t>(state.size()));
76 for (const auto& s : state) {
77 s.write(data);
Mathias Agopian698c0872011-06-28 19:09:31 -070078 }
Dan Stozad723bd72014-11-18 10:24:03 -080079
80 data.writeUint32(static_cast<uint32_t>(displays.size()));
81 for (const auto& d : displays) {
82 d.write(data);
Mathias Agopian8b33f032012-07-24 20:43:54 -070083 }
Dan Stozad723bd72014-11-18 10:24:03 -080084
85 data.writeUint32(flags);
Marissa Wall713b63f2018-10-17 15:42:43 -070086 data.writeStrongBinder(applyToken);
chaviw273171b2018-12-26 11:46:30 -080087 commands.write(data);
Marissa Wall17b4e452018-12-26 16:32:34 -080088 data.writeInt64(desiredPresentTime);
Jamie Gennisb8d69a52011-10-10 15:48:06 -070089 remote()->transact(BnSurfaceComposer::SET_TRANSACTION_STATE, data, &reply);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080090 }
91
92 virtual void bootFinished()
93 {
94 Parcel data, reply;
95 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
96 remote()->transact(BnSurfaceComposer::BOOT_FINISHED, data, &reply);
97 }
98
Chavi Weingarten40482ff2017-11-30 01:51:40 +000099 virtual status_t captureScreen(const sp<IBinder>& display, sp<GraphicBuffer>* outBuffer,
Peiyong Lin0e003c92018-09-17 11:09:51 -0700100 const ui::Dataspace reqDataspace,
101 const ui::PixelFormat reqPixelFormat, Rect sourceCrop,
102 uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform,
103 ISurfaceComposer::Rotation rotation) {
Mathias Agopian2a9fc492013-03-01 13:42:57 -0800104 Parcel data, reply;
105 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
106 data.writeStrongBinder(display);
Peiyong Lin0e003c92018-09-17 11:09:51 -0700107 data.writeInt32(static_cast<int32_t>(reqDataspace));
108 data.writeInt32(static_cast<int32_t>(reqPixelFormat));
Dan Stozac1879002014-05-22 15:59:05 -0700109 data.write(sourceCrop);
Dan Stozad723bd72014-11-18 10:24:03 -0800110 data.writeUint32(reqWidth);
111 data.writeUint32(reqHeight);
Dan Stozac7014012014-02-14 15:03:43 -0800112 data.writeInt32(static_cast<int32_t>(useIdentityTransform));
Riley Andrewsc3ebe662014-09-04 16:20:31 -0700113 data.writeInt32(static_cast<int32_t>(rotation));
Ana Krulec2d41e422018-07-26 12:07:43 -0700114 status_t result = remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN, data, &reply);
115 if (result != NO_ERROR) {
116 ALOGE("captureScreen failed to transact: %d", result);
117 return result;
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000118 }
Ana Krulec2d41e422018-07-26 12:07:43 -0700119 result = reply.readInt32();
120 if (result != NO_ERROR) {
121 ALOGE("captureScreen failed to readInt32: %d", result);
122 return result;
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000123 }
124
125 *outBuffer = new GraphicBuffer();
126 reply.read(**outBuffer);
Peiyong Lin0e003c92018-09-17 11:09:51 -0700127
Ana Krulec2d41e422018-07-26 12:07:43 -0700128 return result;
Mathias Agopian2a9fc492013-03-01 13:42:57 -0800129 }
130
chaviwa76b2712017-09-20 12:02:26 -0700131 virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder,
Peiyong Lin0e003c92018-09-17 11:09:51 -0700132 sp<GraphicBuffer>* outBuffer, const ui::Dataspace reqDataspace,
133 const ui::PixelFormat reqPixelFormat, const Rect& sourceCrop,
Robert Carr578038f2018-03-09 12:25:24 -0800134 float frameScale, bool childrenOnly) {
chaviwa76b2712017-09-20 12:02:26 -0700135 Parcel data, reply;
136 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
137 data.writeStrongBinder(layerHandleBinder);
Peiyong Lin0e003c92018-09-17 11:09:51 -0700138 data.writeInt32(static_cast<int32_t>(reqDataspace));
139 data.writeInt32(static_cast<int32_t>(reqPixelFormat));
chaviw7206d492017-11-10 16:16:12 -0800140 data.write(sourceCrop);
141 data.writeFloat(frameScale);
Robert Carr578038f2018-03-09 12:25:24 -0800142 data.writeBool(childrenOnly);
Ana Krulec2d41e422018-07-26 12:07:43 -0700143 status_t result = remote()->transact(BnSurfaceComposer::CAPTURE_LAYERS, data, &reply);
144 if (result != NO_ERROR) {
145 ALOGE("captureLayers failed to transact: %d", result);
146 return result;
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000147 }
Ana Krulec2d41e422018-07-26 12:07:43 -0700148 result = reply.readInt32();
149 if (result != NO_ERROR) {
150 ALOGE("captureLayers failed to readInt32: %d", result);
151 return result;
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000152 }
Peiyong Lin0e003c92018-09-17 11:09:51 -0700153
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000154 *outBuffer = new GraphicBuffer();
155 reply.read(**outBuffer);
156
Ana Krulec2d41e422018-07-26 12:07:43 -0700157 return result;
chaviwa76b2712017-09-20 12:02:26 -0700158 }
159
Jamie Gennis582270d2011-08-17 18:19:00 -0700160 virtual bool authenticateSurfaceTexture(
Andy McFadden2adaf042012-12-18 09:49:45 -0800161 const sp<IGraphicBufferProducer>& bufferProducer) const
Jamie Gennis134f0422011-03-08 12:18:54 -0800162 {
163 Parcel data, reply;
164 int err = NO_ERROR;
165 err = data.writeInterfaceToken(
166 ISurfaceComposer::getInterfaceDescriptor());
167 if (err != NO_ERROR) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000168 ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing "
Jamie Gennis134f0422011-03-08 12:18:54 -0800169 "interface descriptor: %s (%d)", strerror(-err), -err);
170 return false;
171 }
Marco Nelissen2ea926b2014-11-14 08:01:01 -0800172 err = data.writeStrongBinder(IInterface::asBinder(bufferProducer));
Jamie Gennis134f0422011-03-08 12:18:54 -0800173 if (err != NO_ERROR) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000174 ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing "
Jamie Gennis582270d2011-08-17 18:19:00 -0700175 "strong binder to parcel: %s (%d)", strerror(-err), -err);
Jamie Gennis134f0422011-03-08 12:18:54 -0800176 return false;
177 }
178 err = remote()->transact(BnSurfaceComposer::AUTHENTICATE_SURFACE, data,
179 &reply);
180 if (err != NO_ERROR) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000181 ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error "
Jamie Gennis582270d2011-08-17 18:19:00 -0700182 "performing transaction: %s (%d)", strerror(-err), -err);
Jamie Gennis134f0422011-03-08 12:18:54 -0800183 return false;
184 }
185 int32_t result = 0;
186 err = reply.readInt32(&result);
187 if (err != NO_ERROR) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000188 ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error "
Jamie Gennis582270d2011-08-17 18:19:00 -0700189 "retrieving result: %s (%d)", strerror(-err), -err);
Jamie Gennis134f0422011-03-08 12:18:54 -0800190 return false;
191 }
192 return result != 0;
193 }
Mathias Agopiand0566bc2011-11-17 17:49:17 -0800194
Brian Anderson6b376712017-04-04 10:51:39 -0700195 virtual status_t getSupportedFrameTimestamps(
196 std::vector<FrameEvent>* outSupported) const {
197 if (!outSupported) {
198 return UNEXPECTED_NULL;
199 }
200 outSupported->clear();
201
202 Parcel data, reply;
203
204 status_t err = data.writeInterfaceToken(
205 ISurfaceComposer::getInterfaceDescriptor());
206 if (err != NO_ERROR) {
207 return err;
208 }
209
210 err = remote()->transact(
211 BnSurfaceComposer::GET_SUPPORTED_FRAME_TIMESTAMPS,
212 data, &reply);
213 if (err != NO_ERROR) {
214 return err;
215 }
216
217 int32_t result = 0;
218 err = reply.readInt32(&result);
219 if (err != NO_ERROR) {
220 return err;
221 }
222 if (result != NO_ERROR) {
223 return result;
224 }
225
226 std::vector<int32_t> supported;
227 err = reply.readInt32Vector(&supported);
228 if (err != NO_ERROR) {
229 return err;
230 }
231
232 outSupported->reserve(supported.size());
233 for (int32_t s : supported) {
234 outSupported->push_back(static_cast<FrameEvent>(s));
235 }
236 return NO_ERROR;
237 }
238
Jorim Jaggib1e2f8d2017-06-08 15:43:59 -0700239 virtual sp<IDisplayEventConnection> createDisplayEventConnection(VsyncSource vsyncSource)
Mathias Agopiand0566bc2011-11-17 17:49:17 -0800240 {
241 Parcel data, reply;
242 sp<IDisplayEventConnection> result;
243 int err = data.writeInterfaceToken(
244 ISurfaceComposer::getInterfaceDescriptor());
245 if (err != NO_ERROR) {
246 return result;
247 }
Jorim Jaggib1e2f8d2017-06-08 15:43:59 -0700248 data.writeInt32(static_cast<int32_t>(vsyncSource));
Mathias Agopiand0566bc2011-11-17 17:49:17 -0800249 err = remote()->transact(
250 BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION,
251 data, &reply);
252 if (err != NO_ERROR) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000253 ALOGE("ISurfaceComposer::createDisplayEventConnection: error performing "
Mathias Agopiand0566bc2011-11-17 17:49:17 -0800254 "transaction: %s (%d)", strerror(-err), -err);
255 return result;
256 }
257 result = interface_cast<IDisplayEventConnection>(reply.readStrongBinder());
258 return result;
259 }
Colin Cross8e533062012-06-07 13:17:52 -0700260
Jamie Gennisdd3cb842012-10-19 18:19:11 -0700261 virtual sp<IBinder> createDisplay(const String8& displayName, bool secure)
Mathias Agopiane57f2922012-08-09 16:29:12 -0700262 {
263 Parcel data, reply;
264 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
Andy McFadden8dfa92f2012-09-17 18:27:17 -0700265 data.writeString8(displayName);
Jamie Gennisdd3cb842012-10-19 18:19:11 -0700266 data.writeInt32(secure ? 1 : 0);
Mathias Agopiane57f2922012-08-09 16:29:12 -0700267 remote()->transact(BnSurfaceComposer::CREATE_DISPLAY, data, &reply);
268 return reply.readStrongBinder();
269 }
270
Jesse Hall6c913be2013-08-08 12:15:49 -0700271 virtual void destroyDisplay(const sp<IBinder>& display)
272 {
273 Parcel data, reply;
274 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
275 data.writeStrongBinder(display);
276 remote()->transact(BnSurfaceComposer::DESTROY_DISPLAY, data, &reply);
277 }
278
Dominik Laskowskidcb38bb2019-01-25 02:35:50 -0800279 virtual std::vector<PhysicalDisplayId> getPhysicalDisplayIds() const {
Mathias Agopiane57f2922012-08-09 16:29:12 -0700280 Parcel data, reply;
281 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
Dominik Laskowskidcb38bb2019-01-25 02:35:50 -0800282 if (remote()->transact(BnSurfaceComposer::GET_PHYSICAL_DISPLAY_IDS, data, &reply) ==
283 NO_ERROR) {
284 std::vector<PhysicalDisplayId> displayIds;
285 if (reply.readUint64Vector(&displayIds) == NO_ERROR) {
286 return displayIds;
287 }
288 }
289
290 return {};
291 }
292
293 virtual sp<IBinder> getPhysicalDisplayToken(PhysicalDisplayId displayId) const {
294 Parcel data, reply;
295 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
296 data.writeUint64(displayId);
297 remote()->transact(BnSurfaceComposer::GET_PHYSICAL_DISPLAY_TOKEN, data, &reply);
Mathias Agopiane57f2922012-08-09 16:29:12 -0700298 return reply.readStrongBinder();
299 }
300
Prashant Malani2c9b11f2014-05-25 01:36:31 -0700301 virtual void setPowerMode(const sp<IBinder>& display, int mode)
Colin Cross8e533062012-06-07 13:17:52 -0700302 {
303 Parcel data, reply;
304 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
Andy McFaddenc01a79d2012-09-27 16:02:06 -0700305 data.writeStrongBinder(display);
Prashant Malani2c9b11f2014-05-25 01:36:31 -0700306 data.writeInt32(mode);
307 remote()->transact(BnSurfaceComposer::SET_POWER_MODE, data, &reply);
Colin Cross8e533062012-06-07 13:17:52 -0700308 }
Mathias Agopian3094df32012-06-18 18:06:45 -0700309
Dan Stoza7f7da322014-05-02 15:26:25 -0700310 virtual status_t getDisplayConfigs(const sp<IBinder>& display,
311 Vector<DisplayInfo>* configs)
Mathias Agopianc666cae2012-07-25 18:56:13 -0700312 {
313 Parcel data, reply;
314 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
Jeff Brown9d4e3d22012-08-24 20:00:51 -0700315 data.writeStrongBinder(display);
Dan Stoza7f7da322014-05-02 15:26:25 -0700316 remote()->transact(BnSurfaceComposer::GET_DISPLAY_CONFIGS, data, &reply);
317 status_t result = reply.readInt32();
318 if (result == NO_ERROR) {
Dan Stozad723bd72014-11-18 10:24:03 -0800319 size_t numConfigs = reply.readUint32();
Dan Stoza7f7da322014-05-02 15:26:25 -0700320 configs->clear();
321 configs->resize(numConfigs);
322 for (size_t c = 0; c < numConfigs; ++c) {
323 memcpy(&(configs->editItemAt(c)),
324 reply.readInplace(sizeof(DisplayInfo)),
325 sizeof(DisplayInfo));
326 }
327 }
328 return result;
329 }
330
Lajos Molnar67d8bd62014-09-11 14:58:45 -0700331 virtual status_t getDisplayStats(const sp<IBinder>& display,
332 DisplayStatInfo* stats)
333 {
334 Parcel data, reply;
335 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
336 data.writeStrongBinder(display);
337 remote()->transact(BnSurfaceComposer::GET_DISPLAY_STATS, data, &reply);
338 status_t result = reply.readInt32();
339 if (result == NO_ERROR) {
340 memcpy(stats,
341 reply.readInplace(sizeof(DisplayStatInfo)),
342 sizeof(DisplayStatInfo));
343 }
344 return result;
345 }
346
Dan Stoza7f7da322014-05-02 15:26:25 -0700347 virtual int getActiveConfig(const sp<IBinder>& display)
348 {
349 Parcel data, reply;
350 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
351 data.writeStrongBinder(display);
352 remote()->transact(BnSurfaceComposer::GET_ACTIVE_CONFIG, data, &reply);
353 return reply.readInt32();
354 }
355
356 virtual status_t setActiveConfig(const sp<IBinder>& display, int id)
357 {
358 Parcel data, reply;
Ana Krulec2d41e422018-07-26 12:07:43 -0700359 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
360 if (result != NO_ERROR) {
361 ALOGE("setActiveConfig failed to writeInterfaceToken: %d", result);
362 return result;
363 }
364 result = data.writeStrongBinder(display);
365 if (result != NO_ERROR) {
366 ALOGE("setActiveConfig failed to writeStrongBinder: %d", result);
367 return result;
368 }
369 result = data.writeInt32(id);
370 if (result != NO_ERROR) {
371 ALOGE("setActiveConfig failed to writeInt32: %d", result);
372 return result;
373 }
374 result = remote()->transact(BnSurfaceComposer::SET_ACTIVE_CONFIG, data, &reply);
375 if (result != NO_ERROR) {
376 ALOGE("setActiveConfig failed to transact: %d", result);
377 return result;
378 }
Mathias Agopianc666cae2012-07-25 18:56:13 -0700379 return reply.readInt32();
380 }
Svetoslavd85084b2014-03-20 10:28:31 -0700381
Michael Wright28f24d02016-07-12 13:30:53 -0700382 virtual status_t getDisplayColorModes(const sp<IBinder>& display,
Peiyong Lina52f0292018-03-14 17:26:31 -0700383 Vector<ColorMode>* outColorModes) {
Michael Wright28f24d02016-07-12 13:30:53 -0700384 Parcel data, reply;
385 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
386 if (result != NO_ERROR) {
387 ALOGE("getDisplayColorModes failed to writeInterfaceToken: %d", result);
388 return result;
389 }
390 result = data.writeStrongBinder(display);
391 if (result != NO_ERROR) {
392 ALOGE("getDisplayColorModes failed to writeStrongBinder: %d", result);
393 return result;
394 }
395 result = remote()->transact(BnSurfaceComposer::GET_DISPLAY_COLOR_MODES, data, &reply);
396 if (result != NO_ERROR) {
397 ALOGE("getDisplayColorModes failed to transact: %d", result);
398 return result;
399 }
400 result = static_cast<status_t>(reply.readInt32());
401 if (result == NO_ERROR) {
402 size_t numModes = reply.readUint32();
403 outColorModes->clear();
404 outColorModes->resize(numModes);
405 for (size_t i = 0; i < numModes; ++i) {
Peiyong Lina52f0292018-03-14 17:26:31 -0700406 outColorModes->replaceAt(static_cast<ColorMode>(reply.readInt32()), i);
Michael Wright28f24d02016-07-12 13:30:53 -0700407 }
408 }
409 return result;
410 }
411
Daniel Solomon42d04562019-01-20 21:03:19 -0800412 virtual status_t getDisplayNativePrimaries(const sp<IBinder>& display,
413 ui::DisplayPrimaries& primaries) {
414 Parcel data, reply;
415 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
416 if (result != NO_ERROR) {
417 ALOGE("getDisplayNativePrimaries failed to writeInterfaceToken: %d", result);
418 return result;
419 }
420 result = data.writeStrongBinder(display);
421 if (result != NO_ERROR) {
422 ALOGE("getDisplayNativePrimaries failed to writeStrongBinder: %d", result);
423 return result;
424 }
425 result = remote()->transact(BnSurfaceComposer::GET_DISPLAY_NATIVE_PRIMARIES, data, &reply);
426 if (result != NO_ERROR) {
427 ALOGE("getDisplayNativePrimaries failed to transact: %d", result);
428 return result;
429 }
430 result = reply.readInt32();
431 if (result == NO_ERROR) {
432 memcpy(&primaries, reply.readInplace(sizeof(ui::DisplayPrimaries)),
433 sizeof(ui::DisplayPrimaries));
434 }
435 return result;
436 }
437
Peiyong Lina52f0292018-03-14 17:26:31 -0700438 virtual ColorMode getActiveColorMode(const sp<IBinder>& display) {
Michael Wright28f24d02016-07-12 13:30:53 -0700439 Parcel data, reply;
440 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
441 if (result != NO_ERROR) {
442 ALOGE("getActiveColorMode failed to writeInterfaceToken: %d", result);
Peiyong Lina52f0292018-03-14 17:26:31 -0700443 return static_cast<ColorMode>(result);
Michael Wright28f24d02016-07-12 13:30:53 -0700444 }
445 result = data.writeStrongBinder(display);
446 if (result != NO_ERROR) {
447 ALOGE("getActiveColorMode failed to writeStrongBinder: %d", result);
Peiyong Lina52f0292018-03-14 17:26:31 -0700448 return static_cast<ColorMode>(result);
Michael Wright28f24d02016-07-12 13:30:53 -0700449 }
450 result = remote()->transact(BnSurfaceComposer::GET_ACTIVE_COLOR_MODE, data, &reply);
451 if (result != NO_ERROR) {
452 ALOGE("getActiveColorMode failed to transact: %d", result);
Peiyong Lina52f0292018-03-14 17:26:31 -0700453 return static_cast<ColorMode>(result);
Michael Wright28f24d02016-07-12 13:30:53 -0700454 }
Peiyong Lina52f0292018-03-14 17:26:31 -0700455 return static_cast<ColorMode>(reply.readInt32());
Michael Wright28f24d02016-07-12 13:30:53 -0700456 }
457
458 virtual status_t setActiveColorMode(const sp<IBinder>& display,
Peiyong Lina52f0292018-03-14 17:26:31 -0700459 ColorMode colorMode) {
Michael Wright28f24d02016-07-12 13:30:53 -0700460 Parcel data, reply;
461 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
462 if (result != NO_ERROR) {
463 ALOGE("setActiveColorMode failed to writeInterfaceToken: %d", result);
464 return result;
465 }
466 result = data.writeStrongBinder(display);
467 if (result != NO_ERROR) {
468 ALOGE("setActiveColorMode failed to writeStrongBinder: %d", result);
469 return result;
470 }
Peiyong Lina52f0292018-03-14 17:26:31 -0700471 result = data.writeInt32(static_cast<int32_t>(colorMode));
Michael Wright28f24d02016-07-12 13:30:53 -0700472 if (result != NO_ERROR) {
473 ALOGE("setActiveColorMode failed to writeInt32: %d", result);
474 return result;
475 }
476 result = remote()->transact(BnSurfaceComposer::SET_ACTIVE_COLOR_MODE, data, &reply);
477 if (result != NO_ERROR) {
478 ALOGE("setActiveColorMode failed to transact: %d", result);
479 return result;
480 }
481 return static_cast<status_t>(reply.readInt32());
482 }
483
Svetoslavd85084b2014-03-20 10:28:31 -0700484 virtual status_t clearAnimationFrameStats() {
485 Parcel data, reply;
Ana Krulec2d41e422018-07-26 12:07:43 -0700486 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
487 if (result != NO_ERROR) {
488 ALOGE("clearAnimationFrameStats failed to writeInterfaceToken: %d", result);
489 return result;
490 }
491 result = remote()->transact(BnSurfaceComposer::CLEAR_ANIMATION_FRAME_STATS, data, &reply);
492 if (result != NO_ERROR) {
493 ALOGE("clearAnimationFrameStats failed to transact: %d", result);
494 return result;
495 }
Svetoslavd85084b2014-03-20 10:28:31 -0700496 return reply.readInt32();
497 }
498
499 virtual status_t getAnimationFrameStats(FrameStats* outStats) const {
500 Parcel data, reply;
501 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
502 remote()->transact(BnSurfaceComposer::GET_ANIMATION_FRAME_STATS, data, &reply);
503 reply.read(*outStats);
504 return reply.readInt32();
505 }
Dan Stozac4f471e2016-03-24 09:31:08 -0700506
507 virtual status_t getHdrCapabilities(const sp<IBinder>& display,
508 HdrCapabilities* outCapabilities) const {
509 Parcel data, reply;
510 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
511 status_t result = data.writeStrongBinder(display);
512 if (result != NO_ERROR) {
513 ALOGE("getHdrCapabilities failed to writeStrongBinder: %d", result);
514 return result;
515 }
516 result = remote()->transact(BnSurfaceComposer::GET_HDR_CAPABILITIES,
517 data, &reply);
518 if (result != NO_ERROR) {
519 ALOGE("getHdrCapabilities failed to transact: %d", result);
520 return result;
521 }
522 result = reply.readInt32();
523 if (result == NO_ERROR) {
Mathias Agopiane1f5e6f2017-02-06 16:34:41 -0800524 result = reply.read(*outCapabilities);
Dan Stozac4f471e2016-03-24 09:31:08 -0700525 }
526 return result;
527 }
Sahil Dhanjuc1ba5c42016-06-07 20:09:20 -0700528
529 virtual status_t enableVSyncInjections(bool enable) {
530 Parcel data, reply;
531 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
532 if (result != NO_ERROR) {
533 ALOGE("enableVSyncInjections failed to writeInterfaceToken: %d", result);
534 return result;
535 }
536 result = data.writeBool(enable);
537 if (result != NO_ERROR) {
538 ALOGE("enableVSyncInjections failed to writeBool: %d", result);
539 return result;
540 }
541 result = remote()->transact(BnSurfaceComposer::ENABLE_VSYNC_INJECTIONS,
542 data, &reply, TF_ONE_WAY);
543 if (result != NO_ERROR) {
544 ALOGE("enableVSyncInjections failed to transact: %d", result);
545 return result;
546 }
547 return result;
548 }
549
550 virtual status_t injectVSync(nsecs_t when) {
551 Parcel data, reply;
552 status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
553 if (result != NO_ERROR) {
554 ALOGE("injectVSync failed to writeInterfaceToken: %d", result);
555 return result;
556 }
557 result = data.writeInt64(when);
558 if (result != NO_ERROR) {
559 ALOGE("injectVSync failed to writeInt64: %d", result);
560 return result;
561 }
562 result = remote()->transact(BnSurfaceComposer::INJECT_VSYNC, data, &reply, TF_ONE_WAY);
563 if (result != NO_ERROR) {
564 ALOGE("injectVSync failed to transact: %d", result);
565 return result;
566 }
567 return result;
568 }
569
Kalle Raitaa099a242017-01-11 11:17:29 -0800570 virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const
571 {
572 if (!outLayers) {
573 return UNEXPECTED_NULL;
574 }
575
576 Parcel data, reply;
577
578 status_t err = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
579 if (err != NO_ERROR) {
580 return err;
581 }
582
583 err = remote()->transact(BnSurfaceComposer::GET_LAYER_DEBUG_INFO, data, &reply);
584 if (err != NO_ERROR) {
585 return err;
586 }
587
588 int32_t result = 0;
589 err = reply.readInt32(&result);
590 if (err != NO_ERROR) {
591 return err;
592 }
593 if (result != NO_ERROR) {
594 return result;
595 }
596
597 outLayers->clear();
598 return reply.readParcelableVector(outLayers);
599 }
Peiyong Lin0256f722018-08-31 15:45:10 -0700600
Peiyong Linc6780972018-10-28 15:24:08 -0700601 virtual status_t getCompositionPreference(ui::Dataspace* defaultDataspace,
602 ui::PixelFormat* defaultPixelFormat,
603 ui::Dataspace* wideColorGamutDataspace,
604 ui::PixelFormat* wideColorGamutPixelFormat) const {
Peiyong Lin0256f722018-08-31 15:45:10 -0700605 Parcel data, reply;
606 status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
607 if (error != NO_ERROR) {
608 return error;
609 }
610 error = remote()->transact(BnSurfaceComposer::GET_COMPOSITION_PREFERENCE, data, &reply);
611 if (error != NO_ERROR) {
612 return error;
613 }
614 error = static_cast<status_t>(reply.readInt32());
615 if (error == NO_ERROR) {
Peiyong Linc6780972018-10-28 15:24:08 -0700616 *defaultDataspace = static_cast<ui::Dataspace>(reply.readInt32());
617 *defaultPixelFormat = static_cast<ui::PixelFormat>(reply.readInt32());
618 *wideColorGamutDataspace = static_cast<ui::Dataspace>(reply.readInt32());
619 *wideColorGamutPixelFormat = static_cast<ui::PixelFormat>(reply.readInt32());
Peiyong Lin0256f722018-08-31 15:45:10 -0700620 }
621 return error;
622 }
Ady Abraham2a6ab2a2018-10-26 14:25:30 -0700623
Ady Abraham37965d42018-11-01 13:43:32 -0700624 virtual status_t getColorManagement(bool* outGetColorManagement) const {
Ady Abraham2a6ab2a2018-10-26 14:25:30 -0700625 Parcel data, reply;
626 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
Ady Abraham37965d42018-11-01 13:43:32 -0700627 remote()->transact(BnSurfaceComposer::GET_COLOR_MANAGEMENT, data, &reply);
628 bool result;
629 status_t err = reply.readBool(&result);
630 if (err == NO_ERROR) {
631 *outGetColorManagement = result;
Ady Abraham2a6ab2a2018-10-26 14:25:30 -0700632 }
Ady Abraham37965d42018-11-01 13:43:32 -0700633 return err;
Ady Abraham2a6ab2a2018-10-26 14:25:30 -0700634 }
Kevin DuBois9c0a1762018-10-16 13:32:31 -0700635
636 virtual status_t getDisplayedContentSamplingAttributes(const sp<IBinder>& display,
637 ui::PixelFormat* outFormat,
638 ui::Dataspace* outDataspace,
639 uint8_t* outComponentMask) const {
640 if (!outFormat || !outDataspace || !outComponentMask) return BAD_VALUE;
641 Parcel data, reply;
642 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
643 data.writeStrongBinder(display);
644
645 status_t error =
646 remote()->transact(BnSurfaceComposer::GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES,
647 data, &reply);
648 if (error != NO_ERROR) {
649 return error;
650 }
651
652 uint32_t value = 0;
653 error = reply.readUint32(&value);
654 if (error != NO_ERROR) {
655 return error;
656 }
657 *outFormat = static_cast<ui::PixelFormat>(value);
658
659 error = reply.readUint32(&value);
660 if (error != NO_ERROR) {
661 return error;
662 }
663 *outDataspace = static_cast<ui::Dataspace>(value);
664
665 error = reply.readUint32(&value);
666 if (error != NO_ERROR) {
667 return error;
668 }
669 *outComponentMask = static_cast<uint8_t>(value);
670 return error;
671 }
Kevin DuBois74e53772018-11-19 10:52:38 -0800672
673 virtual status_t setDisplayContentSamplingEnabled(const sp<IBinder>& display, bool enable,
674 uint8_t componentMask,
675 uint64_t maxFrames) const {
676 Parcel data, reply;
677 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
678 data.writeStrongBinder(display);
679 data.writeBool(enable);
680 data.writeByte(static_cast<int8_t>(componentMask));
681 data.writeUint64(maxFrames);
682 status_t result =
683 remote()->transact(BnSurfaceComposer::SET_DISPLAY_CONTENT_SAMPLING_ENABLED, data,
684 &reply);
685 return result;
686 }
Kevin DuBois1d4249a2018-08-29 10:45:14 -0700687
688 virtual status_t getDisplayedContentSample(const sp<IBinder>& display, uint64_t maxFrames,
689 uint64_t timestamp,
690 DisplayedFrameStats* outStats) const {
691 if (!outStats) return BAD_VALUE;
692
693 Parcel data, reply;
694 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
695 data.writeStrongBinder(display);
696 data.writeUint64(maxFrames);
697 data.writeUint64(timestamp);
698
699 status_t result =
700 remote()->transact(BnSurfaceComposer::GET_DISPLAYED_CONTENT_SAMPLE, data, &reply);
701
702 if (result != NO_ERROR) {
703 return result;
704 }
705
706 result = reply.readUint64(&outStats->numFrames);
707 if (result != NO_ERROR) {
708 return result;
709 }
710
Kevin DuBois1d4c6a62018-12-12 13:59:46 -0800711 result = reply.readUint64Vector(&outStats->component_0_sample);
Kevin DuBois1d4249a2018-08-29 10:45:14 -0700712 if (result != NO_ERROR) {
713 return result;
714 }
Kevin DuBois1d4c6a62018-12-12 13:59:46 -0800715 result = reply.readUint64Vector(&outStats->component_1_sample);
Kevin DuBois1d4249a2018-08-29 10:45:14 -0700716 if (result != NO_ERROR) {
717 return result;
718 }
Kevin DuBois1d4c6a62018-12-12 13:59:46 -0800719 result = reply.readUint64Vector(&outStats->component_2_sample);
Kevin DuBois1d4249a2018-08-29 10:45:14 -0700720 if (result != NO_ERROR) {
721 return result;
722 }
Kevin DuBois1d4c6a62018-12-12 13:59:46 -0800723 result = reply.readUint64Vector(&outStats->component_3_sample);
Kevin DuBois1d4249a2018-08-29 10:45:14 -0700724 return result;
725 }
Peiyong Lin3c2791e2019-01-14 17:05:18 -0800726
727 virtual status_t getProtectedContentSupport(bool* outSupported) const {
728 Parcel data, reply;
729 data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
Peiyong Linb6888fa2019-01-28 13:20:58 -0800730 status_t error =
731 remote()->transact(BnSurfaceComposer::GET_PROTECTED_CONTENT_SUPPORT, data, &reply);
732 if (error != NO_ERROR) {
733 return error;
Peiyong Lin3c2791e2019-01-14 17:05:18 -0800734 }
Peiyong Linb6888fa2019-01-28 13:20:58 -0800735 error = reply.readBool(outSupported);
736 return error;
Peiyong Lin3c2791e2019-01-14 17:05:18 -0800737 }
Marissa Wallebc2c052019-01-16 19:16:55 -0800738
Peiyong Lin4f3fddf2019-01-24 17:21:24 -0800739 virtual status_t isWideColorDisplay(const sp<IBinder>& token,
740 bool* outIsWideColorDisplay) const {
741 Parcel data, reply;
742 status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
743 if (error != NO_ERROR) {
744 return error;
745 }
746 error = data.writeStrongBinder(token);
747 if (error != NO_ERROR) {
748 return error;
749 }
750
751 error = remote()->transact(BnSurfaceComposer::IS_WIDE_COLOR_DISPLAY, data, &reply);
752 if (error != NO_ERROR) {
753 return error;
754 }
755 error = reply.readBool(outIsWideColorDisplay);
756 return error;
757 }
Dan Stoza84ab9372018-12-17 15:27:57 -0800758
759 virtual status_t addRegionSamplingListener(const Rect& samplingArea,
760 const sp<IBinder>& stopLayerHandle,
761 const sp<IRegionSamplingListener>& listener) {
762 Parcel data, reply;
763 status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
764 if (error != NO_ERROR) {
765 ALOGE("addRegionSamplingListener: Failed to write interface token");
766 return error;
767 }
768 error = data.write(samplingArea);
769 if (error != NO_ERROR) {
770 ALOGE("addRegionSamplingListener: Failed to write sampling area");
771 return error;
772 }
773 error = data.writeStrongBinder(stopLayerHandle);
774 if (error != NO_ERROR) {
775 ALOGE("addRegionSamplingListener: Failed to write stop layer handle");
776 return error;
777 }
778 error = data.writeStrongBinder(IInterface::asBinder(listener));
779 if (error != NO_ERROR) {
780 ALOGE("addRegionSamplingListener: Failed to write listener");
781 return error;
782 }
783 error = remote()->transact(BnSurfaceComposer::ADD_REGION_SAMPLING_LISTENER, data, &reply);
784 if (error != NO_ERROR) {
785 ALOGE("addRegionSamplingListener: Failed to transact");
786 }
787 return error;
788 }
789
790 virtual status_t removeRegionSamplingListener(const sp<IRegionSamplingListener>& listener) {
791 Parcel data, reply;
792 status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
793 if (error != NO_ERROR) {
794 ALOGE("addRegionSamplingListener: Failed to write interface token");
795 return error;
796 }
797 error = data.writeStrongBinder(IInterface::asBinder(listener));
798 if (error != NO_ERROR) {
799 ALOGE("addRegionSamplingListener: Failed to write listener");
800 return error;
801 }
802 error = remote()->transact(BnSurfaceComposer::REMOVE_REGION_SAMPLING_LISTENER, data,
803 &reply);
804 if (error != NO_ERROR) {
805 ALOGE("addRegionSamplingListener: Failed to transact");
806 }
807 return error;
808 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800809};
810
Dan Stozad723bd72014-11-18 10:24:03 -0800811// Out-of-line virtual method definition to trigger vtable emission in this
812// translation unit (see clang warning -Wweak-vtables)
813BpSurfaceComposer::~BpSurfaceComposer() {}
814
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800815IMPLEMENT_META_INTERFACE(SurfaceComposer, "android.ui.ISurfaceComposer");
816
817// ----------------------------------------------------------------------
818
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800819status_t BnSurfaceComposer::onTransact(
820 uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
821{
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800822 switch(code) {
823 case CREATE_CONNECTION: {
Mathias Agopian83c04462009-05-22 19:00:22 -0700824 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Marco Nelissen2ea926b2014-11-14 08:01:01 -0800825 sp<IBinder> b = IInterface::asBinder(createConnection());
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800826 reply->writeStrongBinder(b);
Jesse Hall6c913be2013-08-08 12:15:49 -0700827 return NO_ERROR;
828 }
Mathias Agopian698c0872011-06-28 19:09:31 -0700829 case SET_TRANSACTION_STATE: {
Mathias Agopian83c04462009-05-22 19:00:22 -0700830 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Dan Stozad723bd72014-11-18 10:24:03 -0800831
832 size_t count = data.readUint32();
Michael Lentine8afa1c42014-10-31 11:10:13 -0700833 if (count > data.dataSize()) {
834 return BAD_VALUE;
835 }
Mathias Agopian698c0872011-06-28 19:09:31 -0700836 Vector<ComposerState> state;
837 state.setCapacity(count);
Dan Stozad723bd72014-11-18 10:24:03 -0800838 for (size_t i = 0; i < count; i++) {
Marissa Wallc837b5e2018-10-12 10:04:44 -0700839 ComposerState s;
Michael Lentine8afa1c42014-10-31 11:10:13 -0700840 if (s.read(data) == BAD_VALUE) {
841 return BAD_VALUE;
842 }
Mathias Agopian698c0872011-06-28 19:09:31 -0700843 state.add(s);
844 }
Dan Stozad723bd72014-11-18 10:24:03 -0800845
846 count = data.readUint32();
Michael Lentine8afa1c42014-10-31 11:10:13 -0700847 if (count > data.dataSize()) {
848 return BAD_VALUE;
849 }
Mathias Agopian8b33f032012-07-24 20:43:54 -0700850 DisplayState d;
851 Vector<DisplayState> displays;
852 displays.setCapacity(count);
Dan Stozad723bd72014-11-18 10:24:03 -0800853 for (size_t i = 0; i < count; i++) {
Michael Lentine8afa1c42014-10-31 11:10:13 -0700854 if (d.read(data) == BAD_VALUE) {
855 return BAD_VALUE;
856 }
Mathias Agopian8b33f032012-07-24 20:43:54 -0700857 displays.add(d);
858 }
Dan Stozad723bd72014-11-18 10:24:03 -0800859
860 uint32_t stateFlags = data.readUint32();
Marissa Wall713b63f2018-10-17 15:42:43 -0700861 sp<IBinder> applyToken = data.readStrongBinder();
chaviw273171b2018-12-26 11:46:30 -0800862 InputWindowCommands inputWindowCommands;
863 inputWindowCommands.read(data);
Marissa Wall17b4e452018-12-26 16:32:34 -0800864
865 int64_t desiredPresentTime = data.readInt64();
866 setTransactionState(state, displays, stateFlags, applyToken, inputWindowCommands,
867 desiredPresentTime);
Jesse Hall6c913be2013-08-08 12:15:49 -0700868 return NO_ERROR;
869 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800870 case BOOT_FINISHED: {
Mathias Agopian83c04462009-05-22 19:00:22 -0700871 CHECK_INTERFACE(ISurfaceComposer, data, reply);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800872 bootFinished();
Jesse Hall6c913be2013-08-08 12:15:49 -0700873 return NO_ERROR;
874 }
Mathias Agopian2a9fc492013-03-01 13:42:57 -0800875 case CAPTURE_SCREEN: {
876 CHECK_INTERFACE(ISurfaceComposer, data, reply);
877 sp<IBinder> display = data.readStrongBinder();
Peiyong Lin0e003c92018-09-17 11:09:51 -0700878 ui::Dataspace reqDataspace = static_cast<ui::Dataspace>(data.readInt32());
879 ui::PixelFormat reqPixelFormat = static_cast<ui::PixelFormat>(data.readInt32());
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000880 sp<GraphicBuffer> outBuffer;
Pablo Ceballos60d69222015-08-07 14:47:20 -0700881 Rect sourceCrop(Rect::EMPTY_RECT);
Dan Stozac1879002014-05-22 15:59:05 -0700882 data.read(sourceCrop);
Dan Stozad723bd72014-11-18 10:24:03 -0800883 uint32_t reqWidth = data.readUint32();
884 uint32_t reqHeight = data.readUint32();
Dan Stozac7014012014-02-14 15:03:43 -0800885 bool useIdentityTransform = static_cast<bool>(data.readInt32());
Dan Stozad723bd72014-11-18 10:24:03 -0800886 int32_t rotation = data.readInt32();
Dan Stozac7014012014-02-14 15:03:43 -0800887
Peiyong Lin0e003c92018-09-17 11:09:51 -0700888 status_t res = captureScreen(display, &outBuffer, reqDataspace, reqPixelFormat,
889 sourceCrop, reqWidth, reqHeight, useIdentityTransform,
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000890 static_cast<ISurfaceComposer::Rotation>(rotation));
Mathias Agopian2a9fc492013-03-01 13:42:57 -0800891 reply->writeInt32(res);
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000892 if (res == NO_ERROR) {
893 reply->write(*outBuffer);
894 }
Jesse Hall6c913be2013-08-08 12:15:49 -0700895 return NO_ERROR;
896 }
chaviwa76b2712017-09-20 12:02:26 -0700897 case CAPTURE_LAYERS: {
898 CHECK_INTERFACE(ISurfaceComposer, data, reply);
899 sp<IBinder> layerHandleBinder = data.readStrongBinder();
Peiyong Lin0e003c92018-09-17 11:09:51 -0700900 ui::Dataspace reqDataspace = static_cast<ui::Dataspace>(data.readInt32());
901 ui::PixelFormat reqPixelFormat = static_cast<ui::PixelFormat>(data.readInt32());
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000902 sp<GraphicBuffer> outBuffer;
chaviw7206d492017-11-10 16:16:12 -0800903 Rect sourceCrop(Rect::EMPTY_RECT);
904 data.read(sourceCrop);
905 float frameScale = data.readFloat();
Robert Carr578038f2018-03-09 12:25:24 -0800906 bool childrenOnly = data.readBool();
chaviwa76b2712017-09-20 12:02:26 -0700907
Peiyong Lin0e003c92018-09-17 11:09:51 -0700908 status_t res = captureLayers(layerHandleBinder, &outBuffer, reqDataspace,
909 reqPixelFormat, sourceCrop, frameScale, childrenOnly);
chaviwa76b2712017-09-20 12:02:26 -0700910 reply->writeInt32(res);
Chavi Weingarten40482ff2017-11-30 01:51:40 +0000911 if (res == NO_ERROR) {
912 reply->write(*outBuffer);
913 }
chaviwa76b2712017-09-20 12:02:26 -0700914 return NO_ERROR;
915 }
Jamie Gennis134f0422011-03-08 12:18:54 -0800916 case AUTHENTICATE_SURFACE: {
917 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Andy McFadden2adaf042012-12-18 09:49:45 -0800918 sp<IGraphicBufferProducer> bufferProducer =
919 interface_cast<IGraphicBufferProducer>(data.readStrongBinder());
920 int32_t result = authenticateSurfaceTexture(bufferProducer) ? 1 : 0;
Jamie Gennis134f0422011-03-08 12:18:54 -0800921 reply->writeInt32(result);
Jesse Hall6c913be2013-08-08 12:15:49 -0700922 return NO_ERROR;
923 }
Brian Anderson6b376712017-04-04 10:51:39 -0700924 case GET_SUPPORTED_FRAME_TIMESTAMPS: {
925 CHECK_INTERFACE(ISurfaceComposer, data, reply);
926 std::vector<FrameEvent> supportedTimestamps;
927 status_t result = getSupportedFrameTimestamps(&supportedTimestamps);
928 status_t err = reply->writeInt32(result);
929 if (err != NO_ERROR) {
930 return err;
931 }
932 if (result != NO_ERROR) {
933 return result;
934 }
935
936 std::vector<int32_t> supported;
937 supported.reserve(supportedTimestamps.size());
938 for (FrameEvent s : supportedTimestamps) {
939 supported.push_back(static_cast<int32_t>(s));
940 }
941 return reply->writeInt32Vector(supported);
942 }
Mathias Agopiand0566bc2011-11-17 17:49:17 -0800943 case CREATE_DISPLAY_EVENT_CONNECTION: {
944 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Jorim Jaggib1e2f8d2017-06-08 15:43:59 -0700945 sp<IDisplayEventConnection> connection(createDisplayEventConnection(
946 static_cast<ISurfaceComposer::VsyncSource>(data.readInt32())));
Marco Nelissen2ea926b2014-11-14 08:01:01 -0800947 reply->writeStrongBinder(IInterface::asBinder(connection));
Mathias Agopiand0566bc2011-11-17 17:49:17 -0800948 return NO_ERROR;
Jesse Hall6c913be2013-08-08 12:15:49 -0700949 }
Mathias Agopiane57f2922012-08-09 16:29:12 -0700950 case CREATE_DISPLAY: {
951 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Andy McFadden8dfa92f2012-09-17 18:27:17 -0700952 String8 displayName = data.readString8();
Jamie Gennisdd3cb842012-10-19 18:19:11 -0700953 bool secure = bool(data.readInt32());
954 sp<IBinder> display(createDisplay(displayName, secure));
Mathias Agopiane57f2922012-08-09 16:29:12 -0700955 reply->writeStrongBinder(display);
956 return NO_ERROR;
Jesse Hall6c913be2013-08-08 12:15:49 -0700957 }
958 case DESTROY_DISPLAY: {
959 CHECK_INTERFACE(ISurfaceComposer, data, reply);
960 sp<IBinder> display = data.readStrongBinder();
961 destroyDisplay(display);
962 return NO_ERROR;
963 }
Dominik Laskowskidcb38bb2019-01-25 02:35:50 -0800964 case GET_PHYSICAL_DISPLAY_TOKEN: {
Mathias Agopiane57f2922012-08-09 16:29:12 -0700965 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Dominik Laskowskidcb38bb2019-01-25 02:35:50 -0800966 PhysicalDisplayId displayId = data.readUint64();
967 sp<IBinder> display = getPhysicalDisplayToken(displayId);
Mathias Agopiane57f2922012-08-09 16:29:12 -0700968 reply->writeStrongBinder(display);
969 return NO_ERROR;
Jesse Hall6c913be2013-08-08 12:15:49 -0700970 }
Dan Stoza7f7da322014-05-02 15:26:25 -0700971 case GET_DISPLAY_CONFIGS: {
Mathias Agopianc666cae2012-07-25 18:56:13 -0700972 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Dan Stoza7f7da322014-05-02 15:26:25 -0700973 Vector<DisplayInfo> configs;
Jeff Brown9d4e3d22012-08-24 20:00:51 -0700974 sp<IBinder> display = data.readStrongBinder();
Dan Stoza7f7da322014-05-02 15:26:25 -0700975 status_t result = getDisplayConfigs(display, &configs);
976 reply->writeInt32(result);
977 if (result == NO_ERROR) {
Dan Stozad723bd72014-11-18 10:24:03 -0800978 reply->writeUint32(static_cast<uint32_t>(configs.size()));
Dan Stoza7f7da322014-05-02 15:26:25 -0700979 for (size_t c = 0; c < configs.size(); ++c) {
980 memcpy(reply->writeInplace(sizeof(DisplayInfo)),
981 &configs[c], sizeof(DisplayInfo));
982 }
983 }
984 return NO_ERROR;
985 }
Lajos Molnar67d8bd62014-09-11 14:58:45 -0700986 case GET_DISPLAY_STATS: {
987 CHECK_INTERFACE(ISurfaceComposer, data, reply);
988 DisplayStatInfo stats;
989 sp<IBinder> display = data.readStrongBinder();
990 status_t result = getDisplayStats(display, &stats);
991 reply->writeInt32(result);
992 if (result == NO_ERROR) {
993 memcpy(reply->writeInplace(sizeof(DisplayStatInfo)),
994 &stats, sizeof(DisplayStatInfo));
995 }
996 return NO_ERROR;
997 }
Dan Stoza7f7da322014-05-02 15:26:25 -0700998 case GET_ACTIVE_CONFIG: {
999 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1000 sp<IBinder> display = data.readStrongBinder();
1001 int id = getActiveConfig(display);
1002 reply->writeInt32(id);
1003 return NO_ERROR;
1004 }
1005 case SET_ACTIVE_CONFIG: {
1006 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1007 sp<IBinder> display = data.readStrongBinder();
1008 int id = data.readInt32();
1009 status_t result = setActiveConfig(display, id);
Mathias Agopianc666cae2012-07-25 18:56:13 -07001010 reply->writeInt32(result);
Jesse Hall6c913be2013-08-08 12:15:49 -07001011 return NO_ERROR;
1012 }
Michael Wright28f24d02016-07-12 13:30:53 -07001013 case GET_DISPLAY_COLOR_MODES: {
1014 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Peiyong Lina52f0292018-03-14 17:26:31 -07001015 Vector<ColorMode> colorModes;
Michael Wright28f24d02016-07-12 13:30:53 -07001016 sp<IBinder> display = nullptr;
1017 status_t result = data.readStrongBinder(&display);
1018 if (result != NO_ERROR) {
1019 ALOGE("getDisplayColorModes failed to readStrongBinder: %d", result);
1020 return result;
1021 }
1022 result = getDisplayColorModes(display, &colorModes);
1023 reply->writeInt32(result);
1024 if (result == NO_ERROR) {
1025 reply->writeUint32(static_cast<uint32_t>(colorModes.size()));
1026 for (size_t i = 0; i < colorModes.size(); ++i) {
Peiyong Lina52f0292018-03-14 17:26:31 -07001027 reply->writeInt32(static_cast<int32_t>(colorModes[i]));
Michael Wright28f24d02016-07-12 13:30:53 -07001028 }
1029 }
1030 return NO_ERROR;
1031 }
Daniel Solomon42d04562019-01-20 21:03:19 -08001032 case GET_DISPLAY_NATIVE_PRIMARIES: {
1033 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1034 ui::DisplayPrimaries primaries;
1035 sp<IBinder> display = nullptr;
1036
1037 status_t result = data.readStrongBinder(&display);
1038 if (result != NO_ERROR) {
1039 ALOGE("getDisplayNativePrimaries failed to readStrongBinder: %d", result);
1040 return result;
1041 }
1042
1043 result = getDisplayNativePrimaries(display, primaries);
1044 reply->writeInt32(result);
1045 if (result == NO_ERROR) {
1046 memcpy(reply->writeInplace(sizeof(ui::DisplayPrimaries)), &primaries,
1047 sizeof(ui::DisplayPrimaries));
1048 }
1049
1050 return NO_ERROR;
1051 }
Michael Wright28f24d02016-07-12 13:30:53 -07001052 case GET_ACTIVE_COLOR_MODE: {
1053 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1054 sp<IBinder> display = nullptr;
1055 status_t result = data.readStrongBinder(&display);
1056 if (result != NO_ERROR) {
1057 ALOGE("getActiveColorMode failed to readStrongBinder: %d", result);
1058 return result;
1059 }
Peiyong Lina52f0292018-03-14 17:26:31 -07001060 ColorMode colorMode = getActiveColorMode(display);
Michael Wright28f24d02016-07-12 13:30:53 -07001061 result = reply->writeInt32(static_cast<int32_t>(colorMode));
1062 return result;
1063 }
1064 case SET_ACTIVE_COLOR_MODE: {
1065 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1066 sp<IBinder> display = nullptr;
1067 status_t result = data.readStrongBinder(&display);
1068 if (result != NO_ERROR) {
1069 ALOGE("getActiveColorMode failed to readStrongBinder: %d", result);
1070 return result;
1071 }
1072 int32_t colorModeInt = 0;
1073 result = data.readInt32(&colorModeInt);
1074 if (result != NO_ERROR) {
1075 ALOGE("setActiveColorMode failed to readInt32: %d", result);
1076 return result;
1077 }
1078 result = setActiveColorMode(display,
Peiyong Lina52f0292018-03-14 17:26:31 -07001079 static_cast<ColorMode>(colorModeInt));
Michael Wright28f24d02016-07-12 13:30:53 -07001080 result = reply->writeInt32(result);
1081 return result;
1082 }
Svetoslavd85084b2014-03-20 10:28:31 -07001083 case CLEAR_ANIMATION_FRAME_STATS: {
1084 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1085 status_t result = clearAnimationFrameStats();
1086 reply->writeInt32(result);
1087 return NO_ERROR;
1088 }
1089 case GET_ANIMATION_FRAME_STATS: {
1090 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1091 FrameStats stats;
1092 status_t result = getAnimationFrameStats(&stats);
1093 reply->write(stats);
1094 reply->writeInt32(result);
1095 return NO_ERROR;
1096 }
Prashant Malani2c9b11f2014-05-25 01:36:31 -07001097 case SET_POWER_MODE: {
1098 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1099 sp<IBinder> display = data.readStrongBinder();
1100 int32_t mode = data.readInt32();
1101 setPowerMode(display, mode);
1102 return NO_ERROR;
1103 }
Dan Stozac4f471e2016-03-24 09:31:08 -07001104 case GET_HDR_CAPABILITIES: {
1105 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1106 sp<IBinder> display = nullptr;
1107 status_t result = data.readStrongBinder(&display);
1108 if (result != NO_ERROR) {
1109 ALOGE("getHdrCapabilities failed to readStrongBinder: %d",
1110 result);
1111 return result;
1112 }
1113 HdrCapabilities capabilities;
1114 result = getHdrCapabilities(display, &capabilities);
1115 reply->writeInt32(result);
1116 if (result == NO_ERROR) {
Mathias Agopiane1f5e6f2017-02-06 16:34:41 -08001117 reply->write(capabilities);
Dan Stozac4f471e2016-03-24 09:31:08 -07001118 }
1119 return NO_ERROR;
1120 }
Sahil Dhanjuc1ba5c42016-06-07 20:09:20 -07001121 case ENABLE_VSYNC_INJECTIONS: {
1122 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1123 bool enable = false;
1124 status_t result = data.readBool(&enable);
1125 if (result != NO_ERROR) {
1126 ALOGE("enableVSyncInjections failed to readBool: %d", result);
1127 return result;
1128 }
1129 return enableVSyncInjections(enable);
1130 }
1131 case INJECT_VSYNC: {
1132 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1133 int64_t when = 0;
1134 status_t result = data.readInt64(&when);
1135 if (result != NO_ERROR) {
1136 ALOGE("enableVSyncInjections failed to readInt64: %d", result);
1137 return result;
1138 }
1139 return injectVSync(when);
1140 }
Kalle Raitaa099a242017-01-11 11:17:29 -08001141 case GET_LAYER_DEBUG_INFO: {
1142 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1143 std::vector<LayerDebugInfo> outLayers;
1144 status_t result = getLayerDebugInfo(&outLayers);
1145 reply->writeInt32(result);
1146 if (result == NO_ERROR)
1147 {
1148 result = reply->writeParcelableVector(outLayers);
1149 }
1150 return result;
1151 }
Peiyong Lin0256f722018-08-31 15:45:10 -07001152 case GET_COMPOSITION_PREFERENCE: {
1153 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Peiyong Linc6780972018-10-28 15:24:08 -07001154 ui::Dataspace defaultDataspace;
1155 ui::PixelFormat defaultPixelFormat;
1156 ui::Dataspace wideColorGamutDataspace;
1157 ui::PixelFormat wideColorGamutPixelFormat;
1158 status_t error =
1159 getCompositionPreference(&defaultDataspace, &defaultPixelFormat,
1160 &wideColorGamutDataspace, &wideColorGamutPixelFormat);
Peiyong Lin0256f722018-08-31 15:45:10 -07001161 reply->writeInt32(error);
1162 if (error == NO_ERROR) {
Peiyong Linc6780972018-10-28 15:24:08 -07001163 reply->writeInt32(static_cast<int32_t>(defaultDataspace));
1164 reply->writeInt32(static_cast<int32_t>(defaultPixelFormat));
1165 reply->writeInt32(static_cast<int32_t>(wideColorGamutDataspace));
Peiyong Linaa3da6a2018-12-12 02:48:43 -08001166 reply->writeInt32(static_cast<int32_t>(wideColorGamutPixelFormat));
Peiyong Lin0256f722018-08-31 15:45:10 -07001167 }
Peiyong Lin3c2791e2019-01-14 17:05:18 -08001168 return error;
Peiyong Lin0256f722018-08-31 15:45:10 -07001169 }
Ady Abraham37965d42018-11-01 13:43:32 -07001170 case GET_COLOR_MANAGEMENT: {
Ady Abraham2a6ab2a2018-10-26 14:25:30 -07001171 CHECK_INTERFACE(ISurfaceComposer, data, reply);
Ady Abraham37965d42018-11-01 13:43:32 -07001172 bool result;
1173 status_t error = getColorManagement(&result);
1174 if (error == NO_ERROR) {
1175 reply->writeBool(result);
1176 }
Peiyong Lin3c2791e2019-01-14 17:05:18 -08001177 return error;
Ady Abraham2a6ab2a2018-10-26 14:25:30 -07001178 }
Kevin DuBois9c0a1762018-10-16 13:32:31 -07001179 case GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES: {
1180 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1181
1182 sp<IBinder> display = data.readStrongBinder();
1183 ui::PixelFormat format;
1184 ui::Dataspace dataspace;
1185 uint8_t component = 0;
1186 auto result =
1187 getDisplayedContentSamplingAttributes(display, &format, &dataspace, &component);
1188 if (result == NO_ERROR) {
1189 reply->writeUint32(static_cast<uint32_t>(format));
1190 reply->writeUint32(static_cast<uint32_t>(dataspace));
1191 reply->writeUint32(static_cast<uint32_t>(component));
1192 }
1193 return result;
1194 }
Kevin DuBois74e53772018-11-19 10:52:38 -08001195 case SET_DISPLAY_CONTENT_SAMPLING_ENABLED: {
1196 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1197
1198 sp<IBinder> display = nullptr;
1199 bool enable = false;
1200 int8_t componentMask = 0;
1201 uint64_t maxFrames = 0;
1202 status_t result = data.readStrongBinder(&display);
1203 if (result != NO_ERROR) {
1204 ALOGE("setDisplayContentSamplingEnabled failure in reading Display token: %d",
1205 result);
1206 return result;
1207 }
1208
1209 result = data.readBool(&enable);
1210 if (result != NO_ERROR) {
1211 ALOGE("setDisplayContentSamplingEnabled failure in reading enable: %d", result);
1212 return result;
1213 }
1214
1215 result = data.readByte(static_cast<int8_t*>(&componentMask));
1216 if (result != NO_ERROR) {
1217 ALOGE("setDisplayContentSamplingEnabled failure in reading component mask: %d",
1218 result);
1219 return result;
1220 }
1221
1222 result = data.readUint64(&maxFrames);
1223 if (result != NO_ERROR) {
1224 ALOGE("setDisplayContentSamplingEnabled failure in reading max frames: %d", result);
1225 return result;
1226 }
1227
1228 return setDisplayContentSamplingEnabled(display, enable,
1229 static_cast<uint8_t>(componentMask), maxFrames);
1230 }
Kevin DuBois1d4249a2018-08-29 10:45:14 -07001231 case GET_DISPLAYED_CONTENT_SAMPLE: {
1232 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1233
1234 sp<IBinder> display = data.readStrongBinder();
1235 uint64_t maxFrames = 0;
1236 uint64_t timestamp = 0;
1237
1238 status_t result = data.readUint64(&maxFrames);
1239 if (result != NO_ERROR) {
1240 ALOGE("getDisplayedContentSample failure in reading max frames: %d", result);
1241 return result;
1242 }
1243
1244 result = data.readUint64(&timestamp);
1245 if (result != NO_ERROR) {
1246 ALOGE("getDisplayedContentSample failure in reading timestamp: %d", result);
1247 return result;
1248 }
1249
1250 DisplayedFrameStats stats;
1251 result = getDisplayedContentSample(display, maxFrames, timestamp, &stats);
1252 if (result == NO_ERROR) {
1253 reply->writeUint64(stats.numFrames);
Kevin DuBois1d4c6a62018-12-12 13:59:46 -08001254 reply->writeUint64Vector(stats.component_0_sample);
1255 reply->writeUint64Vector(stats.component_1_sample);
1256 reply->writeUint64Vector(stats.component_2_sample);
1257 reply->writeUint64Vector(stats.component_3_sample);
Kevin DuBois1d4249a2018-08-29 10:45:14 -07001258 }
1259 return result;
1260 }
Peiyong Lin3c2791e2019-01-14 17:05:18 -08001261 case GET_PROTECTED_CONTENT_SUPPORT: {
1262 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1263 bool result;
1264 status_t error = getProtectedContentSupport(&result);
1265 if (error == NO_ERROR) {
1266 reply->writeBool(result);
1267 }
1268 return error;
1269 }
Peiyong Lin4f3fddf2019-01-24 17:21:24 -08001270 case IS_WIDE_COLOR_DISPLAY: {
1271 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1272 sp<IBinder> display = nullptr;
1273 status_t error = data.readStrongBinder(&display);
1274 if (error != NO_ERROR) {
1275 return error;
1276 }
1277 bool result;
1278 error = isWideColorDisplay(display, &result);
1279 if (error == NO_ERROR) {
1280 reply->writeBool(result);
1281 }
1282 return error;
1283 }
Dominik Laskowskidcb38bb2019-01-25 02:35:50 -08001284 case GET_PHYSICAL_DISPLAY_IDS: {
1285 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1286 return reply->writeUint64Vector(getPhysicalDisplayIds());
1287 }
Dan Stoza84ab9372018-12-17 15:27:57 -08001288 case ADD_REGION_SAMPLING_LISTENER: {
1289 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1290 Rect samplingArea;
1291 status_t result = data.read(samplingArea);
1292 if (result != NO_ERROR) {
1293 ALOGE("addRegionSamplingListener: Failed to read sampling area");
1294 return result;
1295 }
1296 sp<IBinder> stopLayerHandle;
1297 result = data.readNullableStrongBinder(&stopLayerHandle);
1298 if (result != NO_ERROR) {
1299 ALOGE("addRegionSamplingListener: Failed to read stop layer handle");
1300 return result;
1301 }
1302 sp<IRegionSamplingListener> listener;
1303 result = data.readNullableStrongBinder(&listener);
1304 if (result != NO_ERROR) {
1305 ALOGE("addRegionSamplingListener: Failed to read listener");
1306 return result;
1307 }
1308 return addRegionSamplingListener(samplingArea, stopLayerHandle, listener);
1309 }
1310 case REMOVE_REGION_SAMPLING_LISTENER: {
1311 CHECK_INTERFACE(ISurfaceComposer, data, reply);
1312 sp<IRegionSamplingListener> listener;
1313 status_t result = data.readNullableStrongBinder(&listener);
1314 if (result != NO_ERROR) {
1315 ALOGE("removeRegionSamplingListener: Failed to read listener");
1316 return result;
1317 }
1318 return removeRegionSamplingListener(listener);
1319 }
Jesse Hall6c913be2013-08-08 12:15:49 -07001320 default: {
Mathias Agopian83c04462009-05-22 19:00:22 -07001321 return BBinder::onTransact(code, data, reply, flags);
Jesse Hall6c913be2013-08-08 12:15:49 -07001322 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001323 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001324}
1325
Dominik Laskowskidcb38bb2019-01-25 02:35:50 -08001326} // namespace android