diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/gui/Android.bp | 2 | ||||
| -rw-r--r-- | libs/gui/WindowInfosListenerReporter.cpp | 20 | ||||
| -rw-r--r-- | libs/gui/aidl/android/gui/ISurfaceComposer.aidl | 4 | ||||
| -rw-r--r-- | libs/gui/aidl/android/gui/WindowInfosListenerInfo.aidl | 25 | ||||
| -rw-r--r-- | libs/gui/android/gui/IWindowInfosListener.aidl | 4 | ||||
| -rw-r--r-- | libs/gui/android/gui/IWindowInfosPublisher.aidl | 23 | ||||
| -rw-r--r-- | libs/gui/fuzzer/libgui_fuzzer_utils.h | 4 | ||||
| -rw-r--r-- | libs/gui/include/gui/ISurfaceComposer.h | 1 | ||||
| -rw-r--r-- | libs/gui/include/gui/WindowInfosListenerReporter.h | 8 | ||||
| -rw-r--r-- | libs/gui/tests/Surface_test.cpp | 3 |
10 files changed, 18 insertions, 76 deletions
diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp index 3c8df2bb29..bf34987b9e 100644 --- a/libs/gui/Android.bp +++ b/libs/gui/Android.bp @@ -73,7 +73,6 @@ filegroup { "android/gui/FocusRequest.aidl", "android/gui/InputApplicationInfo.aidl", "android/gui/IWindowInfosListener.aidl", - "android/gui/IWindowInfosPublisher.aidl", "android/gui/IWindowInfosReportedListener.aidl", "android/gui/WindowInfo.aidl", "android/gui/WindowInfosUpdate.aidl", @@ -91,7 +90,6 @@ cc_library_static { "android/gui/FocusRequest.aidl", "android/gui/InputApplicationInfo.aidl", "android/gui/IWindowInfosListener.aidl", - "android/gui/IWindowInfosPublisher.aidl", "android/gui/IWindowInfosReportedListener.aidl", "android/gui/WindowInfosUpdate.aidl", "android/gui/WindowInfo.aidl", diff --git a/libs/gui/WindowInfosListenerReporter.cpp b/libs/gui/WindowInfosListenerReporter.cpp index 0929b8e120..76e7b6e162 100644 --- a/libs/gui/WindowInfosListenerReporter.cpp +++ b/libs/gui/WindowInfosListenerReporter.cpp @@ -22,6 +22,7 @@ namespace android { using gui::DisplayInfo; +using gui::IWindowInfosReportedListener; using gui::WindowInfo; using gui::WindowInfosListener; using gui::aidl_utils::statusTFromBinderStatus; @@ -39,13 +40,8 @@ status_t WindowInfosListenerReporter::addWindowInfosListener( { std::scoped_lock lock(mListenersMutex); if (mWindowInfosListeners.empty()) { - gui::WindowInfosListenerInfo listenerInfo; - binder::Status s = surfaceComposer->addWindowInfosListener(this, &listenerInfo); + binder::Status s = surfaceComposer->addWindowInfosListener(this); status = statusTFromBinderStatus(s); - if (status == OK) { - mWindowInfosPublisher = std::move(listenerInfo.windowInfosPublisher); - mListenerId = listenerInfo.listenerId; - } } if (status == OK) { @@ -89,7 +85,8 @@ status_t WindowInfosListenerReporter::removeWindowInfosListener( } binder::Status WindowInfosListenerReporter::onWindowInfosChanged( - const gui::WindowInfosUpdate& update) { + const gui::WindowInfosUpdate& update, + const sp<IWindowInfosReportedListener>& windowInfosReportedListener) { std::unordered_set<sp<WindowInfosListener>, gui::SpHash<WindowInfosListener>> windowInfosListeners; @@ -107,7 +104,9 @@ binder::Status WindowInfosListenerReporter::onWindowInfosChanged( listener->onWindowInfosChanged(update); } - mWindowInfosPublisher->ackWindowInfosReceived(update.vsyncId, mListenerId); + if (windowInfosReportedListener) { + windowInfosReportedListener->onWindowInfosReported(); + } return binder::Status::ok(); } @@ -115,10 +114,7 @@ binder::Status WindowInfosListenerReporter::onWindowInfosChanged( void WindowInfosListenerReporter::reconnect(const sp<gui::ISurfaceComposer>& composerService) { std::scoped_lock lock(mListenersMutex); if (!mWindowInfosListeners.empty()) { - gui::WindowInfosListenerInfo listenerInfo; - composerService->addWindowInfosListener(this, &listenerInfo); - mWindowInfosPublisher = std::move(listenerInfo.windowInfosPublisher); - mListenerId = listenerInfo.listenerId; + composerService->addWindowInfosListener(this); } } diff --git a/libs/gui/aidl/android/gui/ISurfaceComposer.aidl b/libs/gui/aidl/android/gui/ISurfaceComposer.aidl index 539a1c140e..ec3266ca83 100644 --- a/libs/gui/aidl/android/gui/ISurfaceComposer.aidl +++ b/libs/gui/aidl/android/gui/ISurfaceComposer.aidl @@ -40,14 +40,12 @@ import android.gui.IScreenCaptureListener; import android.gui.ISurfaceComposerClient; import android.gui.ITunnelModeEnabledListener; import android.gui.IWindowInfosListener; -import android.gui.IWindowInfosPublisher; import android.gui.LayerCaptureArgs; import android.gui.LayerDebugInfo; import android.gui.OverlayProperties; import android.gui.PullAtomData; import android.gui.ARect; import android.gui.StaticDisplayInfo; -import android.gui.WindowInfosListenerInfo; /** @hide */ interface ISurfaceComposer { @@ -502,7 +500,7 @@ interface ISurfaceComposer { */ int getMaxAcquiredBufferCount(); - WindowInfosListenerInfo addWindowInfosListener(IWindowInfosListener windowInfosListener); + void addWindowInfosListener(IWindowInfosListener windowInfosListener); void removeWindowInfosListener(IWindowInfosListener windowInfosListener); diff --git a/libs/gui/aidl/android/gui/WindowInfosListenerInfo.aidl b/libs/gui/aidl/android/gui/WindowInfosListenerInfo.aidl deleted file mode 100644 index 0ca13b768a..0000000000 --- a/libs/gui/aidl/android/gui/WindowInfosListenerInfo.aidl +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 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; - -import android.gui.IWindowInfosPublisher; - -/** @hide */ -parcelable WindowInfosListenerInfo { - long listenerId; - IWindowInfosPublisher windowInfosPublisher; -}
\ No newline at end of file diff --git a/libs/gui/android/gui/IWindowInfosListener.aidl b/libs/gui/android/gui/IWindowInfosListener.aidl index 07cb5ed0e6..400229d99f 100644 --- a/libs/gui/android/gui/IWindowInfosListener.aidl +++ b/libs/gui/android/gui/IWindowInfosListener.aidl @@ -16,9 +16,11 @@ package android.gui; +import android.gui.IWindowInfosReportedListener; import android.gui.WindowInfosUpdate; /** @hide */ oneway interface IWindowInfosListener { - void onWindowInfosChanged(in WindowInfosUpdate update); + void onWindowInfosChanged( + in WindowInfosUpdate update, in @nullable IWindowInfosReportedListener windowInfosReportedListener); } diff --git a/libs/gui/android/gui/IWindowInfosPublisher.aidl b/libs/gui/android/gui/IWindowInfosPublisher.aidl deleted file mode 100644 index 5a9c32845e..0000000000 --- a/libs/gui/android/gui/IWindowInfosPublisher.aidl +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 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; - -/** @hide */ -oneway interface IWindowInfosPublisher -{ - void ackWindowInfosReceived(long vsyncId, long listenerId); -} diff --git a/libs/gui/fuzzer/libgui_fuzzer_utils.h b/libs/gui/fuzzer/libgui_fuzzer_utils.h index 4c7d0562af..8c003d8ad4 100644 --- a/libs/gui/fuzzer/libgui_fuzzer_utils.h +++ b/libs/gui/fuzzer/libgui_fuzzer_utils.h @@ -153,8 +153,8 @@ public: MOCK_METHOD(binder::Status, setOverrideFrameRate, (int32_t, float), (override)); MOCK_METHOD(binder::Status, getGpuContextPriority, (int32_t*), (override)); MOCK_METHOD(binder::Status, getMaxAcquiredBufferCount, (int32_t*), (override)); - MOCK_METHOD(binder::Status, addWindowInfosListener, - (const sp<gui::IWindowInfosListener>&, gui::WindowInfosListenerInfo*), (override)); + MOCK_METHOD(binder::Status, addWindowInfosListener, (const sp<gui::IWindowInfosListener>&), + (override)); MOCK_METHOD(binder::Status, removeWindowInfosListener, (const sp<gui::IWindowInfosListener>&), (override)); MOCK_METHOD(binder::Status, getOverlaySupport, (gui::OverlayProperties*), (override)); diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h index 3ff6735926..7c150d53d9 100644 --- a/libs/gui/include/gui/ISurfaceComposer.h +++ b/libs/gui/include/gui/ISurfaceComposer.h @@ -26,7 +26,6 @@ #include <android/gui/IScreenCaptureListener.h> #include <android/gui/ITunnelModeEnabledListener.h> #include <android/gui/IWindowInfosListener.h> -#include <android/gui/IWindowInfosPublisher.h> #include <binder/IBinder.h> #include <binder/IInterface.h> #include <gui/ITransactionCompletedListener.h> diff --git a/libs/gui/include/gui/WindowInfosListenerReporter.h b/libs/gui/include/gui/WindowInfosListenerReporter.h index 684e21ad96..38cb108912 100644 --- a/libs/gui/include/gui/WindowInfosListenerReporter.h +++ b/libs/gui/include/gui/WindowInfosListenerReporter.h @@ -18,7 +18,7 @@ #include <android/gui/BnWindowInfosListener.h> #include <android/gui/ISurfaceComposer.h> -#include <android/gui/IWindowInfosPublisher.h> +#include <android/gui/IWindowInfosReportedListener.h> #include <binder/IBinder.h> #include <gui/SpHash.h> #include <gui/WindowInfosListener.h> @@ -30,7 +30,8 @@ namespace android { class WindowInfosListenerReporter : public gui::BnWindowInfosListener { public: static sp<WindowInfosListenerReporter> getInstance(); - binder::Status onWindowInfosChanged(const gui::WindowInfosUpdate& update) override; + binder::Status onWindowInfosChanged(const gui::WindowInfosUpdate& update, + const sp<gui::IWindowInfosReportedListener>&) override; status_t addWindowInfosListener( const sp<gui::WindowInfosListener>& windowInfosListener, const sp<gui::ISurfaceComposer>&, @@ -46,8 +47,5 @@ private: std::vector<gui::WindowInfo> mLastWindowInfos GUARDED_BY(mListenersMutex); std::vector<gui::DisplayInfo> mLastDisplayInfos GUARDED_BY(mListenersMutex); - - sp<gui::IWindowInfosPublisher> mWindowInfosPublisher; - int64_t mListenerId; }; } // namespace android diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp index 8d7cf07b96..096a43cd95 100644 --- a/libs/gui/tests/Surface_test.cpp +++ b/libs/gui/tests/Surface_test.cpp @@ -998,8 +998,7 @@ public: } binder::Status addWindowInfosListener( - const sp<gui::IWindowInfosListener>& /*windowInfosListener*/, - gui::WindowInfosListenerInfo* /*outInfo*/) override { + const sp<gui::IWindowInfosListener>& /*windowInfosListener*/) override { return binder::Status::ok(); } |