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

Commit 5eaa7c31 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Add mechanism for a task's windows to be trusted overlays (SF)" into sc-dev

parents ae7324cd a30f7c99
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ message SurfaceChange {
        BackgroundBlurRadiusChange  background_blur_radius  = 20;
        ShadowRadiusChange          shadow_radius           = 21;
        BlurRegionsChange           blur_regions            = 22;
        TrustedOverlayChange        trusted_overlay         = 23;
    }
}

@@ -192,6 +193,10 @@ message ShadowRadiusChange {
    required float radius = 1;
}

message TrustedOverlayChange {
    required float is_trusted_overlay = 1;
}

message BlurRegionsChange {
    repeated BlurRegionChange blur_regions = 1;
}
+7 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ layer_state_t::layer_state_t()
        fixedTransformHint(ui::Transform::ROT_INVALID),
        frameNumber(0),
        autoRefresh(false),
        isTrustedOverlay(false),
        bufferCrop(Rect::INVALID_RECT),
        destinationFrame(Rect::INVALID_RECT),
        releaseBufferListener(nullptr) {
@@ -170,6 +171,7 @@ status_t layer_state_t::write(Parcel& output) const
    SAFE_PARCEL(output.write, stretchEffect);
    SAFE_PARCEL(output.write, bufferCrop);
    SAFE_PARCEL(output.write, destinationFrame);
    SAFE_PARCEL(output.writeBool, isTrustedOverlay);

    return NO_ERROR;
}
@@ -300,6 +302,7 @@ status_t layer_state_t::read(const Parcel& input)
    SAFE_PARCEL(input.read, stretchEffect);
    SAFE_PARCEL(input.read, bufferCrop);
    SAFE_PARCEL(input.read, destinationFrame);
    SAFE_PARCEL(input.readBool, &isTrustedOverlay);

    return NO_ERROR;
}
@@ -532,6 +535,10 @@ void layer_state_t::merge(const layer_state_t& other) {
        what |= eAutoRefreshChanged;
        autoRefresh = other.autoRefresh;
    }
    if (other.what & eTrustedOverlayChanged) {
        what |= eTrustedOverlayChanged;
        isTrustedOverlay = other.isTrustedOverlay;
    }
    if (other.what & eReleaseBufferListenerChanged) {
        if (releaseBufferListener) {
            ALOGW("Overriding releaseBufferListener");
+13 −0
Original line number Diff line number Diff line
@@ -1656,6 +1656,19 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setAutoR
    return *this;
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setTrustedOverlay(
        const sp<SurfaceControl>& sc, bool isTrustedOverlay) {
    layer_state_t* s = getLayerState(sc);
    if (!s) {
        mStatus = BAD_INDEX;
        return *this;
    }

    s->what |= layer_state_t::eTrustedOverlayChanged;
    s->isTrustedOverlay = isTrustedOverlay;
    return *this;
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setApplyToken(
        const sp<IBinder>& applyToken) {
    mApplyToken = applyToken;
+5 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ struct layer_state_t {
        eBlurRegionsChanged = 0x800'00000000,
        eAutoRefreshChanged = 0x1000'00000000,
        eStretchChanged = 0x2000'00000000,
        eTrustedOverlayChanged = 0x4000'00000000,
    };

    layer_state_t();
@@ -225,6 +226,10 @@ struct layer_state_t {
    // in shared buffer mode.
    bool autoRefresh;

    // An inherited state that indicates that this surface control and its children
    // should be trusted for input occlusion detection purposes
    bool isTrustedOverlay;

    // Stretch effect to be applied to this layer
    StretchEffect stretchEffect;

+3 −0
Original line number Diff line number Diff line
@@ -537,6 +537,9 @@ public:
        // in shared buffer mode.
        Transaction& setAutoRefresh(const sp<SurfaceControl>& sc, bool autoRefresh);

        // Sets that this surface control and its children are trusted overlays for input
        Transaction& setTrustedOverlay(const sp<SurfaceControl>& sc, bool isTrustedOverlay);

        // Queues up transactions using this token in SurfaceFlinger.  By default, all transactions
        // from a client are placed on the same queue. This can be used to prevent multiple
        // transactions from blocking each other.
Loading