diff options
| author | 2018-12-10 10:04:58 -0800 | |
|---|---|---|
| committer | 2018-12-11 20:26:02 +0000 | |
| commit | 7d0eb60ead42a8ba1ba4f2521717c8468740aa1a (patch) | |
| tree | dc46db03eb9db323f69ec2ebb851905fcfd89e64 /libs/gui/ISurfaceComposer.cpp | |
| parent | e5e4501c4f1675abd24b8f88199c9ba1b62ce914 (diff) | |
| parent | 82fc86b84fc47f38c44508e9e4fb28a72d6b3195 (diff) | |
DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master
Bug: 120502534
Change-Id: I11d008b8f4b846f39dcdd9257e9bd8829b89a462
Diffstat (limited to 'libs/gui/ISurfaceComposer.cpp')
| -rw-r--r-- | libs/gui/ISurfaceComposer.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index e22bc708c9..d2d27e8239 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -332,6 +332,34 @@ public: return result; } + virtual status_t getDisplayViewport(const sp<IBinder>& display, Rect* outViewport) { + Parcel data, reply; + status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); + if (result != NO_ERROR) { + ALOGE("getDisplayViewport failed to writeInterfaceToken: %d", result); + return result; + } + result = data.writeStrongBinder(display); + if (result != NO_ERROR) { + ALOGE("getDisplayViewport failed to writeStrongBinder: %d", result); + return result; + } + result = remote()->transact(BnSurfaceComposer::GET_DISPLAY_VIEWPORT, data, &reply); + if (result != NO_ERROR) { + ALOGE("getDisplayViewport failed to transact: %d", result); + return result; + } + result = reply.readInt32(); + if (result == NO_ERROR) { + result = reply.read(*outViewport); + if (result != NO_ERROR) { + ALOGE("getDisplayViewport failed to read: %d", result); + return result; + } + } + return result; + } + virtual int getActiveConfig(const sp<IBinder>& display) { Parcel data, reply; @@ -724,6 +752,26 @@ status_t BnSurfaceComposer::onTransact( } return NO_ERROR; } + case GET_DISPLAY_VIEWPORT: { + CHECK_INTERFACE(ISurfaceComposer, data, reply); + Rect outViewport; + sp<IBinder> display = nullptr; + status_t result = data.readStrongBinder(&display); + if (result != NO_ERROR) { + ALOGE("getDisplayViewport failed to readStrongBinder: %d", result); + return result; + } + result = getDisplayViewport(display, &outViewport); + result = reply->writeInt32(result); + if (result == NO_ERROR) { + result = reply->write(outViewport); + if (result != NO_ERROR) { + ALOGE("getDisplayViewport failed to write: %d", result); + return result; + } + } + return NO_ERROR; + } case GET_ACTIVE_CONFIG: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = data.readStrongBinder(); |