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> |
Mathias Agopian | 2b5dd40 | 2017-02-07 17:36:19 -0800 | [diff] [blame] | 29 | #include <gui/ISurfaceComposer.h> |
| 30 | #include <gui/ISurfaceComposerClient.h> |
Kalle Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 31 | #include <gui/LayerDebugInfo.h> |
Robert Carr | 4cdc58f | 2017-08-23 14:22:20 -0700 | [diff] [blame] | 32 | #include <gui/LayerState.h> |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 33 | |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 34 | #include <system/graphics.h> |
| 35 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | #include <ui/DisplayInfo.h> |
Lajos Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 37 | #include <ui/DisplayStatInfo.h> |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 38 | #include <ui/HdrCapabilities.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 40 | #include <utils/Log.h> |
Mathias Agopian | 9cce325 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 41 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | // --------------------------------------------------------------------------- |
| 43 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | namespace android { |
| 45 | |
Peiyong Lin | 9f03447 | 2018-03-28 15:29:00 -0700 | [diff] [blame] | 46 | using ui::ColorMode; |
| 47 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | class BpSurfaceComposer : public BpInterface<ISurfaceComposer> |
| 49 | { |
| 50 | public: |
Chih-Hung Hsieh | e2347b7 | 2016-04-25 15:41:05 -0700 | [diff] [blame] | 51 | explicit BpSurfaceComposer(const sp<IBinder>& impl) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | : BpInterface<ISurfaceComposer>(impl) |
| 53 | { |
| 54 | } |
| 55 | |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 56 | virtual ~BpSurfaceComposer(); |
| 57 | |
Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 58 | virtual sp<ISurfaceComposerClient> createConnection() |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 59 | { |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | Parcel data, reply; |
| 61 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 62 | remote()->transact(BnSurfaceComposer::CREATE_CONNECTION, data, &reply); |
Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 63 | return interface_cast<ISurfaceComposerClient>(reply.readStrongBinder()); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 64 | } |
| 65 | |
Robert Carr | 1db73f6 | 2016-12-21 12:58:51 -0800 | [diff] [blame] | 66 | virtual sp<ISurfaceComposerClient> createScopedConnection( |
| 67 | const sp<IGraphicBufferProducer>& parent) |
| 68 | { |
| 69 | Parcel data, reply; |
| 70 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 71 | data.writeStrongBinder(IInterface::asBinder(parent)); |
| 72 | remote()->transact(BnSurfaceComposer::CREATE_SCOPED_CONNECTION, data, &reply); |
| 73 | return interface_cast<ISurfaceComposerClient>(reply.readStrongBinder()); |
| 74 | } |
| 75 | |
Mathias Agopian | 8b33f03 | 2012-07-24 20:43:54 -0700 | [diff] [blame] | 76 | virtual void setTransactionState( |
| 77 | const Vector<ComposerState>& state, |
| 78 | const Vector<DisplayState>& displays, |
| 79 | uint32_t flags) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | { |
| 81 | Parcel data, reply; |
| 82 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 83 | |
| 84 | data.writeUint32(static_cast<uint32_t>(state.size())); |
| 85 | for (const auto& s : state) { |
| 86 | s.write(data); |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 87 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 88 | |
| 89 | data.writeUint32(static_cast<uint32_t>(displays.size())); |
| 90 | for (const auto& d : displays) { |
| 91 | d.write(data); |
Mathias Agopian | 8b33f03 | 2012-07-24 20:43:54 -0700 | [diff] [blame] | 92 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 93 | |
| 94 | data.writeUint32(flags); |
Jamie Gennis | b8d69a5 | 2011-10-10 15:48:06 -0700 | [diff] [blame] | 95 | remote()->transact(BnSurfaceComposer::SET_TRANSACTION_STATE, data, &reply); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | virtual void bootFinished() |
| 99 | { |
| 100 | Parcel data, reply; |
| 101 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 102 | remote()->transact(BnSurfaceComposer::BOOT_FINISHED, data, &reply); |
| 103 | } |
| 104 | |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 105 | virtual status_t captureScreen(const sp<IBinder>& display, sp<GraphicBuffer>* outBuffer, |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 106 | const ui::Dataspace reqDataspace, |
| 107 | const ui::PixelFormat reqPixelFormat, Rect sourceCrop, |
| 108 | uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform, |
| 109 | ISurfaceComposer::Rotation rotation) { |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 110 | Parcel data, reply; |
| 111 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 112 | data.writeStrongBinder(display); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 113 | data.writeInt32(static_cast<int32_t>(reqDataspace)); |
| 114 | data.writeInt32(static_cast<int32_t>(reqPixelFormat)); |
Dan Stoza | c187900 | 2014-05-22 15:59:05 -0700 | [diff] [blame] | 115 | data.write(sourceCrop); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 116 | data.writeUint32(reqWidth); |
| 117 | data.writeUint32(reqHeight); |
Dan Stoza | c701401 | 2014-02-14 15:03:43 -0800 | [diff] [blame] | 118 | data.writeInt32(static_cast<int32_t>(useIdentityTransform)); |
Riley Andrews | c3ebe66 | 2014-09-04 16:20:31 -0700 | [diff] [blame] | 119 | data.writeInt32(static_cast<int32_t>(rotation)); |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 120 | status_t result = remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN, data, &reply); |
| 121 | if (result != NO_ERROR) { |
| 122 | ALOGE("captureScreen failed to transact: %d", result); |
| 123 | return result; |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 124 | } |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 125 | result = reply.readInt32(); |
| 126 | if (result != NO_ERROR) { |
| 127 | ALOGE("captureScreen failed to readInt32: %d", result); |
| 128 | return result; |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | *outBuffer = new GraphicBuffer(); |
| 132 | reply.read(**outBuffer); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 133 | |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 134 | return result; |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 135 | } |
| 136 | |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 137 | virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 138 | sp<GraphicBuffer>* outBuffer, const ui::Dataspace reqDataspace, |
| 139 | const ui::PixelFormat reqPixelFormat, const Rect& sourceCrop, |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame] | 140 | float frameScale, bool childrenOnly) { |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 141 | Parcel data, reply; |
| 142 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 143 | data.writeStrongBinder(layerHandleBinder); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 144 | data.writeInt32(static_cast<int32_t>(reqDataspace)); |
| 145 | data.writeInt32(static_cast<int32_t>(reqPixelFormat)); |
chaviw | 7206d49 | 2017-11-10 16:16:12 -0800 | [diff] [blame] | 146 | data.write(sourceCrop); |
| 147 | data.writeFloat(frameScale); |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame] | 148 | data.writeBool(childrenOnly); |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 149 | status_t result = remote()->transact(BnSurfaceComposer::CAPTURE_LAYERS, data, &reply); |
| 150 | if (result != NO_ERROR) { |
| 151 | ALOGE("captureLayers failed to transact: %d", result); |
| 152 | return result; |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 153 | } |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 154 | result = reply.readInt32(); |
| 155 | if (result != NO_ERROR) { |
| 156 | ALOGE("captureLayers failed to readInt32: %d", result); |
| 157 | return result; |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 158 | } |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 159 | |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 160 | *outBuffer = new GraphicBuffer(); |
| 161 | reply.read(**outBuffer); |
| 162 | |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 163 | return result; |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 164 | } |
| 165 | |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 166 | virtual bool authenticateSurfaceTexture( |
Andy McFadden | 2adaf04 | 2012-12-18 09:49:45 -0800 | [diff] [blame] | 167 | const sp<IGraphicBufferProducer>& bufferProducer) const |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 168 | { |
| 169 | Parcel data, reply; |
| 170 | int err = NO_ERROR; |
| 171 | err = data.writeInterfaceToken( |
| 172 | ISurfaceComposer::getInterfaceDescriptor()); |
| 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 | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 175 | "interface descriptor: %s (%d)", strerror(-err), -err); |
| 176 | return false; |
| 177 | } |
Marco Nelissen | 2ea926b | 2014-11-14 08:01:01 -0800 | [diff] [blame] | 178 | err = data.writeStrongBinder(IInterface::asBinder(bufferProducer)); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 179 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 180 | ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 181 | "strong binder to parcel: %s (%d)", strerror(-err), -err); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 182 | return false; |
| 183 | } |
| 184 | err = remote()->transact(BnSurfaceComposer::AUTHENTICATE_SURFACE, data, |
| 185 | &reply); |
| 186 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 187 | ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 188 | "performing transaction: %s (%d)", strerror(-err), -err); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 189 | return false; |
| 190 | } |
| 191 | int32_t result = 0; |
| 192 | err = reply.readInt32(&result); |
| 193 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 194 | ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 195 | "retrieving result: %s (%d)", strerror(-err), -err); |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 196 | return false; |
| 197 | } |
| 198 | return result != 0; |
| 199 | } |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 200 | |
Brian Anderson | 6b37671 | 2017-04-04 10:51:39 -0700 | [diff] [blame] | 201 | virtual status_t getSupportedFrameTimestamps( |
| 202 | std::vector<FrameEvent>* outSupported) const { |
| 203 | if (!outSupported) { |
| 204 | return UNEXPECTED_NULL; |
| 205 | } |
| 206 | outSupported->clear(); |
| 207 | |
| 208 | Parcel data, reply; |
| 209 | |
| 210 | status_t err = data.writeInterfaceToken( |
| 211 | ISurfaceComposer::getInterfaceDescriptor()); |
| 212 | if (err != NO_ERROR) { |
| 213 | return err; |
| 214 | } |
| 215 | |
| 216 | err = remote()->transact( |
| 217 | BnSurfaceComposer::GET_SUPPORTED_FRAME_TIMESTAMPS, |
| 218 | data, &reply); |
| 219 | if (err != NO_ERROR) { |
| 220 | return err; |
| 221 | } |
| 222 | |
| 223 | int32_t result = 0; |
| 224 | err = reply.readInt32(&result); |
| 225 | if (err != NO_ERROR) { |
| 226 | return err; |
| 227 | } |
| 228 | if (result != NO_ERROR) { |
| 229 | return result; |
| 230 | } |
| 231 | |
| 232 | std::vector<int32_t> supported; |
| 233 | err = reply.readInt32Vector(&supported); |
| 234 | if (err != NO_ERROR) { |
| 235 | return err; |
| 236 | } |
| 237 | |
| 238 | outSupported->reserve(supported.size()); |
| 239 | for (int32_t s : supported) { |
| 240 | outSupported->push_back(static_cast<FrameEvent>(s)); |
| 241 | } |
| 242 | return NO_ERROR; |
| 243 | } |
| 244 | |
Jorim Jaggi | b1e2f8d | 2017-06-08 15:43:59 -0700 | [diff] [blame] | 245 | virtual sp<IDisplayEventConnection> createDisplayEventConnection(VsyncSource vsyncSource) |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 246 | { |
| 247 | Parcel data, reply; |
| 248 | sp<IDisplayEventConnection> result; |
| 249 | int err = data.writeInterfaceToken( |
| 250 | ISurfaceComposer::getInterfaceDescriptor()); |
| 251 | if (err != NO_ERROR) { |
| 252 | return result; |
| 253 | } |
Jorim Jaggi | b1e2f8d | 2017-06-08 15:43:59 -0700 | [diff] [blame] | 254 | data.writeInt32(static_cast<int32_t>(vsyncSource)); |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 255 | err = remote()->transact( |
| 256 | BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION, |
| 257 | data, &reply); |
| 258 | if (err != NO_ERROR) { |
Steve Block | e6f43dd | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 259 | ALOGE("ISurfaceComposer::createDisplayEventConnection: error performing " |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 260 | "transaction: %s (%d)", strerror(-err), -err); |
| 261 | return result; |
| 262 | } |
| 263 | result = interface_cast<IDisplayEventConnection>(reply.readStrongBinder()); |
| 264 | return result; |
| 265 | } |
Colin Cross | 8e53306 | 2012-06-07 13:17:52 -0700 | [diff] [blame] | 266 | |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 267 | virtual sp<IBinder> createDisplay(const String8& displayName, bool secure) |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 268 | { |
| 269 | Parcel data, reply; |
| 270 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Andy McFadden | 8dfa92f | 2012-09-17 18:27:17 -0700 | [diff] [blame] | 271 | data.writeString8(displayName); |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 272 | data.writeInt32(secure ? 1 : 0); |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 273 | remote()->transact(BnSurfaceComposer::CREATE_DISPLAY, data, &reply); |
| 274 | return reply.readStrongBinder(); |
| 275 | } |
| 276 | |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 277 | virtual void destroyDisplay(const sp<IBinder>& display) |
| 278 | { |
| 279 | Parcel data, reply; |
| 280 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 281 | data.writeStrongBinder(display); |
| 282 | remote()->transact(BnSurfaceComposer::DESTROY_DISPLAY, data, &reply); |
| 283 | } |
| 284 | |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 285 | virtual sp<IBinder> getBuiltInDisplay(int32_t id) |
| 286 | { |
| 287 | Parcel data, reply; |
| 288 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 289 | data.writeInt32(id); |
| 290 | remote()->transact(BnSurfaceComposer::GET_BUILT_IN_DISPLAY, data, &reply); |
| 291 | return reply.readStrongBinder(); |
| 292 | } |
| 293 | |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 294 | virtual void setPowerMode(const sp<IBinder>& display, int mode) |
Colin Cross | 8e53306 | 2012-06-07 13:17:52 -0700 | [diff] [blame] | 295 | { |
| 296 | Parcel data, reply; |
| 297 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Andy McFadden | c01a79d | 2012-09-27 16:02:06 -0700 | [diff] [blame] | 298 | data.writeStrongBinder(display); |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 299 | data.writeInt32(mode); |
| 300 | remote()->transact(BnSurfaceComposer::SET_POWER_MODE, data, &reply); |
Colin Cross | 8e53306 | 2012-06-07 13:17:52 -0700 | [diff] [blame] | 301 | } |
Mathias Agopian | 3094df3 | 2012-06-18 18:06:45 -0700 | [diff] [blame] | 302 | |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 303 | virtual status_t getDisplayConfigs(const sp<IBinder>& display, |
| 304 | Vector<DisplayInfo>* configs) |
Mathias Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 305 | { |
| 306 | Parcel data, reply; |
| 307 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
Jeff Brown | 9d4e3d2 | 2012-08-24 20:00:51 -0700 | [diff] [blame] | 308 | data.writeStrongBinder(display); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 309 | remote()->transact(BnSurfaceComposer::GET_DISPLAY_CONFIGS, data, &reply); |
| 310 | status_t result = reply.readInt32(); |
| 311 | if (result == NO_ERROR) { |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 312 | size_t numConfigs = reply.readUint32(); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 313 | configs->clear(); |
| 314 | configs->resize(numConfigs); |
| 315 | for (size_t c = 0; c < numConfigs; ++c) { |
| 316 | memcpy(&(configs->editItemAt(c)), |
| 317 | reply.readInplace(sizeof(DisplayInfo)), |
| 318 | sizeof(DisplayInfo)); |
| 319 | } |
| 320 | } |
| 321 | return result; |
| 322 | } |
| 323 | |
Lajos Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 324 | virtual status_t getDisplayStats(const sp<IBinder>& display, |
| 325 | DisplayStatInfo* stats) |
| 326 | { |
| 327 | Parcel data, reply; |
| 328 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 329 | data.writeStrongBinder(display); |
| 330 | remote()->transact(BnSurfaceComposer::GET_DISPLAY_STATS, data, &reply); |
| 331 | status_t result = reply.readInt32(); |
| 332 | if (result == NO_ERROR) { |
| 333 | memcpy(stats, |
| 334 | reply.readInplace(sizeof(DisplayStatInfo)), |
| 335 | sizeof(DisplayStatInfo)); |
| 336 | } |
| 337 | return result; |
| 338 | } |
| 339 | |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 340 | virtual int getActiveConfig(const sp<IBinder>& display) |
| 341 | { |
| 342 | Parcel data, reply; |
| 343 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 344 | data.writeStrongBinder(display); |
| 345 | remote()->transact(BnSurfaceComposer::GET_ACTIVE_CONFIG, data, &reply); |
| 346 | return reply.readInt32(); |
| 347 | } |
| 348 | |
| 349 | virtual status_t setActiveConfig(const sp<IBinder>& display, int id) |
| 350 | { |
| 351 | Parcel data, reply; |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 352 | status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 353 | if (result != NO_ERROR) { |
| 354 | ALOGE("setActiveConfig failed to writeInterfaceToken: %d", result); |
| 355 | return result; |
| 356 | } |
| 357 | result = data.writeStrongBinder(display); |
| 358 | if (result != NO_ERROR) { |
| 359 | ALOGE("setActiveConfig failed to writeStrongBinder: %d", result); |
| 360 | return result; |
| 361 | } |
| 362 | result = data.writeInt32(id); |
| 363 | if (result != NO_ERROR) { |
| 364 | ALOGE("setActiveConfig failed to writeInt32: %d", result); |
| 365 | return result; |
| 366 | } |
| 367 | result = remote()->transact(BnSurfaceComposer::SET_ACTIVE_CONFIG, data, &reply); |
| 368 | if (result != NO_ERROR) { |
| 369 | ALOGE("setActiveConfig failed to transact: %d", result); |
| 370 | return result; |
| 371 | } |
Mathias Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 372 | return reply.readInt32(); |
| 373 | } |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 374 | |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 375 | virtual status_t getDisplayColorModes(const sp<IBinder>& display, |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 376 | Vector<ColorMode>* outColorModes) { |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 377 | Parcel data, reply; |
| 378 | status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 379 | if (result != NO_ERROR) { |
| 380 | ALOGE("getDisplayColorModes failed to writeInterfaceToken: %d", result); |
| 381 | return result; |
| 382 | } |
| 383 | result = data.writeStrongBinder(display); |
| 384 | if (result != NO_ERROR) { |
| 385 | ALOGE("getDisplayColorModes failed to writeStrongBinder: %d", result); |
| 386 | return result; |
| 387 | } |
| 388 | result = remote()->transact(BnSurfaceComposer::GET_DISPLAY_COLOR_MODES, data, &reply); |
| 389 | if (result != NO_ERROR) { |
| 390 | ALOGE("getDisplayColorModes failed to transact: %d", result); |
| 391 | return result; |
| 392 | } |
| 393 | result = static_cast<status_t>(reply.readInt32()); |
| 394 | if (result == NO_ERROR) { |
| 395 | size_t numModes = reply.readUint32(); |
| 396 | outColorModes->clear(); |
| 397 | outColorModes->resize(numModes); |
| 398 | for (size_t i = 0; i < numModes; ++i) { |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 399 | outColorModes->replaceAt(static_cast<ColorMode>(reply.readInt32()), i); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 400 | } |
| 401 | } |
| 402 | return result; |
| 403 | } |
| 404 | |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 405 | virtual ColorMode getActiveColorMode(const sp<IBinder>& display) { |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 406 | Parcel data, reply; |
| 407 | status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 408 | if (result != NO_ERROR) { |
| 409 | ALOGE("getActiveColorMode failed to writeInterfaceToken: %d", result); |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 410 | return static_cast<ColorMode>(result); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 411 | } |
| 412 | result = data.writeStrongBinder(display); |
| 413 | if (result != NO_ERROR) { |
| 414 | ALOGE("getActiveColorMode failed to writeStrongBinder: %d", result); |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 415 | return static_cast<ColorMode>(result); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 416 | } |
| 417 | result = remote()->transact(BnSurfaceComposer::GET_ACTIVE_COLOR_MODE, data, &reply); |
| 418 | if (result != NO_ERROR) { |
| 419 | ALOGE("getActiveColorMode failed to transact: %d", result); |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 420 | return static_cast<ColorMode>(result); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 421 | } |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 422 | return static_cast<ColorMode>(reply.readInt32()); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 423 | } |
| 424 | |
| 425 | virtual status_t setActiveColorMode(const sp<IBinder>& display, |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 426 | ColorMode colorMode) { |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 427 | Parcel data, reply; |
| 428 | status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 429 | if (result != NO_ERROR) { |
| 430 | ALOGE("setActiveColorMode failed to writeInterfaceToken: %d", result); |
| 431 | return result; |
| 432 | } |
| 433 | result = data.writeStrongBinder(display); |
| 434 | if (result != NO_ERROR) { |
| 435 | ALOGE("setActiveColorMode failed to writeStrongBinder: %d", result); |
| 436 | return result; |
| 437 | } |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 438 | result = data.writeInt32(static_cast<int32_t>(colorMode)); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 439 | if (result != NO_ERROR) { |
| 440 | ALOGE("setActiveColorMode failed to writeInt32: %d", result); |
| 441 | return result; |
| 442 | } |
| 443 | result = remote()->transact(BnSurfaceComposer::SET_ACTIVE_COLOR_MODE, data, &reply); |
| 444 | if (result != NO_ERROR) { |
| 445 | ALOGE("setActiveColorMode failed to transact: %d", result); |
| 446 | return result; |
| 447 | } |
| 448 | return static_cast<status_t>(reply.readInt32()); |
| 449 | } |
| 450 | |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 451 | virtual status_t clearAnimationFrameStats() { |
| 452 | Parcel data, reply; |
Ana Krulec | 2d41e42 | 2018-07-26 12:07:43 -0700 | [diff] [blame] | 453 | status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 454 | if (result != NO_ERROR) { |
| 455 | ALOGE("clearAnimationFrameStats failed to writeInterfaceToken: %d", result); |
| 456 | return result; |
| 457 | } |
| 458 | result = remote()->transact(BnSurfaceComposer::CLEAR_ANIMATION_FRAME_STATS, data, &reply); |
| 459 | if (result != NO_ERROR) { |
| 460 | ALOGE("clearAnimationFrameStats failed to transact: %d", result); |
| 461 | return result; |
| 462 | } |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 463 | return reply.readInt32(); |
| 464 | } |
| 465 | |
| 466 | virtual status_t getAnimationFrameStats(FrameStats* outStats) const { |
| 467 | Parcel data, reply; |
| 468 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 469 | remote()->transact(BnSurfaceComposer::GET_ANIMATION_FRAME_STATS, data, &reply); |
| 470 | reply.read(*outStats); |
| 471 | return reply.readInt32(); |
| 472 | } |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 473 | |
| 474 | virtual status_t getHdrCapabilities(const sp<IBinder>& display, |
| 475 | HdrCapabilities* outCapabilities) const { |
| 476 | Parcel data, reply; |
| 477 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 478 | status_t result = data.writeStrongBinder(display); |
| 479 | if (result != NO_ERROR) { |
| 480 | ALOGE("getHdrCapabilities failed to writeStrongBinder: %d", result); |
| 481 | return result; |
| 482 | } |
| 483 | result = remote()->transact(BnSurfaceComposer::GET_HDR_CAPABILITIES, |
| 484 | data, &reply); |
| 485 | if (result != NO_ERROR) { |
| 486 | ALOGE("getHdrCapabilities failed to transact: %d", result); |
| 487 | return result; |
| 488 | } |
| 489 | result = reply.readInt32(); |
| 490 | if (result == NO_ERROR) { |
Mathias Agopian | e1f5e6f | 2017-02-06 16:34:41 -0800 | [diff] [blame] | 491 | result = reply.read(*outCapabilities); |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 492 | } |
| 493 | return result; |
| 494 | } |
Sahil Dhanju | c1ba5c4 | 2016-06-07 20:09:20 -0700 | [diff] [blame] | 495 | |
| 496 | virtual status_t enableVSyncInjections(bool enable) { |
| 497 | Parcel data, reply; |
| 498 | status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 499 | if (result != NO_ERROR) { |
| 500 | ALOGE("enableVSyncInjections failed to writeInterfaceToken: %d", result); |
| 501 | return result; |
| 502 | } |
| 503 | result = data.writeBool(enable); |
| 504 | if (result != NO_ERROR) { |
| 505 | ALOGE("enableVSyncInjections failed to writeBool: %d", result); |
| 506 | return result; |
| 507 | } |
| 508 | result = remote()->transact(BnSurfaceComposer::ENABLE_VSYNC_INJECTIONS, |
| 509 | data, &reply, TF_ONE_WAY); |
| 510 | if (result != NO_ERROR) { |
| 511 | ALOGE("enableVSyncInjections failed to transact: %d", result); |
| 512 | return result; |
| 513 | } |
| 514 | return result; |
| 515 | } |
| 516 | |
| 517 | virtual status_t injectVSync(nsecs_t when) { |
| 518 | Parcel data, reply; |
| 519 | status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 520 | if (result != NO_ERROR) { |
| 521 | ALOGE("injectVSync failed to writeInterfaceToken: %d", result); |
| 522 | return result; |
| 523 | } |
| 524 | result = data.writeInt64(when); |
| 525 | if (result != NO_ERROR) { |
| 526 | ALOGE("injectVSync failed to writeInt64: %d", result); |
| 527 | return result; |
| 528 | } |
| 529 | result = remote()->transact(BnSurfaceComposer::INJECT_VSYNC, data, &reply, TF_ONE_WAY); |
| 530 | if (result != NO_ERROR) { |
| 531 | ALOGE("injectVSync failed to transact: %d", result); |
| 532 | return result; |
| 533 | } |
| 534 | return result; |
| 535 | } |
| 536 | |
Kalle Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 537 | virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const |
| 538 | { |
| 539 | if (!outLayers) { |
| 540 | return UNEXPECTED_NULL; |
| 541 | } |
| 542 | |
| 543 | Parcel data, reply; |
| 544 | |
| 545 | status_t err = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 546 | if (err != NO_ERROR) { |
| 547 | return err; |
| 548 | } |
| 549 | |
| 550 | err = remote()->transact(BnSurfaceComposer::GET_LAYER_DEBUG_INFO, data, &reply); |
| 551 | if (err != NO_ERROR) { |
| 552 | return err; |
| 553 | } |
| 554 | |
| 555 | int32_t result = 0; |
| 556 | err = reply.readInt32(&result); |
| 557 | if (err != NO_ERROR) { |
| 558 | return err; |
| 559 | } |
| 560 | if (result != NO_ERROR) { |
| 561 | return result; |
| 562 | } |
| 563 | |
| 564 | outLayers->clear(); |
| 565 | return reply.readParcelableVector(outLayers); |
| 566 | } |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 567 | |
Peiyong Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame^] | 568 | virtual status_t getCompositionPreference(ui::Dataspace* defaultDataspace, |
| 569 | ui::PixelFormat* defaultPixelFormat, |
| 570 | ui::Dataspace* wideColorGamutDataspace, |
| 571 | ui::PixelFormat* wideColorGamutPixelFormat) const { |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 572 | Parcel data, reply; |
| 573 | status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 574 | if (error != NO_ERROR) { |
| 575 | return error; |
| 576 | } |
| 577 | error = remote()->transact(BnSurfaceComposer::GET_COMPOSITION_PREFERENCE, data, &reply); |
| 578 | if (error != NO_ERROR) { |
| 579 | return error; |
| 580 | } |
| 581 | error = static_cast<status_t>(reply.readInt32()); |
| 582 | if (error == NO_ERROR) { |
Peiyong Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame^] | 583 | *defaultDataspace = static_cast<ui::Dataspace>(reply.readInt32()); |
| 584 | *defaultPixelFormat = static_cast<ui::PixelFormat>(reply.readInt32()); |
| 585 | *wideColorGamutDataspace = static_cast<ui::Dataspace>(reply.readInt32()); |
| 586 | *wideColorGamutPixelFormat = static_cast<ui::PixelFormat>(reply.readInt32()); |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 587 | } |
| 588 | return error; |
| 589 | } |
Ady Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 590 | |
| 591 | virtual bool isColorManagementUsed() const { |
| 592 | Parcel data, reply; |
| 593 | data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); |
| 594 | remote()->transact(BnSurfaceComposer::IS_COLOR_MANAGEMET_USED, data, &reply); |
| 595 | int32_t result = 0; |
| 596 | status_t err = reply.readInt32(&result); |
| 597 | if (err != NO_ERROR) { |
| 598 | ALOGE("ISurfaceComposer::isColorManagementUsed: error " |
| 599 | "retrieving result: %s (%d)", |
| 600 | strerror(-err), -err); |
| 601 | return false; |
| 602 | } |
| 603 | return result != 0; |
| 604 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 605 | }; |
| 606 | |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 607 | // Out-of-line virtual method definition to trigger vtable emission in this |
| 608 | // translation unit (see clang warning -Wweak-vtables) |
| 609 | BpSurfaceComposer::~BpSurfaceComposer() {} |
| 610 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 611 | IMPLEMENT_META_INTERFACE(SurfaceComposer, "android.ui.ISurfaceComposer"); |
| 612 | |
| 613 | // ---------------------------------------------------------------------- |
| 614 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 615 | status_t BnSurfaceComposer::onTransact( |
| 616 | uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) |
| 617 | { |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 618 | switch(code) { |
| 619 | case CREATE_CONNECTION: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 620 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Marco Nelissen | 2ea926b | 2014-11-14 08:01:01 -0800 | [diff] [blame] | 621 | sp<IBinder> b = IInterface::asBinder(createConnection()); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 622 | reply->writeStrongBinder(b); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 623 | return NO_ERROR; |
| 624 | } |
Robert Carr | 1db73f6 | 2016-12-21 12:58:51 -0800 | [diff] [blame] | 625 | case CREATE_SCOPED_CONNECTION: { |
| 626 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 627 | sp<IGraphicBufferProducer> bufferProducer = |
| 628 | interface_cast<IGraphicBufferProducer>(data.readStrongBinder()); |
| 629 | sp<IBinder> b = IInterface::asBinder(createScopedConnection(bufferProducer)); |
| 630 | reply->writeStrongBinder(b); |
| 631 | return NO_ERROR; |
| 632 | } |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 633 | case SET_TRANSACTION_STATE: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 634 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 635 | |
| 636 | size_t count = data.readUint32(); |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 637 | if (count > data.dataSize()) { |
| 638 | return BAD_VALUE; |
| 639 | } |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 640 | ComposerState s; |
| 641 | Vector<ComposerState> state; |
| 642 | state.setCapacity(count); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 643 | for (size_t i = 0; i < count; i++) { |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 644 | if (s.read(data) == BAD_VALUE) { |
| 645 | return BAD_VALUE; |
| 646 | } |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 647 | state.add(s); |
| 648 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 649 | |
| 650 | count = data.readUint32(); |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 651 | if (count > data.dataSize()) { |
| 652 | return BAD_VALUE; |
| 653 | } |
Mathias Agopian | 8b33f03 | 2012-07-24 20:43:54 -0700 | [diff] [blame] | 654 | DisplayState d; |
| 655 | Vector<DisplayState> displays; |
| 656 | displays.setCapacity(count); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 657 | for (size_t i = 0; i < count; i++) { |
Michael Lentine | 8afa1c4 | 2014-10-31 11:10:13 -0700 | [diff] [blame] | 658 | if (d.read(data) == BAD_VALUE) { |
| 659 | return BAD_VALUE; |
| 660 | } |
Mathias Agopian | 8b33f03 | 2012-07-24 20:43:54 -0700 | [diff] [blame] | 661 | displays.add(d); |
| 662 | } |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 663 | |
| 664 | uint32_t stateFlags = data.readUint32(); |
| 665 | setTransactionState(state, displays, stateFlags); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 666 | return NO_ERROR; |
| 667 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 668 | case BOOT_FINISHED: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 669 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 670 | bootFinished(); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 671 | return NO_ERROR; |
| 672 | } |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 673 | case CAPTURE_SCREEN: { |
| 674 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 675 | sp<IBinder> display = data.readStrongBinder(); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 676 | ui::Dataspace reqDataspace = static_cast<ui::Dataspace>(data.readInt32()); |
| 677 | ui::PixelFormat reqPixelFormat = static_cast<ui::PixelFormat>(data.readInt32()); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 678 | sp<GraphicBuffer> outBuffer; |
Pablo Ceballos | 60d6922 | 2015-08-07 14:47:20 -0700 | [diff] [blame] | 679 | Rect sourceCrop(Rect::EMPTY_RECT); |
Dan Stoza | c187900 | 2014-05-22 15:59:05 -0700 | [diff] [blame] | 680 | data.read(sourceCrop); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 681 | uint32_t reqWidth = data.readUint32(); |
| 682 | uint32_t reqHeight = data.readUint32(); |
Dan Stoza | c701401 | 2014-02-14 15:03:43 -0800 | [diff] [blame] | 683 | bool useIdentityTransform = static_cast<bool>(data.readInt32()); |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 684 | int32_t rotation = data.readInt32(); |
Dan Stoza | c701401 | 2014-02-14 15:03:43 -0800 | [diff] [blame] | 685 | |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 686 | status_t res = captureScreen(display, &outBuffer, reqDataspace, reqPixelFormat, |
| 687 | sourceCrop, reqWidth, reqHeight, useIdentityTransform, |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 688 | static_cast<ISurfaceComposer::Rotation>(rotation)); |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 689 | reply->writeInt32(res); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 690 | if (res == NO_ERROR) { |
| 691 | reply->write(*outBuffer); |
| 692 | } |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 693 | return NO_ERROR; |
| 694 | } |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 695 | case CAPTURE_LAYERS: { |
| 696 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 697 | sp<IBinder> layerHandleBinder = data.readStrongBinder(); |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 698 | ui::Dataspace reqDataspace = static_cast<ui::Dataspace>(data.readInt32()); |
| 699 | ui::PixelFormat reqPixelFormat = static_cast<ui::PixelFormat>(data.readInt32()); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 700 | sp<GraphicBuffer> outBuffer; |
chaviw | 7206d49 | 2017-11-10 16:16:12 -0800 | [diff] [blame] | 701 | Rect sourceCrop(Rect::EMPTY_RECT); |
| 702 | data.read(sourceCrop); |
| 703 | float frameScale = data.readFloat(); |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame] | 704 | bool childrenOnly = data.readBool(); |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 705 | |
Peiyong Lin | 0e003c9 | 2018-09-17 11:09:51 -0700 | [diff] [blame] | 706 | status_t res = captureLayers(layerHandleBinder, &outBuffer, reqDataspace, |
| 707 | reqPixelFormat, sourceCrop, frameScale, childrenOnly); |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 708 | reply->writeInt32(res); |
Chavi Weingarten | 40482ff | 2017-11-30 01:51:40 +0000 | [diff] [blame] | 709 | if (res == NO_ERROR) { |
| 710 | reply->write(*outBuffer); |
| 711 | } |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 712 | return NO_ERROR; |
| 713 | } |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 714 | case AUTHENTICATE_SURFACE: { |
| 715 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Andy McFadden | 2adaf04 | 2012-12-18 09:49:45 -0800 | [diff] [blame] | 716 | sp<IGraphicBufferProducer> bufferProducer = |
| 717 | interface_cast<IGraphicBufferProducer>(data.readStrongBinder()); |
| 718 | int32_t result = authenticateSurfaceTexture(bufferProducer) ? 1 : 0; |
Jamie Gennis | 134f042 | 2011-03-08 12:18:54 -0800 | [diff] [blame] | 719 | reply->writeInt32(result); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 720 | return NO_ERROR; |
| 721 | } |
Brian Anderson | 6b37671 | 2017-04-04 10:51:39 -0700 | [diff] [blame] | 722 | case GET_SUPPORTED_FRAME_TIMESTAMPS: { |
| 723 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 724 | std::vector<FrameEvent> supportedTimestamps; |
| 725 | status_t result = getSupportedFrameTimestamps(&supportedTimestamps); |
| 726 | status_t err = reply->writeInt32(result); |
| 727 | if (err != NO_ERROR) { |
| 728 | return err; |
| 729 | } |
| 730 | if (result != NO_ERROR) { |
| 731 | return result; |
| 732 | } |
| 733 | |
| 734 | std::vector<int32_t> supported; |
| 735 | supported.reserve(supportedTimestamps.size()); |
| 736 | for (FrameEvent s : supportedTimestamps) { |
| 737 | supported.push_back(static_cast<int32_t>(s)); |
| 738 | } |
| 739 | return reply->writeInt32Vector(supported); |
| 740 | } |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 741 | case CREATE_DISPLAY_EVENT_CONNECTION: { |
| 742 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Jorim Jaggi | b1e2f8d | 2017-06-08 15:43:59 -0700 | [diff] [blame] | 743 | sp<IDisplayEventConnection> connection(createDisplayEventConnection( |
| 744 | static_cast<ISurfaceComposer::VsyncSource>(data.readInt32()))); |
Marco Nelissen | 2ea926b | 2014-11-14 08:01:01 -0800 | [diff] [blame] | 745 | reply->writeStrongBinder(IInterface::asBinder(connection)); |
Mathias Agopian | d0566bc | 2011-11-17 17:49:17 -0800 | [diff] [blame] | 746 | return NO_ERROR; |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 747 | } |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 748 | case CREATE_DISPLAY: { |
| 749 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Andy McFadden | 8dfa92f | 2012-09-17 18:27:17 -0700 | [diff] [blame] | 750 | String8 displayName = data.readString8(); |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 751 | bool secure = bool(data.readInt32()); |
| 752 | sp<IBinder> display(createDisplay(displayName, secure)); |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 753 | reply->writeStrongBinder(display); |
| 754 | return NO_ERROR; |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 755 | } |
| 756 | case DESTROY_DISPLAY: { |
| 757 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 758 | sp<IBinder> display = data.readStrongBinder(); |
| 759 | destroyDisplay(display); |
| 760 | return NO_ERROR; |
| 761 | } |
Mathias Agopian | e57f292 | 2012-08-09 16:29:12 -0700 | [diff] [blame] | 762 | case GET_BUILT_IN_DISPLAY: { |
| 763 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 764 | int32_t id = data.readInt32(); |
| 765 | sp<IBinder> display(getBuiltInDisplay(id)); |
| 766 | reply->writeStrongBinder(display); |
| 767 | return NO_ERROR; |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 768 | } |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 769 | case GET_DISPLAY_CONFIGS: { |
Mathias Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 770 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 771 | Vector<DisplayInfo> configs; |
Jeff Brown | 9d4e3d2 | 2012-08-24 20:00:51 -0700 | [diff] [blame] | 772 | sp<IBinder> display = data.readStrongBinder(); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 773 | status_t result = getDisplayConfigs(display, &configs); |
| 774 | reply->writeInt32(result); |
| 775 | if (result == NO_ERROR) { |
Dan Stoza | d723bd7 | 2014-11-18 10:24:03 -0800 | [diff] [blame] | 776 | reply->writeUint32(static_cast<uint32_t>(configs.size())); |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 777 | for (size_t c = 0; c < configs.size(); ++c) { |
| 778 | memcpy(reply->writeInplace(sizeof(DisplayInfo)), |
| 779 | &configs[c], sizeof(DisplayInfo)); |
| 780 | } |
| 781 | } |
| 782 | return NO_ERROR; |
| 783 | } |
Lajos Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 784 | case GET_DISPLAY_STATS: { |
| 785 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 786 | DisplayStatInfo stats; |
| 787 | sp<IBinder> display = data.readStrongBinder(); |
| 788 | status_t result = getDisplayStats(display, &stats); |
| 789 | reply->writeInt32(result); |
| 790 | if (result == NO_ERROR) { |
| 791 | memcpy(reply->writeInplace(sizeof(DisplayStatInfo)), |
| 792 | &stats, sizeof(DisplayStatInfo)); |
| 793 | } |
| 794 | return NO_ERROR; |
| 795 | } |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 796 | case GET_ACTIVE_CONFIG: { |
| 797 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 798 | sp<IBinder> display = data.readStrongBinder(); |
| 799 | int id = getActiveConfig(display); |
| 800 | reply->writeInt32(id); |
| 801 | return NO_ERROR; |
| 802 | } |
| 803 | case SET_ACTIVE_CONFIG: { |
| 804 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 805 | sp<IBinder> display = data.readStrongBinder(); |
| 806 | int id = data.readInt32(); |
| 807 | status_t result = setActiveConfig(display, id); |
Mathias Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 808 | reply->writeInt32(result); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 809 | return NO_ERROR; |
| 810 | } |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 811 | case GET_DISPLAY_COLOR_MODES: { |
| 812 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 813 | Vector<ColorMode> colorModes; |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 814 | sp<IBinder> display = nullptr; |
| 815 | status_t result = data.readStrongBinder(&display); |
| 816 | if (result != NO_ERROR) { |
| 817 | ALOGE("getDisplayColorModes failed to readStrongBinder: %d", result); |
| 818 | return result; |
| 819 | } |
| 820 | result = getDisplayColorModes(display, &colorModes); |
| 821 | reply->writeInt32(result); |
| 822 | if (result == NO_ERROR) { |
| 823 | reply->writeUint32(static_cast<uint32_t>(colorModes.size())); |
| 824 | for (size_t i = 0; i < colorModes.size(); ++i) { |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 825 | reply->writeInt32(static_cast<int32_t>(colorModes[i])); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 826 | } |
| 827 | } |
| 828 | return NO_ERROR; |
| 829 | } |
| 830 | case GET_ACTIVE_COLOR_MODE: { |
| 831 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 832 | sp<IBinder> display = nullptr; |
| 833 | status_t result = data.readStrongBinder(&display); |
| 834 | if (result != NO_ERROR) { |
| 835 | ALOGE("getActiveColorMode failed to readStrongBinder: %d", result); |
| 836 | return result; |
| 837 | } |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 838 | ColorMode colorMode = getActiveColorMode(display); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 839 | result = reply->writeInt32(static_cast<int32_t>(colorMode)); |
| 840 | return result; |
| 841 | } |
| 842 | case SET_ACTIVE_COLOR_MODE: { |
| 843 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 844 | sp<IBinder> display = nullptr; |
| 845 | status_t result = data.readStrongBinder(&display); |
| 846 | if (result != NO_ERROR) { |
| 847 | ALOGE("getActiveColorMode failed to readStrongBinder: %d", result); |
| 848 | return result; |
| 849 | } |
| 850 | int32_t colorModeInt = 0; |
| 851 | result = data.readInt32(&colorModeInt); |
| 852 | if (result != NO_ERROR) { |
| 853 | ALOGE("setActiveColorMode failed to readInt32: %d", result); |
| 854 | return result; |
| 855 | } |
| 856 | result = setActiveColorMode(display, |
Peiyong Lin | a52f029 | 2018-03-14 17:26:31 -0700 | [diff] [blame] | 857 | static_cast<ColorMode>(colorModeInt)); |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 858 | result = reply->writeInt32(result); |
| 859 | return result; |
| 860 | } |
Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 861 | case CLEAR_ANIMATION_FRAME_STATS: { |
| 862 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 863 | status_t result = clearAnimationFrameStats(); |
| 864 | reply->writeInt32(result); |
| 865 | return NO_ERROR; |
| 866 | } |
| 867 | case GET_ANIMATION_FRAME_STATS: { |
| 868 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 869 | FrameStats stats; |
| 870 | status_t result = getAnimationFrameStats(&stats); |
| 871 | reply->write(stats); |
| 872 | reply->writeInt32(result); |
| 873 | return NO_ERROR; |
| 874 | } |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 875 | case SET_POWER_MODE: { |
| 876 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 877 | sp<IBinder> display = data.readStrongBinder(); |
| 878 | int32_t mode = data.readInt32(); |
| 879 | setPowerMode(display, mode); |
| 880 | return NO_ERROR; |
| 881 | } |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 882 | case GET_HDR_CAPABILITIES: { |
| 883 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 884 | sp<IBinder> display = nullptr; |
| 885 | status_t result = data.readStrongBinder(&display); |
| 886 | if (result != NO_ERROR) { |
| 887 | ALOGE("getHdrCapabilities failed to readStrongBinder: %d", |
| 888 | result); |
| 889 | return result; |
| 890 | } |
| 891 | HdrCapabilities capabilities; |
| 892 | result = getHdrCapabilities(display, &capabilities); |
| 893 | reply->writeInt32(result); |
| 894 | if (result == NO_ERROR) { |
Mathias Agopian | e1f5e6f | 2017-02-06 16:34:41 -0800 | [diff] [blame] | 895 | reply->write(capabilities); |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 896 | } |
| 897 | return NO_ERROR; |
| 898 | } |
Sahil Dhanju | c1ba5c4 | 2016-06-07 20:09:20 -0700 | [diff] [blame] | 899 | case ENABLE_VSYNC_INJECTIONS: { |
| 900 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 901 | bool enable = false; |
| 902 | status_t result = data.readBool(&enable); |
| 903 | if (result != NO_ERROR) { |
| 904 | ALOGE("enableVSyncInjections failed to readBool: %d", result); |
| 905 | return result; |
| 906 | } |
| 907 | return enableVSyncInjections(enable); |
| 908 | } |
| 909 | case INJECT_VSYNC: { |
| 910 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 911 | int64_t when = 0; |
| 912 | status_t result = data.readInt64(&when); |
| 913 | if (result != NO_ERROR) { |
| 914 | ALOGE("enableVSyncInjections failed to readInt64: %d", result); |
| 915 | return result; |
| 916 | } |
| 917 | return injectVSync(when); |
| 918 | } |
Kalle Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 919 | case GET_LAYER_DEBUG_INFO: { |
| 920 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 921 | std::vector<LayerDebugInfo> outLayers; |
| 922 | status_t result = getLayerDebugInfo(&outLayers); |
| 923 | reply->writeInt32(result); |
| 924 | if (result == NO_ERROR) |
| 925 | { |
| 926 | result = reply->writeParcelableVector(outLayers); |
| 927 | } |
| 928 | return result; |
| 929 | } |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 930 | case GET_COMPOSITION_PREFERENCE: { |
| 931 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
Peiyong Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame^] | 932 | ui::Dataspace defaultDataspace; |
| 933 | ui::PixelFormat defaultPixelFormat; |
| 934 | ui::Dataspace wideColorGamutDataspace; |
| 935 | ui::PixelFormat wideColorGamutPixelFormat; |
| 936 | status_t error = |
| 937 | getCompositionPreference(&defaultDataspace, &defaultPixelFormat, |
| 938 | &wideColorGamutDataspace, &wideColorGamutPixelFormat); |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 939 | reply->writeInt32(error); |
| 940 | if (error == NO_ERROR) { |
Peiyong Lin | c678097 | 2018-10-28 15:24:08 -0700 | [diff] [blame^] | 941 | reply->writeInt32(static_cast<int32_t>(defaultDataspace)); |
| 942 | reply->writeInt32(static_cast<int32_t>(defaultPixelFormat)); |
| 943 | reply->writeInt32(static_cast<int32_t>(wideColorGamutDataspace)); |
| 944 | reply->writeInt32(static_cast<int32_t>(wideColorGamutDataspace)); |
Peiyong Lin | 0256f72 | 2018-08-31 15:45:10 -0700 | [diff] [blame] | 945 | } |
| 946 | return NO_ERROR; |
| 947 | } |
Ady Abraham | 2a6ab2a | 2018-10-26 14:25:30 -0700 | [diff] [blame] | 948 | case IS_COLOR_MANAGEMET_USED: { |
| 949 | CHECK_INTERFACE(ISurfaceComposer, data, reply); |
| 950 | int32_t result = isColorManagementUsed() ? 1 : 0; |
| 951 | reply->writeInt32(result); |
| 952 | return NO_ERROR; |
| 953 | } |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 954 | default: { |
Mathias Agopian | 83c0446 | 2009-05-22 19:00:22 -0700 | [diff] [blame] | 955 | return BBinder::onTransact(code, data, reply, flags); |
Jesse Hall | 6c913be | 2013-08-08 12:15:49 -0700 | [diff] [blame] | 956 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 957 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 958 | } |
| 959 | |
| 960 | // ---------------------------------------------------------------------------- |
| 961 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 962 | }; |