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

Commit fd1d4efe authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11830997 from 56a49bae to 24Q3-release

Change-Id: I35299524fdc5d548a6795e941499170f4b49dfec
parents 0bc50989 56a49bae
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -89,6 +89,8 @@ int64_t generateId() {
void emptyCallback(nsecs_t, const sp<Fence>&, const std::vector<SurfaceControlStats>&) {}
void emptyCallback(nsecs_t, const sp<Fence>&, const std::vector<SurfaceControlStats>&) {}
} // namespace
} // namespace


const std::string SurfaceComposerClient::kEmpty{};

ComposerService::ComposerService()
ComposerService::ComposerService()
: Singleton<ComposerService>() {
: Singleton<ComposerService>() {
    Mutex::Autolock _l(mLock);
    Mutex::Autolock _l(mLock);
@@ -1278,14 +1280,13 @@ status_t SurfaceComposerClient::Transaction::sendSurfaceFlushJankDataTransaction
}
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------


sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName, bool secure,
sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName, bool isSecure,
                                                 float requestedRefereshRate) {
                                                 const std::string& uniqueId,
                                                 float requestedRefreshRate) {
    sp<IBinder> display = nullptr;
    sp<IBinder> display = nullptr;
    binder::Status status =
    binder::Status status = ComposerServiceAIDL::getComposerService()
            ComposerServiceAIDL::getComposerService()->createDisplay(std::string(
                                    ->createDisplay(std::string(displayName.c_str()), isSecure,
                                                                             displayName.c_str()),
                                                    uniqueId, requestedRefreshRate, &display);
                                                                     secure, requestedRefereshRate,
                                                                     &display);
    return status.isOk() ? display : nullptr;
    return status.isOk() ? display : nullptr;
}
}


+10 −8
Original line number Original line Diff line number Diff line
@@ -72,7 +72,7 @@ interface ISurfaceComposer {
    void bootFinished();
    void bootFinished();


    /**
    /**
     * Create a display event connection
     * Create a display event connection.
     *
     *
     * layerHandle
     * layerHandle
     *     Optional binder handle representing a Layer in SF to associate the new
     *     Optional binder handle representing a Layer in SF to associate the new
@@ -89,12 +89,14 @@ interface ISurfaceComposer {
    @nullable ISurfaceComposerClient createConnection();
    @nullable ISurfaceComposerClient createConnection();


    /**
    /**
     * Create a virtual display
     * Create a virtual display.
     *
     *
     * displayName
     * displayName
     *     The name of the virtual display
     *     The name of the virtual display.
     * secure
     * isSecure
     *     Whether this virtual display is secure
     *     Whether this virtual display is secure.
     * uniqueId
     *     The unique ID for the display.
     * requestedRefreshRate
     * requestedRefreshRate
     *     The refresh rate, frames per second, to request on the virtual display.
     *     The refresh rate, frames per second, to request on the virtual display.
     *     This is just a request, the actual rate may be adjusted to align well
     *     This is just a request, the actual rate may be adjusted to align well
@@ -103,11 +105,11 @@ interface ISurfaceComposer {
     *
     *
     * requires ACCESS_SURFACE_FLINGER permission.
     * requires ACCESS_SURFACE_FLINGER permission.
     */
     */
    @nullable IBinder createDisplay(@utf8InCpp String displayName, boolean secure,
    @nullable IBinder createDisplay(@utf8InCpp String displayName, boolean isSecure,
            float requestedRefreshRate);
            @utf8InCpp String uniqueId, float requestedRefreshRate);


    /**
    /**
     * Destroy a virtual display
     * Destroy a virtual display.
     * requires ACCESS_SURFACE_FLINGER permission.
     * requires ACCESS_SURFACE_FLINGER permission.
     */
     */
    void destroyDisplay(IBinder display);
    void destroyDisplay(IBinder display);
+5 −6
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@


#include <stdint.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/types.h>

#include <set>
#include <set>
#include <thread>
#include <thread>
#include <unordered_map>
#include <unordered_map>
@@ -374,17 +375,15 @@ public:


    sp<SurfaceControl> mirrorDisplay(DisplayId displayId);
    sp<SurfaceControl> mirrorDisplay(DisplayId displayId);


    //! Create a virtual display
    static const std::string kEmpty;
    static sp<IBinder> createDisplay(const String8& displayName, bool secure,
    static sp<IBinder> createDisplay(const String8& displayName, bool isSecure,
                                     float requestedRefereshRate = 0);
                                     const std::string& uniqueId = kEmpty,
                                     float requestedRefreshRate = 0);


    //! Destroy a virtual display
    static void destroyDisplay(const sp<IBinder>& display);
    static void destroyDisplay(const sp<IBinder>& display);


    //! Get stable IDs for connected physical displays
    static std::vector<PhysicalDisplayId> getPhysicalDisplayIds();
    static std::vector<PhysicalDisplayId> getPhysicalDisplayIds();


    //! Get token for a physical display given its stable ID
    static sp<IBinder> getPhysicalDisplayToken(PhysicalDisplayId displayId);
    static sp<IBinder> getPhysicalDisplayToken(PhysicalDisplayId displayId);


    // Returns StalledTransactionInfo if a transaction from the provided pid has not been applied
    // Returns StalledTransactionInfo if a transaction from the provided pid has not been applied
+2 −2
Original line number Original line Diff line number Diff line
@@ -673,8 +673,8 @@ public:
        return binder::Status::ok();
        return binder::Status::ok();
    }
    }


    binder::Status createDisplay(const std::string& /*displayName*/, bool /*secure*/,
    binder::Status createDisplay(const std::string& /*displayName*/, bool /*isSecure*/,
                                 float /*requestedRefreshRate*/,
                                 const std::string& /*uniqueId*/, float /*requestedRefreshRate*/,
                                 sp<IBinder>* /*outDisplay*/) override {
                                 sp<IBinder>* /*outDisplay*/) override {
        return binder::Status::ok();
        return binder::Status::ok();
    }
    }
