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

Commit 89d2237e authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Update bundle ClientTransaction flags" into main

parents d8dbc988 22adad82
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package android.app.servertransaction;

import static com.android.window.flags.Flags.syncWindowConfigUpdateFlag;
import static com.android.window.flags.Flags.bundleClientTransactionFlag;

import static java.util.Objects.requireNonNull;

@@ -67,7 +67,7 @@ public class ClientTransactionListenerController {
     * window configuration.
     */
    public void onDisplayChanged(int displayId) {
        if (!isSyncWindowConfigUpdateFlagEnabled()) {
        if (!isBundleClientTransactionFlagEnabled()) {
            return;
        }
        if (ActivityThread.isSystem()) {
@@ -77,9 +77,9 @@ public class ClientTransactionListenerController {
        mDisplayManager.handleDisplayChangeFromWindowManager(displayId);
    }

    /** Whether {@link #syncWindowConfigUpdateFlag} feature flag is enabled. */
    public boolean isSyncWindowConfigUpdateFlagEnabled() {
    /** Whether {@link #bundleClientTransactionFlag} feature flag is enabled. */
    public boolean isBundleClientTransactionFlagEnabled() {
        // Can't read flag from isolated process.
        return !Process.isIsolated() && syncWindowConfigUpdateFlag();
        return !Process.isIsolated() && bundleClientTransactionFlag();
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import static android.app.servertransaction.TransactionExecutorHelper.shouldExcl
import static android.app.servertransaction.TransactionExecutorHelper.tId;
import static android.app.servertransaction.TransactionExecutorHelper.transactionToString;

import static com.android.window.flags.Flags.syncWindowConfigUpdateFlag;
import static com.android.window.flags.Flags.bundleClientTransactionFlag;

import android.annotation.NonNull;
import android.app.ActivityThread.ActivityClientRecord;
@@ -183,9 +183,9 @@ public class TransactionExecutor {
        }

        // Can't read flag from isolated process.
        final boolean isSyncWindowConfigUpdateFlagEnabled = !Process.isIsolated()
                && syncWindowConfigUpdateFlag();
        final Context configUpdatedContext = isSyncWindowConfigUpdateFlagEnabled
        final boolean isBundleClientTransactionFlagEnabled = !Process.isIsolated()
                && bundleClientTransactionFlag();
        final Context configUpdatedContext = isBundleClientTransactionFlagEnabled
                ? item.getContextToUpdate(mTransactionHandler)
                : null;
        final Configuration preExecutedConfig = configUpdatedContext != null
+0 −14
Original line number Diff line number Diff line
@@ -2,13 +2,6 @@ package: "com.android.window.flags"

# Project link: https://gantry.corp.google.com/projects/android_platform_windowing_sdk/changes

flag {
    namespace: "windowing_sdk"
    name: "sync_window_config_update_flag"
    description: "Whether the feature to sync different window-related config updates is enabled"
    bug: "260873529"
}

# Using a fixed read only flag because there are ClientTransaction scheduling before
# WindowManagerService creation.
flag {
@@ -33,13 +26,6 @@ flag {
    bug: "284050041"
}

flag {
    namespace: "windowing_sdk"
    name: "window_state_resize_item_flag"
    description: "Whether to dispatch window resize through ClientTransaction is enabled"
    bug: "301870955"
}

flag {
    namespace: "windowing_sdk"
    name: "fullscreen_dim_flag"
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class ClientTransactionListenerControllerTest {
        mHandler = getInstrumentation().getContext().getMainThreadHandler();
        mController = spy(ClientTransactionListenerController.createInstanceForTesting(
                mDisplayManager));
        doReturn(true).when(mController).isSyncWindowConfigUpdateFlagEnabled();
        doReturn(true).when(mController).isBundleClientTransactionFlagEnabled();
    }

    @Test
+0 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.window.flags;

import static com.android.window.flags.Flags.syncWindowConfigUpdateFlag;
import static com.android.window.flags.Flags.taskFragmentSystemOrganizerFlag;

import android.platform.test.annotations.Presubmit;
@@ -38,12 +37,6 @@ import org.junit.runner.RunWith;
@Presubmit
public class WindowFlagsTest {

    @Test
    public void testSyncWindowConfigUpdateFlag() {
        // No crash when accessing the flag.
        syncWindowConfigUpdateFlag();
    }

    @Test
    public void testTaskFragmentSystemOrganizerFlag() {
        // No crash when accessing the flag.
Loading