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

Commit 9d4ce9b9 authored by Steven Moreland's avatar Steven Moreland
Browse files

libgui: use read/writeStrongBinder

Still storing binder locally as a weak binder, but the plan is to remove
read/writeWeakBinder APIs. This is because weak binders can't be
promoted unless there is already a strong binder in a given process.

Bug: 137785053
Test: atest libgui_test (fails at same place as ToT: b/137791481)
Test: atest SurfaceFlinger_test (fails at same places as ToT: b/137875576)
Change-Id: I2d01aab95c4bd2e6db5e50055910cfa3064d9e52
parent 94f6b215
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public:
        data.writeStrongBinder(applyToken);
        commands.write(data);
        data.writeInt64(desiredPresentTime);
        data.writeWeakBinder(uncacheBuffer.token);
        data.writeStrongBinder(uncacheBuffer.token.promote());
        data.writeUint64(uncacheBuffer.id);

        if (data.writeVectorSize(listenerCallbacks) == NO_ERROR) {
@@ -1035,7 +1035,7 @@ status_t BnSurfaceComposer::onTransact(
            int64_t desiredPresentTime = data.readInt64();

            client_cache_t uncachedBuffer;
            uncachedBuffer.token = data.readWeakBinder();
            uncachedBuffer.token = data.readStrongBinder();
            uncachedBuffer.id = data.readUint64();

            std::vector<ListenerCallbacks> listenerCallbacks;
+2 −2
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ status_t layer_state_t::write(Parcel& output) const
           colorTransform.asArray(), 16 * sizeof(float));
    output.writeFloat(cornerRadius);
    output.writeBool(hasListenerCallbacks);
    output.writeWeakBinder(cachedBuffer.token);
    output.writeStrongBinder(cachedBuffer.token.promote());
    output.writeUint64(cachedBuffer.id);
    output.writeParcelable(metadata);

@@ -157,7 +157,7 @@ status_t layer_state_t::read(const Parcel& input)
    colorTransform = mat4(static_cast<const float*>(input.readInplace(16 * sizeof(float))));
    cornerRadius = input.readFloat();
    hasListenerCallbacks = input.readBool();
    cachedBuffer.token = input.readWeakBinder();
    cachedBuffer.token = input.readStrongBinder();
    cachedBuffer.id = input.readUint64();
    input.readParcelable(&metadata);