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

Commit 5cfc6e5b authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Return sp on call to createSurfaceInterceptor

This is so that SurfaceInterceptor can implement IBinder::DeathRecipient, since that inherits RefBase.h and must be stored as an sp.

Test: Make sure the device boot when SurfaceInterceptor extends RefBase
Change-Id: I264cd9e0a8517ae5a425b3a493631c7c42220473
parent 9c5aaf72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1112,7 +1112,7 @@ private:
    volatile nsecs_t mDebugInTransaction = 0;
    bool mForceFullDamage = false;
    bool mPropagateBackpressureClientComposition = false;
    std::unique_ptr<SurfaceInterceptor> mInterceptor;
    sp<SurfaceInterceptor> mInterceptor;

    SurfaceTracing mTracing{*this};
    std::mutex mTracingLock;
+2 −3
Original line number Diff line number Diff line
@@ -68,9 +68,8 @@ std::unique_ptr<Scheduler> DefaultFactory::createScheduler(
    return std::make_unique<Scheduler>(configs, callback);
}

std::unique_ptr<SurfaceInterceptor> DefaultFactory::createSurfaceInterceptor(
        SurfaceFlinger* flinger) {
    return std::make_unique<android::impl::SurfaceInterceptor>(flinger);
sp<SurfaceInterceptor> DefaultFactory::createSurfaceInterceptor(SurfaceFlinger* flinger) {
    return new android::impl::SurfaceInterceptor(flinger);
}

sp<StartPropertySetThread> DefaultFactory::createStartPropertySetThread(
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ public:
            const scheduler::RefreshRateConfigs&) override;
    std::unique_ptr<Scheduler> createScheduler(const scheduler::RefreshRateConfigs&,
                                               ISchedulerCallback&) override;
    std::unique_ptr<SurfaceInterceptor> createSurfaceInterceptor(SurfaceFlinger*) override;
    sp<SurfaceInterceptor> createSurfaceInterceptor(SurfaceFlinger*) override;
    sp<StartPropertySetThread> createStartPropertySetThread(bool timestampPropertyValue) override;
    sp<DisplayDevice> createDisplayDevice(DisplayDeviceCreationArgs&) override;
    sp<GraphicBuffer> createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format,
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public:
            const scheduler::RefreshRateConfigs&) = 0;
    virtual std::unique_ptr<Scheduler> createScheduler(const scheduler::RefreshRateConfigs&,
                                                       ISchedulerCallback&) = 0;
    virtual std::unique_ptr<SurfaceInterceptor> createSurfaceInterceptor(SurfaceFlinger*) = 0;
    virtual sp<SurfaceInterceptor> createSurfaceInterceptor(SurfaceFlinger*) = 0;

    virtual sp<StartPropertySetThread> createStartPropertySetThread(
            bool timestampPropertyValue) = 0;
+5 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ SurfaceInterceptor::SurfaceInterceptor(SurfaceFlinger* flinger)
{
}

void SurfaceInterceptor::binderDied(const wp<IBinder>& who) {
    // TODO: Implement
    (void)who;
}

void SurfaceInterceptor::enable(const SortedVector<sp<Layer>>& layers,
        const DefaultKeyedVector< wp<IBinder>, DisplayDeviceState>& displays)
{
Loading