Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0ea984e authored by Xin Li's avatar Xin Li
Browse files

Merge UP1A.231005.007

Bug: 291102124
Merged-In: Ib39ba935727df0bc1ab4030bcfe8301de7e64805
Change-Id: Ic96a1854bcb1071da9b3eebdf3a63fe17d5c9c6f
parents 0d28bd51 bfcf7507
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ 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",
@@ -90,6 +91,7 @@ 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",
@@ -136,6 +138,7 @@ aidl_library {
        "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",
+12 −8
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
namespace android {

using gui::DisplayInfo;
using gui::IWindowInfosReportedListener;
using gui::WindowInfo;
using gui::WindowInfosListener;
using gui::aidl_utils::statusTFromBinderStatus;
@@ -40,8 +39,13 @@ status_t WindowInfosListenerReporter::addWindowInfosListener(
    {
        std::scoped_lock lock(mListenersMutex);
        if (mWindowInfosListeners.empty()) {
            binder::Status s = surfaceComposer->addWindowInfosListener(this);
            gui::WindowInfosListenerInfo listenerInfo;
            binder::Status s = surfaceComposer->addWindowInfosListener(this, &listenerInfo);
            status = statusTFromBinderStatus(s);
            if (status == OK) {
                mWindowInfosPublisher = std::move(listenerInfo.windowInfosPublisher);
                mListenerId = listenerInfo.listenerId;
            }
        }

        if (status == OK) {
@@ -85,8 +89,7 @@ status_t WindowInfosListenerReporter::removeWindowInfosListener(
}

binder::Status WindowInfosListenerReporter::onWindowInfosChanged(
        const gui::WindowInfosUpdate& update,
        const sp<IWindowInfosReportedListener>& windowInfosReportedListener) {
        const gui::WindowInfosUpdate& update) {
    std::unordered_set<sp<WindowInfosListener>, gui::SpHash<WindowInfosListener>>
            windowInfosListeners;

@@ -104,9 +107,7 @@ binder::Status WindowInfosListenerReporter::onWindowInfosChanged(
        listener->onWindowInfosChanged(update);
    }

    if (windowInfosReportedListener) {
        windowInfosReportedListener->onWindowInfosReported();
    }
    mWindowInfosPublisher->ackWindowInfosReceived(update.vsyncId, mListenerId);

    return binder::Status::ok();
}
@@ -114,7 +115,10 @@ binder::Status WindowInfosListenerReporter::onWindowInfosChanged(
void WindowInfosListenerReporter::reconnect(const sp<gui::ISurfaceComposer>& composerService) {
    std::scoped_lock lock(mListenersMutex);
    if (!mWindowInfosListeners.empty()) {
        composerService->addWindowInfosListener(this);
        gui::WindowInfosListenerInfo listenerInfo;
        composerService->addWindowInfosListener(this, &listenerInfo);
        mWindowInfosPublisher = std::move(listenerInfo.windowInfosPublisher);
        mListenerId = listenerInfo.listenerId;
    }
}

+3 −1
Original line number Diff line number Diff line
@@ -40,12 +40,14 @@ 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 {
@@ -500,7 +502,7 @@ interface ISurfaceComposer {
     */
    int getMaxAcquiredBufferCount();

    void addWindowInfosListener(IWindowInfosListener windowInfosListener);
    WindowInfosListenerInfo addWindowInfosListener(IWindowInfosListener windowInfosListener);

    void removeWindowInfosListener(IWindowInfosListener windowInfosListener);

+25 −0
Original line number Diff line number Diff line
/**
 * 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
+1 −3
Original line number Diff line number Diff line
@@ -16,11 +16,9 @@

package android.gui;

import android.gui.IWindowInfosReportedListener;
import android.gui.WindowInfosUpdate;

/** @hide */
oneway interface IWindowInfosListener {
    void onWindowInfosChanged(
        in WindowInfosUpdate update, in @nullable IWindowInfosReportedListener windowInfosReportedListener);
    void onWindowInfosChanged(in WindowInfosUpdate update);
}
Loading