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

Commit 16430ee4 authored by Ken Chen's avatar Ken Chen Committed by Automerger Merge Worker
Browse files

Revert "Improve updateInputFlinger performance" am: a8ce8fc1

parents 2128144d a8ce8fc1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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",
+8 −12
Original line number Diff line number Diff line
@@ -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);
    }
}

+1 −3
Original line number Diff line number Diff line
@@ -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);

+0 −25
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
+3 −1
Original line number Diff line number Diff line
@@ -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);
}
Loading