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

Commit 07531340 authored by Matthew Sedam's avatar Matthew Sedam Committed by Android (Google) Code Review
Browse files

Merge "ContextHubClient: Disallow reliable broadcast messages" into main

parents 1f8b39b0 55e3c260
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -205,14 +205,12 @@ public class ContextHubClient implements Closeable {
    @FlaggedApi(Flags.FLAG_RELIABLE_MESSAGE)
    public ContextHubTransaction<Void> sendReliableMessageToNanoApp(
            @NonNull NanoAppMessage message) {
        if (!Flags.reliableMessageImplementation()) {
            return null;
        }

        ContextHubTransaction<Void> transaction =
                new ContextHubTransaction<>(ContextHubTransaction.TYPE_RELIABLE_MESSAGE);

        if (!mAttachedHub.supportsReliableMessages()) {
        if (!Flags.reliableMessageImplementation() ||
            !mAttachedHub.supportsReliableMessages() ||
            message.isBroadcastMessage()) {
            transaction.setResponse(new ContextHubTransaction.Response<Void>(
                    ContextHubTransaction.RESULT_FAILED_NOT_SUPPORTED, null));
            return transaction;