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

Commit 98d7e3d6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Cleanup cleanup_dispatch_pending_transactions_remote_exception" into main

parents 993c51de 97eb18e9
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -103,17 +103,6 @@ flag {
    bug: "380132497"
}

flag {
    namespace: "windowing_sdk"
    name: "cleanup_dispatch_pending_transactions_remote_exception"
    description: "Refactor to cleanup for RemoteException from dispatchPendingTransactions"
    bug: "323801078"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "windowing_sdk"
    name: "support_widget_intents_on_connected_display"
+1 −2
Original line number Diff line number Diff line
@@ -1059,8 +1059,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
            // TODO(b/323801078): remove Exception when cleanup
            return e;
        }
        if (com.android.window.flags.Flags.cleanupDispatchPendingTransactionsRemoteException()
                && !isSuccessful) {
        if (!isSuccessful) {
            return new DeadObjectException("Failed to dispatch the ClientTransaction to dead"
                    + " process. See earlier log for more details.");
        }
+3 −20
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.app.servertransaction.LaunchActivityItem;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledSince;
import android.os.Build;
import android.os.DeadObjectException;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.Trace;
@@ -93,12 +92,7 @@ class ClientLifecycleManager {
            @NonNull ClientTransactionItem transactionItem) throws RemoteException {
        final ClientTransaction clientTransaction = new ClientTransaction(client);
        clientTransaction.addTransactionItem(transactionItem);
        final boolean res = scheduleTransaction(clientTransaction);
        if (!com.android.window.flags.Flags.cleanupDispatchPendingTransactionsRemoteException()
                && !res) {
            throw new DeadObjectException();
        }
        return res;
        return scheduleTransaction(clientTransaction);
    }

    /**
@@ -116,13 +110,8 @@ class ClientLifecycleManager {
        final ClientTransaction clientTransaction = getOrCreatePendingTransaction(client);
        clientTransaction.addTransactionItem(item);

        final boolean res = onClientTransactionItemScheduled(clientTransaction,
        return onClientTransactionItemScheduled(clientTransaction,
                false /* shouldDispatchImmediately */);
        if (!com.android.window.flags.Flags.cleanupDispatchPendingTransactionsRemoteException()
                && !res) {
            throw new DeadObjectException();
        }
        return res;
    }

    /**
@@ -164,13 +153,7 @@ class ClientLifecycleManager {
            clientTransaction.addTransactionItem(items[i]);
        }

        final boolean res = onClientTransactionItemScheduled(clientTransaction,
                shouldDispatchImmediately);
        if (!com.android.window.flags.Flags.cleanupDispatchPendingTransactionsRemoteException()
                && !res) {
            throw new DeadObjectException();
        }
        return res;
        return onClientTransactionItemScheduled(clientTransaction, shouldDispatchImmediately);
    }

    /** Executes all the pending transactions. */
+0 −6
Original line number Diff line number Diff line
@@ -37,13 +37,10 @@ import android.app.servertransaction.ClientTransactionItem;
import android.os.DeadObjectException;
import android.os.IBinder;
import android.os.RemoteException;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.annotations.Presubmit;

import androidx.test.filters.SmallTest;

import com.android.window.flags.Flags;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -198,7 +195,6 @@ public class ClientLifecycleManagerTests extends SystemServiceTestsBase {
        verify(mLifecycleManager).scheduleTransaction(any());
    }

    @EnableFlags(Flags.FLAG_CLEANUP_DISPATCH_PENDING_TRANSACTIONS_REMOTE_EXCEPTION)
    @Test
    public void testOnRemoteException_returnTrueOnSuccess() throws RemoteException {
        final boolean res = mLifecycleManager.scheduleTransactionItemNow(mClient, mTransactionItem);
@@ -206,7 +202,6 @@ public class ClientLifecycleManagerTests extends SystemServiceTestsBase {
        assertTrue(res);
    }

    @EnableFlags(Flags.FLAG_CLEANUP_DISPATCH_PENDING_TRANSACTIONS_REMOTE_EXCEPTION)
    @Test
    public void testOnRemoteException_returnFalseOnFailure() throws RemoteException {
        final DeadObjectException e = new DeadObjectException();
@@ -218,7 +213,6 @@ public class ClientLifecycleManagerTests extends SystemServiceTestsBase {
        assertFalse(res);
    }

    @EnableFlags(Flags.FLAG_CLEANUP_DISPATCH_PENDING_TRANSACTIONS_REMOTE_EXCEPTION)
    @Test
    public void testOnRemoteException_returnTrueForQueueing() throws RemoteException {
        spyOn(mWms.mWindowPlacerLocked);