diff options
| author | 2021-05-25 14:31:52 +0000 | |
|---|---|---|
| committer | 2021-05-25 14:31:52 +0000 | |
| commit | a3d681c3faad7eefe2e86b997fdffe7538a7855f (patch) | |
| tree | 3ce195e0bd5e5f9ea18b73d96d3bda2fe9d39c1b /libs/gui/Surface.cpp | |
| parent | 8f04b30c59ebb8bd3c7d66203d91113e078ed815 (diff) | |
| parent | 9b85a194e4118819b2bd9ab0bfb489f78ae1b529 (diff) | |
Merge "Add robustness for permissions errors to Surface APIs." into sc-dev
Diffstat (limited to 'libs/gui/Surface.cpp')
| -rw-r--r-- | libs/gui/Surface.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index d27d1ecdbe..e117d1189c 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -1268,8 +1268,11 @@ int Surface::query(int what, int* value) const { if (err == NO_ERROR) { return NO_ERROR; } - if (composerService()->authenticateSurfaceTexture( - mGraphicBufferProducer)) { + sp<ISurfaceComposer> surfaceComposer = composerService(); + if (surfaceComposer == nullptr) { + return -EPERM; // likely permissions error + } + if (surfaceComposer->authenticateSurfaceTexture(mGraphicBufferProducer)) { *value = 1; } else { *value = 0; |