Loading libs/gui/SurfaceComposerClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -3122,12 +3122,12 @@ status_t ScreenshotClient::captureDisplay(const DisplayCaptureArgs& captureArgs, return statusTFromBinderStatus(status); } status_t ScreenshotClient::captureDisplay(DisplayId displayId, status_t ScreenshotClient::captureDisplay(DisplayId displayId, const gui::CaptureArgs& captureArgs, const sp<IScreenCaptureListener>& captureListener) { sp<gui::ISurfaceComposer> s(ComposerServiceAIDL::getComposerService()); if (s == nullptr) return NO_INIT; binder::Status status = s->captureDisplayById(displayId.value, captureListener); binder::Status status = s->captureDisplayById(displayId.value, captureArgs, captureListener); return statusTFromBinderStatus(status); } Loading libs/gui/aidl/android/gui/CaptureArgs.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.gui; parcelable CaptureArgs cpp_header "gui/DisplayCaptureArgs.h"; libs/gui/aidl/android/gui/ISurfaceComposer.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.gui; import android.gui.CaptureArgs; import android.gui.Color; import android.gui.CompositionPreference; import android.gui.ContentSamplingAttributes; Loading Loading @@ -238,7 +239,8 @@ interface ISurfaceComposer { * Capture the specified screen. This requires the READ_FRAME_BUFFER * permission. */ oneway void captureDisplayById(long displayId, IScreenCaptureListener listener); oneway void captureDisplayById(long displayId, in CaptureArgs args, IScreenCaptureListener listener); /** * Capture a subtree of the layer hierarchy, potentially ignoring the root node. Loading libs/gui/fuzzer/libgui_fuzzer_utils.h +2 −2 Original line number Diff line number Diff line Loading @@ -100,8 +100,8 @@ public: MOCK_METHOD(binder::Status, setGameContentType, (const sp<IBinder>&, bool), (override)); MOCK_METHOD(binder::Status, captureDisplay, (const DisplayCaptureArgs&, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, captureDisplayById, (int64_t, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, captureDisplayById, (int64_t, const gui::CaptureArgs&, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, captureLayers, (const LayerCaptureArgs&, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, clearAnimationFrameStats, (), (override)); Loading libs/gui/include/gui/SurfaceComposerClient.h +7 −1 Original line number Diff line number Diff line Loading @@ -841,8 +841,14 @@ private: class ScreenshotClient { public: static status_t captureDisplay(const DisplayCaptureArgs&, const sp<IScreenCaptureListener>&); static status_t captureDisplay(DisplayId, const sp<IScreenCaptureListener>&); static status_t captureDisplay(DisplayId, const gui::CaptureArgs&, const sp<IScreenCaptureListener>&); static status_t captureLayers(const LayerCaptureArgs&, const sp<IScreenCaptureListener>&); [[deprecated]] static status_t captureDisplay(DisplayId id, const sp<IScreenCaptureListener>& listener) { return captureDisplay(id, gui::CaptureArgs(), listener); } }; // --------------------------------------------------------------------------- Loading Loading
libs/gui/SurfaceComposerClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -3122,12 +3122,12 @@ status_t ScreenshotClient::captureDisplay(const DisplayCaptureArgs& captureArgs, return statusTFromBinderStatus(status); } status_t ScreenshotClient::captureDisplay(DisplayId displayId, status_t ScreenshotClient::captureDisplay(DisplayId displayId, const gui::CaptureArgs& captureArgs, const sp<IScreenCaptureListener>& captureListener) { sp<gui::ISurfaceComposer> s(ComposerServiceAIDL::getComposerService()); if (s == nullptr) return NO_INIT; binder::Status status = s->captureDisplayById(displayId.value, captureListener); binder::Status status = s->captureDisplayById(displayId.value, captureArgs, captureListener); return statusTFromBinderStatus(status); } Loading
libs/gui/aidl/android/gui/CaptureArgs.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.gui; parcelable CaptureArgs cpp_header "gui/DisplayCaptureArgs.h";
libs/gui/aidl/android/gui/ISurfaceComposer.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.gui; import android.gui.CaptureArgs; import android.gui.Color; import android.gui.CompositionPreference; import android.gui.ContentSamplingAttributes; Loading Loading @@ -238,7 +239,8 @@ interface ISurfaceComposer { * Capture the specified screen. This requires the READ_FRAME_BUFFER * permission. */ oneway void captureDisplayById(long displayId, IScreenCaptureListener listener); oneway void captureDisplayById(long displayId, in CaptureArgs args, IScreenCaptureListener listener); /** * Capture a subtree of the layer hierarchy, potentially ignoring the root node. Loading
libs/gui/fuzzer/libgui_fuzzer_utils.h +2 −2 Original line number Diff line number Diff line Loading @@ -100,8 +100,8 @@ public: MOCK_METHOD(binder::Status, setGameContentType, (const sp<IBinder>&, bool), (override)); MOCK_METHOD(binder::Status, captureDisplay, (const DisplayCaptureArgs&, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, captureDisplayById, (int64_t, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, captureDisplayById, (int64_t, const gui::CaptureArgs&, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, captureLayers, (const LayerCaptureArgs&, const sp<IScreenCaptureListener>&), (override)); MOCK_METHOD(binder::Status, clearAnimationFrameStats, (), (override)); Loading
libs/gui/include/gui/SurfaceComposerClient.h +7 −1 Original line number Diff line number Diff line Loading @@ -841,8 +841,14 @@ private: class ScreenshotClient { public: static status_t captureDisplay(const DisplayCaptureArgs&, const sp<IScreenCaptureListener>&); static status_t captureDisplay(DisplayId, const sp<IScreenCaptureListener>&); static status_t captureDisplay(DisplayId, const gui::CaptureArgs&, const sp<IScreenCaptureListener>&); static status_t captureLayers(const LayerCaptureArgs&, const sp<IScreenCaptureListener>&); [[deprecated]] static status_t captureDisplay(DisplayId id, const sp<IScreenCaptureListener>& listener) { return captureDisplay(id, gui::CaptureArgs(), listener); } }; // --------------------------------------------------------------------------- Loading