The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 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 Agopian | c5b2c0b | 2009-05-19 19:08:10 -0700 | [diff] [blame] | 23 | #include <binder/Parcel.h> |
Mathias Agopian | c5b2c0b | 2009-05-19 19:08:10 -0700 | [diff] [blame] | 24 | #include <binder/IPCThreadState.h> |
| 25 | #include <binder/IServiceManager.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 27 | #include <gui/IDisplayEventConnection.h> |
Andy McFadden | 2adaf04 | 2012-12-18 09:49:45 -0800 | [diff] [blame] | 28 | #include <gui/IGraphicBufferProducer.h> |
Dan Stoza | 84ab937 | 2018-12-17 15:27:57 -0800 | [diff] [blame^] | 29 | #include <gui/IRegionSamplingListener.h> |
Mathias Agopian | 2b5dd40 | 2017-02-07 17:36:19 -0800 | [diff] [blame] | 30 | #include <gui/ISurfaceComposer.h> |
| 31 | #include <gui/ISurfaceComposerClient.h> |
Kalle Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 32 | #include <gui/LayerDebugInfo.h> |
Robert Carr | 4cdc58f | 2017-08-23 14:22:20 -0700 | [diff] [blame] | 33 | #include <gui/LayerState.h> |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 34 | |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 35 | #include <system/graphics.h> |
| 36 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | #include <ui/DisplayInfo.h> |
Lajos Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 38 | #include <ui/DisplayStatInfo.h> |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 39 | #include <ui/HdrCapabilities.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 41 | #include <utils/Log.h> |
Mathias Agopian | 9cce325 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 42 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | // --------------------------------------------------------------------------- |
| 44 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | namespace android { |
| 46 | |
Peiyong Lin | 9f03447 | 2018-03-28 15:29:00 -0700 | [diff] [blame] | 47 | using ui::ColorMode; |
| 48 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | class BpSurfaceComposer : public BpInterface<ISurfaceComposer> |
| 50 | { |
| 51 | public: |
Chih-Hung Hsieh | e2347b7 | 2016-04-25 15:41:05 -0700 | [diff] [blame] | 52 | explicit BpSurfaceComposer(const sp<IBinder>& impl) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | : BpInterface<ISurfaceComposer>(impl) |
| 54 | { |
| 55 | } |
| 56 | |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 57 | virtual ~BpSurfaceComposer(); |
| 58 | |
Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 59 | virtual sp<ISurfaceComposerClient> createConnection() |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | { |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 61 | Parcel data, reply; |
| 62 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 63 | remote()->transact(BnSurfaceComposer::CREATE_CONNECTION, data, &reply); |
Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 64 | return interface_cast<ISurfaceComposerClient>(reply.readStrongBinder()); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 65 | } |
| 66 | |
Marissa Wall | 713b63f | 2018-10-17 15:42:43 -0700 | [diff] [blame] | 67 | virtual void setTransactionState(const Vector<ComposerState>& state, |
| 68 | const Vector<DisplayState>& displays, uint32_t flags, |
chaviw | 273171b | 2018-12-26 11:46:30 -0800 | [diff] [blame] | 69 | const sp<IBinder>& applyToken, |
Marissa Wall | 17b4e45 | 2018-12-26 16:32:34 -0800 | [diff] [blame] | 70 | const InputWindowCommands& commands, |
| 71 | int64_t desiredPresentTime) { |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | Parcel data, reply; |
| 73 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 74 | |
| 75 | data.writeUint32(static_cast<uint32_t>(state.size())); |
| 76 | for (const auto& s : state) { |
| 77 | s.write(data); |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 78 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 79 | |
| 80 | data.writeUint32(static_cast<uint32_t>(displays.size())); |
| 81 | for (const auto& d : displays) { |
| 82 | d.write(data); |
Mathias Agopian | 8b33f03 | 2012-07-24 20:43:54 -0700 | [diff] [blame] | 83 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 84 | |
| 85 | data.writeUint32(flags); |
Marissa Wall | 713b63f | 2018-10-17 15:42:43 -0700 | [diff] [blame] | 86 | data.writeStrongBinder(applyToken); |
chaviw | 273171b | 2018-12-26 11:46:30 -0800 | [diff] [blame] | 87 | commands.write(data); |
Marissa Wall | 17b4e45 | 2018-12-26 16:32:34 -0800 | [diff] [blame] | 88 | data.writeInt64(desiredPresentTime); |
Jamie Gennis | b8d69a5 | 2011-10-10 15:48:06 -0700 | [diff] [blame] | 89 | remote()->transact(BnSurfaceComposer::SET_TRANSACTION_STATE, data, &reply); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | } |
| 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 Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 99 | virtual status_t captureScreen(const sp<IBinder>& display, sp<GraphicBuffer>* outBuffer, |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 100 | 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 Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 104 | Parcel data, reply; |
| 105 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 106 | data.writeStrongBinder(display); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 107 | data.writeInt32(static_cast<int32_t>(reqDataspace)); |
| 108 | data.writeInt32(static_cast<int32_t>(reqPixelFormat)); |
Dan Stoza | c187900 | 2014-05-22 15:59:05 -0700 | [diff] [blame] | 109 | data.write(sourceCrop); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 110 | data.writeUint32(reqWidth); |
| 111 | data.writeUint32(reqHeight); |
Dan Stoza | c701401 | 2014-02-14 15:03:43 -0800 | [diff] [blame] | 112 | data.writeInt32(static_cast<int32_t>(useIdentityTransform)); |
Riley Andrews | c3ebe66 | 2014-09-04 16:20:31 -0700 | [diff] [blame] | 113 | data.writeInt32(static_cast<int32_t>(rotation)); |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 114 | 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 Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 118 | } |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 119 | result = reply.readInt32(); |
| 120 | if (result != NO_ERROR) { |
| 121 | ALOGE("captureScreen failed to readInt32: %d", result); |
| 122 | return result; |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | *outBuffer = new GraphicBuffer(); |
| 126 | reply.read(**outBuffer); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 127 | |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 128 | return result; |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 129 | } |
| 130 | |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 131 | virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 132 | sp<GraphicBuffer>* outBuffer, const ui::Dataspace reqDataspace, |
| 133 | const ui::PixelFormat reqPixelFormat, const Rect& sourceCrop, |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame] | 134 | float frameScale, bool childrenOnly) { |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 135 | Parcel data, reply; |
| 136 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 137 | data.writeStrongBinder(layerHandleBinder); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 138 | data.writeInt32(static_cast<int32_t>(reqDataspace)); |
| 139 | data.writeInt32(static_cast<int32_t>(reqPixelFormat)); |
chaviw | 7206d49 | 2017-11-10 16:16:12 -0800 | [diff] [blame] | 140 | data.write(sourceCrop); |
| 141 | data.writeFloat(frameScale); |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame] | 142 | data.writeBool(childrenOnly); |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 143 | 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 Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 147 | } |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 148 | result = reply.readInt32(); |
| 149 | if (result != NO_ERROR) { |
| 150 | ALOGE("captureLayers failed to readInt32: %d", result); |
| 151 | return result; |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 152 | } |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 153 | |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 154 | *outBuffer = new GraphicBuffer(); |
| 155 | reply.read(**outBuffer); |
| 156 | |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 157 | return result; |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 158 | } |
| 159 | |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 160 | virtual bool authenticateSurfaceTexture( |
Andy McFadden | 2adaf04 | 2012-12-18 09:49:45 -0800 | [diff] [blame] | 161 | const sp<IGraphicBufferProducer>& bufferProducer) const |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 162 | { |
| 163 | Parcel data, reply; |
| 164 | int err = NO_ERROR; |
| 165 | err = data.writeInterfaceToken( |
| 166 | ISurfaceComposer::getInterfaceDescriptor()); |
| 167 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 168 | ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 169 | "interface descriptor: %s (%d)", strerror(-err), -err); |
| 170 | return false; |
| 171 | } |
Marco Nelissen | 2ea926b | 2014-11-14 08:01:01 -0800 | [diff] [blame] | 172 | err = data.writeStrongBinder(IInterface::asBinder(bufferProducer)); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 173 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 174 | ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 175 | "strong binder to parcel: %s (%d)", strerror(-err), -err); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 176 | return false; |
| 177 | } |
| 178 | err = remote()->transact(BnSurfaceComposer::AUTHENTICATE_SURFACE, data, |
| 179 | &reply); |
| 180 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 181 | ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 182 | "performing transaction: %s (%d)", strerror(-err), -err); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 183 | return false; |
| 184 | } |
| 185 | int32_t result = 0; |
| 186 | err = reply.readInt32(&result); |
| 187 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 188 | ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 189 | "retrieving result: %s (%d)", strerror(-err), -err); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 190 | return false; |
| 191 | } |
| 192 | return result != 0; |
| 193 | } |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 194 | |
Brian Anderson | 6b37671 | 2017-04-04 10:51:39 -0700 | [diff] [blame] | 195 | 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 Jaggi | b1e2f8d | 2017-06-08 15:43:59 -0700 | [diff] [blame] | 239 | virtual sp<IDisplayEventConnection> createDisplayEventConnection(VsyncSource vsyncSource) |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 240 | { |
| 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 Jaggi | b1e2f8d | 2017-06-08 15:43:59 -0700 | [diff] [blame] | 248 | data.writeInt32(static_cast<int32_t>(vsyncSource)); |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 249 | err = remote()->transact( |
| 250 | BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION, |
| 251 | data, &reply); |
| 252 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 253 | ALOGE("ISurfaceComposer::createDisplayEventConnection: error performing " |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 254 | "transaction: %s (%d)", strerror(-err), -err); |
| 255 | return result; |
| 256 | } |
| 257 | result = interface_cast<IDisplayEventConnection>(reply.readStrongBinder()); |
| 258 | return result; |
| 259 | } |
Colin Cross | 8e53306 | 2012-06-07 13:17:52 -0700 | [diff] [blame] | 260 | |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 261 | virtual sp<IBinder> createDisplay(const String8& displayName, bool secure) |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 262 | { |
| 263 | Parcel data, reply; |
| 264 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Andy McFadden | 8dfa92f | 2012-09-17 18:27:17 -0700 | [diff] [blame] | 265 | data.writeString8(displayName); |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 266 | data.writeInt32(secure ? 1 : 0); |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 267 | remote()->transact(BnSurfaceComposer::CREATE_DISPLAY, data, &reply); |
| 268 | return reply.readStrongBinder(); |
| 269 | } |
| 270 | |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 271 | 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 Laskowski | dcb38bb | 2019-01-25 02:35:50 -0800 | [diff] [blame] | 279 | virtual std::vector<PhysicalDisplayId> getPhysicalDisplayIds() const { |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 280 | Parcel data, reply; |
| 281 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Dominik Laskowski | dcb38bb | 2019-01-25 02:35:50 -0800 | [diff] [blame] | 282 | 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 Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 298 | return reply.readStrongBinder(); |
| 299 | } |
| 300 | |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 301 | virtual void setPowerMode(const sp<IBinder>& display, int mode) |
Colin Cross | 8e53306 | 2012-06-07 13:17:52 -0700 | [diff] [blame] | 302 | { |
| 303 | Parcel data, reply; |
| 304 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Andy McFadden | c01a79d | 2012-09-27 16:02:06 -0700 | [diff] [blame] | 305 | data.writeStrongBinder(display); |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 306 | data.writeInt32(mode); |
| 307 | remote()->transact(BnSurfaceComposer::SET_POWER_MODE, data, &reply); |
Colin Cross | 8e53306 | 2012-06-07 13:17:52 -0700 | [diff] [blame] | 308 | } |
Mathias Agopian | 3094df3 | 2012-06-18 18:06:45 -0700 | [diff] [blame] | 309 | |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 310 | virtual status_t getDisplayConfigs(const sp<IBinder>& display, |
| 311 | Vector<DisplayInfo>* configs) |
Mathias Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 312 | { |
| 313 | Parcel data, reply; |
| 314 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Jeff Brown | 9d4e3d2 | 2012-08-24 20:00:51 -0700 | [diff] [blame] | 315 | data.writeStrongBinder(display); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 316 | remote()->transact(BnSurfaceComposer::GET_DISPLAY_CONFIGS, data, &reply); |
| 317 | status_t result = reply.readInt32(); |
| 318 | if (result == NO_ERROR) { |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 319 | size_t numConfigs = reply.readUint32(); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 320 | 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 Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 331 | 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 Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 347 | 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 Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 359 | 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 Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 379 | return reply.readInt32(); |
| 380 | } |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 381 | |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 382 | virtual status_t getDisplayColorModes(const sp<IBinder>& display, |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 383 | Vector<ColorMode>* outColorModes) { |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 384 | 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 406 | outColorModes->replaceAt(static_cast<ColorMode>(reply.readInt32()), i); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 407 | } |
| 408 | } |
| 409 | return result; |
| 410 | } |
| 411 | |
Daniel Solomon | 42d0456 | 2019-01-20 21:03:19 -0800 | [diff] [blame] | 412 | 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 438 | virtual ColorMode getActiveColorMode(const sp<IBinder>& display) { |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 439 | 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 443 | return static_cast<ColorMode>(result); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 444 | } |
| 445 | result = data.writeStrongBinder(display); |
| 446 | if (result != NO_ERROR) { |
| 447 | ALOGE("getActiveColorMode failed to writeStrongBinder: %d", result); |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 448 | return static_cast<ColorMode>(result); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 449 | } |
| 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 453 | return static_cast<ColorMode>(result); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 454 | } |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 455 | return static_cast<ColorMode>(reply.readInt32()); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | virtual status_t setActiveColorMode(const sp<IBinder>& display, |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 459 | ColorMode colorMode) { |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 460 | 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 471 | result = data.writeInt32(static_cast<int32_t>(colorMode)); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 472 | 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 | |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 484 | virtual status_t clearAnimationFrameStats() { |
| 485 | Parcel data, reply; |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 486 | 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 | } |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 496 | 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 Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 506 | |
| 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 Agopian | e1f5e6f | 2017-02-06 16:34:41 -0800 | [diff] [blame] | 524 | result = reply.read(*outCapabilities); |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 525 | } |
| 526 | return result; |
| 527 | } |
Sahil Dhanju | c1ba5c4 | 2016-06-07 20:09:20 -0700 | [diff] [blame] | 528 | |
| 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 Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 570 | 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 Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 600 | |
Peiyong Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame] | 601 | virtual status_t getCompositionPreference(ui::Dataspace* defaultDataspace, |
| 602 | ui::PixelFormat* defaultPixelFormat, |
| 603 | ui::Dataspace* wideColorGamutDataspace, |
| 604 | ui::PixelFormat* wideColorGamutPixelFormat) const { |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 605 | 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 Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame] | 616 | *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 Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 620 | } |
| 621 | return error; |
| 622 | } |
Ady Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 623 | |
Ady Abraham | 37965d4 | 2018-11-01 13:43:32 -0700 | [diff] [blame] | 624 | virtual status_t getColorManagement(bool* outGetColorManagement) const { |
Ady Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 625 | Parcel data, reply; |
| 626 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Ady Abraham | 37965d4 | 2018-11-01 13:43:32 -0700 | [diff] [blame] | 627 | 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 Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 632 | } |
Ady Abraham | 37965d4 | 2018-11-01 13:43:32 -0700 | [diff] [blame] | 633 | return err; |
Ady Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 634 | } |
Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 635 | |
| 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 DuBois | 74e5377 | 2018-11-19 10:52:38 -0800 | [diff] [blame] | 672 | |
| 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 DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 687 | |
| 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 DuBois | 1d4c6a6 | 2018-12-12 13:59:46 -0800 | [diff] [blame] | 711 | result = reply.readUint64Vector(&outStats->component_0_sample); |
Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 712 | if (result != NO_ERROR) { |
| 713 | return result; |
| 714 | } |
Kevin DuBois | 1d4c6a6 | 2018-12-12 13:59:46 -0800 | [diff] [blame] | 715 | result = reply.readUint64Vector(&outStats->component_1_sample); |
Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 716 | if (result != NO_ERROR) { |
| 717 | return result; |
| 718 | } |
Kevin DuBois | 1d4c6a6 | 2018-12-12 13:59:46 -0800 | [diff] [blame] | 719 | result = reply.readUint64Vector(&outStats->component_2_sample); |
Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 720 | if (result != NO_ERROR) { |
| 721 | return result; |
| 722 | } |
Kevin DuBois | 1d4c6a6 | 2018-12-12 13:59:46 -0800 | [diff] [blame] | 723 | result = reply.readUint64Vector(&outStats->component_3_sample); |
Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 724 | return result; |
| 725 | } |
Peiyong Lin | 3c2791e | 2019-01-14 17:05:18 -0800 | [diff] [blame] | 726 | |
| 727 | virtual status_t getProtectedContentSupport(bool* outSupported) const { |
| 728 | Parcel data, reply; |
| 729 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Peiyong Lin | b6888fa | 2019-01-28 13:20:58 -0800 | [diff] [blame] | 730 | status_t error = |
| 731 | remote()->transact(BnSurfaceComposer::GET_PROTECTED_CONTENT_SUPPORT, data, &reply); |
| 732 | if (error != NO_ERROR) { |
| 733 | return error; |
Peiyong Lin | 3c2791e | 2019-01-14 17:05:18 -0800 | [diff] [blame] | 734 | } |
Peiyong Lin | b6888fa | 2019-01-28 13:20:58 -0800 | [diff] [blame] | 735 | error = reply.readBool(outSupported); |
| 736 | return error; |
Peiyong Lin | 3c2791e | 2019-01-14 17:05:18 -0800 | [diff] [blame] | 737 | } |
Marissa Wall | ebc2c05 | 2019-01-16 19:16:55 -0800 | [diff] [blame] | 738 | |
Peiyong Lin | 4f3fddf | 2019-01-24 17:21:24 -0800 | [diff] [blame] | 739 | 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 Stoza | 84ab937 | 2018-12-17 15:27:57 -0800 | [diff] [blame^] | 758 | |
| 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 Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 809 | }; |
| 810 | |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 811 | // Out-of-line virtual method definition to trigger vtable emission in this |
| 812 | // translation unit (see clang warning -Wweak-vtables) |
| 813 | BpSurfaceComposer::~BpSurfaceComposer() {} |
| 814 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 815 | IMPLEMENT_META_INTERFACE(SurfaceComposer, "android.ui.ISurfaceComposer"); |
| 816 | |
| 817 | // ---------------------------------------------------------------------- |
| 818 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 819 | status_t BnSurfaceComposer::onTransact( |
| 820 | uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) |
| 821 | { |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 822 | switch(code) { |
| 823 | case CREATE_CONNECTION: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 824 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Marco Nelissen | 2ea926b | 2014-11-14 08:01:01 -0800 | [diff] [blame] | 825 | sp<IBinder> b = IInterface::asBinder(createConnection()); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 826 | reply->writeStrongBinder(b); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 827 | return NO_ERROR; |
| 828 | } |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 829 | case SET_TRANSACTION_STATE: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 830 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 831 | |
| 832 | size_t count = data.readUint32(); |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 833 | if (count > data.dataSize()) { |
| 834 | return BAD_VALUE; |
| 835 | } |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 836 | Vector<ComposerState> state; |
| 837 | state.setCapacity(count); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 838 | for (size_t i = 0; i < count; i++) { |
Marissa Wall | c837b5e | 2018-10-12 10:04:44 -0700 | [diff] [blame] | 839 | ComposerState s; |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 840 | if (s.read(data) == BAD_VALUE) { |
| 841 | return BAD_VALUE; |
| 842 | } |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 843 | state.add(s); |
| 844 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 845 | |
| 846 | count = data.readUint32(); |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 847 | if (count > data.dataSize()) { |
| 848 | return BAD_VALUE; |
| 849 | } |
Mathias Agopian | 8b33f03 | 2012-07-24 20:43:54 -0700 | [diff] [blame] | 850 | DisplayState d; |
| 851 | Vector<DisplayState> displays; |
| 852 | displays.setCapacity(count); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 853 | for (size_t i = 0; i < count; i++) { |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 854 | if (d.read(data) == BAD_VALUE) { |
| 855 | return BAD_VALUE; |
| 856 | } |
Mathias Agopian | 8b33f03 | 2012-07-24 20:43:54 -0700 | [diff] [blame] | 857 | displays.add(d); |
| 858 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 859 | |
| 860 | uint32_t stateFlags = data.readUint32(); |
Marissa Wall | 713b63f | 2018-10-17 15:42:43 -0700 | [diff] [blame] | 861 | sp<IBinder> applyToken = data.readStrongBinder(); |
chaviw | 273171b | 2018-12-26 11:46:30 -0800 | [diff] [blame] | 862 | InputWindowCommands inputWindowCommands; |
| 863 | inputWindowCommands.read(data); |
Marissa Wall | 17b4e45 | 2018-12-26 16:32:34 -0800 | [diff] [blame] | 864 | |
| 865 | int64_t desiredPresentTime = data.readInt64(); |
| 866 | setTransactionState(state, displays, stateFlags, applyToken, inputWindowCommands, |
| 867 | desiredPresentTime); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 868 | return NO_ERROR; |
| 869 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 870 | case BOOT_FINISHED: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 871 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 872 | bootFinished(); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 873 | return NO_ERROR; |
| 874 | } |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 875 | case CAPTURE_SCREEN: { |
| 876 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 877 | sp<IBinder> display = data.readStrongBinder(); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 878 | ui::Dataspace reqDataspace = static_cast<ui::Dataspace>(data.readInt32()); |
| 879 | ui::PixelFormat reqPixelFormat = static_cast<ui::PixelFormat>(data.readInt32()); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 880 | sp<GraphicBuffer> outBuffer; |
Pablo Ceballos | 60d6922 | 2015-08-07 14:47:20 -0700 | [diff] [blame] | 881 | Rect sourceCrop(Rect::EMPTY_RECT); |
Dan Stoza | c187900 | 2014-05-22 15:59:05 -0700 | [diff] [blame] | 882 | data.read(sourceCrop); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 883 | uint32_t reqWidth = data.readUint32(); |
| 884 | uint32_t reqHeight = data.readUint32(); |
Dan Stoza | c701401 | 2014-02-14 15:03:43 -0800 | [diff] [blame] | 885 | bool useIdentityTransform = static_cast<bool>(data.readInt32()); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 886 | int32_t rotation = data.readInt32(); |
Dan Stoza | c701401 | 2014-02-14 15:03:43 -0800 | [diff] [blame] | 887 | |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 888 | status_t res = captureScreen(display, &outBuffer, reqDataspace, reqPixelFormat, |
| 889 | sourceCrop, reqWidth, reqHeight, useIdentityTransform, |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 890 | static_cast<ISurfaceComposer::Rotation>(rotation)); |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 891 | reply->writeInt32(res); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 892 | if (res == NO_ERROR) { |
| 893 | reply->write(*outBuffer); |
| 894 | } |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 895 | return NO_ERROR; |
| 896 | } |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 897 | case CAPTURE_LAYERS: { |
| 898 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 899 | sp<IBinder> layerHandleBinder = data.readStrongBinder(); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 900 | ui::Dataspace reqDataspace = static_cast<ui::Dataspace>(data.readInt32()); |
| 901 | ui::PixelFormat reqPixelFormat = static_cast<ui::PixelFormat>(data.readInt32()); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 902 | sp<GraphicBuffer> outBuffer; |
chaviw | 7206d49 | 2017-11-10 16:16:12 -0800 | [diff] [blame] | 903 | Rect sourceCrop(Rect::EMPTY_RECT); |
| 904 | data.read(sourceCrop); |
| 905 | float frameScale = data.readFloat(); |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame] | 906 | bool childrenOnly = data.readBool(); |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 907 | |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 908 | status_t res = captureLayers(layerHandleBinder, &outBuffer, reqDataspace, |
| 909 | reqPixelFormat, sourceCrop, frameScale, childrenOnly); |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 910 | reply->writeInt32(res); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 911 | if (res == NO_ERROR) { |
| 912 | reply->write(*outBuffer); |
| 913 | } |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 914 | return NO_ERROR; |
| 915 | } |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 916 | case AUTHENTICATE_SURFACE: { |
| 917 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Andy McFadden | 2adaf04 | 2012-12-18 09:49:45 -0800 | [diff] [blame] | 918 | sp<IGraphicBufferProducer> bufferProducer = |
| 919 | interface_cast<IGraphicBufferProducer>(data.readStrongBinder()); |
| 920 | int32_t result = authenticateSurfaceTexture(bufferProducer) ? 1 : 0; |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 921 | reply->writeInt32(result); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 922 | return NO_ERROR; |
| 923 | } |
Brian Anderson | 6b37671 | 2017-04-04 10:51:39 -0700 | [diff] [blame] | 924 | 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 Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 943 | case CREATE_DISPLAY_EVENT_CONNECTION: { |
| 944 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Jorim Jaggi | b1e2f8d | 2017-06-08 15:43:59 -0700 | [diff] [blame] | 945 | sp<IDisplayEventConnection> connection(createDisplayEventConnection( |
| 946 | static_cast<ISurfaceComposer::VsyncSource>(data.readInt32()))); |
Marco Nelissen | 2ea926b | 2014-11-14 08:01:01 -0800 | [diff] [blame] | 947 | reply->writeStrongBinder(IInterface::asBinder(connection)); |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 948 | return NO_ERROR; |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 949 | } |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 950 | case CREATE_DISPLAY: { |
| 951 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Andy McFadden | 8dfa92f | 2012-09-17 18:27:17 -0700 | [diff] [blame] | 952 | String8 displayName = data.readString8(); |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 953 | bool secure = bool(data.readInt32()); |
| 954 | sp<IBinder> display(createDisplay(displayName, secure)); |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 955 | reply->writeStrongBinder(display); |
| 956 | return NO_ERROR; |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 957 | } |
| 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 Laskowski | dcb38bb | 2019-01-25 02:35:50 -0800 | [diff] [blame] | 964 | case GET_PHYSICAL_DISPLAY_TOKEN: { |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 965 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Dominik Laskowski | dcb38bb | 2019-01-25 02:35:50 -0800 | [diff] [blame] | 966 | PhysicalDisplayId displayId = data.readUint64(); |
| 967 | sp<IBinder> display = getPhysicalDisplayToken(displayId); |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 968 | reply->writeStrongBinder(display); |
| 969 | return NO_ERROR; |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 970 | } |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 971 | case GET_DISPLAY_CONFIGS: { |
Mathias Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 972 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 973 | Vector<DisplayInfo> configs; |
Jeff Brown | 9d4e3d2 | 2012-08-24 20:00:51 -0700 | [diff] [blame] | 974 | sp<IBinder> display = data.readStrongBinder(); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 975 | status_t result = getDisplayConfigs(display, &configs); |
| 976 | reply->writeInt32(result); |
| 977 | if (result == NO_ERROR) { |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 978 | reply->writeUint32(static_cast<uint32_t>(configs.size())); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 979 | 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 Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 986 | 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 Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 998 | 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 Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 1010 | reply->writeInt32(result); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 1011 | return NO_ERROR; |
| 1012 | } |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 1013 | case GET_DISPLAY_COLOR_MODES: { |
| 1014 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 1015 | Vector<ColorMode> colorModes; |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 1016 | 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 1027 | reply->writeInt32(static_cast<int32_t>(colorModes[i])); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 1028 | } |
| 1029 | } |
| 1030 | return NO_ERROR; |
| 1031 | } |
Daniel Solomon | 42d0456 | 2019-01-20 21:03:19 -0800 | [diff] [blame] | 1032 | 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 Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 1052 | 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 1060 | ColorMode colorMode = getActiveColorMode(display); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 1061 | 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 Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 1079 | static_cast<ColorMode>(colorModeInt)); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 1080 | result = reply->writeInt32(result); |
| 1081 | return result; |
| 1082 | } |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 1083 | 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 Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 1097 | 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 Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 1104 | 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 Agopian | e1f5e6f | 2017-02-06 16:34:41 -0800 | [diff] [blame] | 1117 | reply->write(capabilities); |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 1118 | } |
| 1119 | return NO_ERROR; |
| 1120 | } |
Sahil Dhanju | c1ba5c4 | 2016-06-07 20:09:20 -0700 | [diff] [blame] | 1121 | 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 Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 1141 | 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 Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 1152 | case GET_COMPOSITION_PREFERENCE: { |
| 1153 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Peiyong Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame] | 1154 | 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 Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 1161 | reply->writeInt32(error); |
| 1162 | if (error == NO_ERROR) { |
Peiyong Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame] | 1163 | reply->writeInt32(static_cast<int32_t>(defaultDataspace)); |
| 1164 | reply->writeInt32(static_cast<int32_t>(defaultPixelFormat)); |
| 1165 | reply->writeInt32(static_cast<int32_t>(wideColorGamutDataspace)); |
Peiyong Lin | aa3da6a | 2018-12-12 02:48:43 -0800 | [diff] [blame] | 1166 | reply->writeInt32(static_cast<int32_t>(wideColorGamutPixelFormat)); |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 1167 | } |
Peiyong Lin | 3c2791e | 2019-01-14 17:05:18 -0800 | [diff] [blame] | 1168 | return error; |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 1169 | } |
Ady Abraham | 37965d4 | 2018-11-01 13:43:32 -0700 | [diff] [blame] | 1170 | case GET_COLOR_MANAGEMENT: { |
Ady Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 1171 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Ady Abraham | 37965d4 | 2018-11-01 13:43:32 -0700 | [diff] [blame] | 1172 | bool result; |
| 1173 | status_t error = getColorManagement(&result); |
| 1174 | if (error == NO_ERROR) { |
| 1175 | reply->writeBool(result); |
| 1176 | } |
Peiyong Lin | 3c2791e | 2019-01-14 17:05:18 -0800 | [diff] [blame] | 1177 | return error; |
Ady Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 1178 | } |
Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 1179 | 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 DuBois | 74e5377 | 2018-11-19 10:52:38 -0800 | [diff] [blame] | 1195 | 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 DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 1231 | 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(×tamp); |
| 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 DuBois | 1d4c6a6 | 2018-12-12 13:59:46 -0800 | [diff] [blame] | 1254 | 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 DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 1258 | } |
| 1259 | return result; |
| 1260 | } |
Peiyong Lin | 3c2791e | 2019-01-14 17:05:18 -0800 | [diff] [blame] | 1261 | 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 Lin | 4f3fddf | 2019-01-24 17:21:24 -0800 | [diff] [blame] | 1270 | 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 Laskowski | dcb38bb | 2019-01-25 02:35:50 -0800 | [diff] [blame] | 1284 | case GET_PHYSICAL_DISPLAY_IDS: { |
| 1285 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 1286 | return reply->writeUint64Vector(getPhysicalDisplayIds()); |
| 1287 | } |
Dan Stoza | 84ab937 | 2018-12-17 15:27:57 -0800 | [diff] [blame^] | 1288 | 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 Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 1320 | default: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 1321 | return BBinder::onTransact(code, data, reply, flags); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 1322 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1323 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1324 | } |
| 1325 | |
Dominik Laskowski | dcb38bb | 2019-01-25 02:35:50 -0800 | [diff] [blame] | 1326 | } // namespace android |