+26 −0
Original line number Original line Diff line number Diff line
@@ -4732,6 +4732,7 @@ void InputDispatcher::notifySwitch(const NotifySwitchArgs& args) {
}
}


void InputDispatcher::notifyDeviceReset(const NotifyDeviceResetArgs& args) {
void InputDispatcher::notifyDeviceReset(const NotifyDeviceResetArgs& args) {
    // TODO(b/308677868) Remove device reset from the InputListener interface
    if (debugInboundEventDetails()) {
    if (debugInboundEventDetails()) {
        ALOGD("notifyDeviceReset - eventTime=%" PRId64 ", deviceId=%d", args.eventTime,
        ALOGD("notifyDeviceReset - eventTime=%" PRId64 ", deviceId=%d", args.eventTime,
              args.deviceId);
              args.deviceId);
@@ -4883,6 +4884,30 @@ InputEventInjectionResult InputDispatcher::injectInputEvent(const InputEvent* ev
            }
            }


            mLock.lock();
            mLock.lock();

            if (policyFlags & POLICY_FLAG_FILTERED) {
                // The events from InputFilter impersonate real hardware devices. Check these
                // events for consistency and print an error. An inconsistent event sent from
                // InputFilter could cause a crash in the later stages of dispatching pipeline.
                auto [it, _] =
                        mInputFilterVerifiersByDisplay
                                .try_emplace(displayId,
                                             StringPrintf("Injection on %" PRId32, displayId));
                InputVerifier& verifier = it->second;

                Result<void> result =
                        verifier.processMovement(resolvedDeviceId, motionEvent.getSource(),
                                                 motionEvent.getAction(),
                                                 motionEvent.getPointerCount(),
                                                 motionEvent.getPointerProperties(),
                                                 motionEvent.getSamplePointerCoords(), flags);
                if (!result.ok()) {
                    logDispatchStateLocked();
                    LOG(ERROR) << "Inconsistent event: " << motionEvent
                               << ", reason: " << result.error();
                }
            }

            const nsecs_t* sampleEventTimes = motionEvent.getSampleEventTimes();
            const nsecs_t* sampleEventTimes = motionEvent.getSampleEventTimes();
            const size_t pointerCount = motionEvent.getPointerCount();
            const size_t pointerCount = motionEvent.getPointerCount();
            const std::vector<PointerProperties>
            const std::vector<PointerProperties>
@@ -6962,6 +6987,7 @@ void InputDispatcher::displayRemoved(ui::LogicalDisplayId displayId) {
        // Remove the associated touch mode state.
        // Remove the associated touch mode state.
        mTouchModePerDisplay.erase(displayId);
        mTouchModePerDisplay.erase(displayId);
        mVerifiersByDisplay.erase(displayId);
        mVerifiersByDisplay.erase(displayId);
        mInputFilterVerifiersByDisplay.erase(displayId);
    } // release lock
    } // release lock


    // Wake up poll loop since it may need to make new input dispatching choices.
    // Wake up poll loop since it may need to make new input dispatching choices.
Loading