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

Commit 4dea052f authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15150900

Change-Id: I8578a717172c8245da2c8352cbec14f4b9729628
parents ee3c8f58 5eaa7c31
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;
    }
}

@@ -197,6 +198,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
@@ -67,6 +67,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) {
@@ -171,6 +172,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;
}
@@ -299,6 +301,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;
}
@@ -534,6 +537,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
@@ -1652,6 +1652,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
@@ -116,6 +116,7 @@ struct layer_state_t {
        eBlurRegionsChanged = 0x800'00000000,
        eAutoRefreshChanged = 0x1000'00000000,
        eStretchChanged = 0x2000'00000000,
        eTrustedOverlayChanged = 0x4000'00000000,
    };

    layer_state_t();
@@ -221,6 +222,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
@@ -535,6 +535,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