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

Commit 188dee09 authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Phase out shell-transit flag by adoption" into main

parents 60019bd2 b875f26c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.SystemProperties;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
@@ -113,8 +112,7 @@ import java.util.function.BiConsumer;
public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmentCallback,
        ActivityEmbeddingComponent, DividerPresenter.DragEventCallback {
    static final String TAG = "SplitController";
    static final boolean ENABLE_SHELL_TRANSITIONS =
            SystemProperties.getBoolean("persist.wm.debug.shell_transit", true);
    static final boolean ENABLE_SHELL_TRANSITIONS = true;

    // TODO(b/243518738): Move to WM Extensions if we have requirement of overlay without
    //  association. It's not set in WM Extensions nor Wm Jetpack library currently.
+15 −2
Original line number Diff line number Diff line
@@ -44,9 +44,11 @@ import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_SH
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityTaskManager;
import android.app.AppGlobals;
import android.app.IApplicationThread;
import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.PackageManager;
import android.database.ContentObserver;
import android.os.Handler;
import android.os.IBinder;
@@ -126,8 +128,7 @@ public class Transitions implements RemoteCallable<Transitions>,
    static final String TAG = "ShellTransitions";

    /** Set to {@code true} to enable shell transitions. */
    public static final boolean ENABLE_SHELL_TRANSITIONS =
            SystemProperties.getBoolean("persist.wm.debug.shell_transit", true);
    public static final boolean ENABLE_SHELL_TRANSITIONS = getShellTransitEnabled();
    public static final boolean SHELL_TRANSITIONS_ROTATION = ENABLE_SHELL_TRANSITIONS
            && SystemProperties.getBoolean("persist.wm.debug.shell_transit_rotate", false);

@@ -1710,4 +1711,16 @@ public class Transitions implements RemoteCallable<Transitions>,
            }
        }
    }

    private static boolean getShellTransitEnabled() {
        try {
            if (AppGlobals.getPackageManager().hasSystemFeature(
                    PackageManager.FEATURE_AUTOMOTIVE, 0)) {
                return SystemProperties.getBoolean("persist.wm.debug.shell_transit", true);
            }
        } catch (RemoteException re) {
            Log.w(TAG, "Error getting system features");
        }
        return true;
    }
}
+12 −3
Original line number Diff line number Diff line
@@ -349,6 +349,7 @@ import com.android.server.AnimationThread;
import com.android.server.DisplayThread;
import com.android.server.FgThread;
import com.android.server.LocalServices;
import com.android.server.SystemConfig;
import com.android.server.UiThread;
import com.android.server.Watchdog;
import com.android.server.input.InputManagerService;
@@ -454,13 +455,12 @@ public class WindowManagerService extends IWindowManager.Stub
    /**
     * Use WMShell for app transition.
     */
    public static final String ENABLE_SHELL_TRANSITIONS = "persist.wm.debug.shell_transit";
    private static final String ENABLE_SHELL_TRANSITIONS = "persist.wm.debug.shell_transit";

    /**
     * @see #ENABLE_SHELL_TRANSITIONS
     */
    public static final boolean sEnableShellTransitions =
            SystemProperties.getBoolean(ENABLE_SHELL_TRANSITIONS, true);
    public static final boolean sEnableShellTransitions = getShellTransitEnabled();

    /**
     * Allows a fullscreen windowing mode activity to launch in its desired orientation directly
@@ -10230,4 +10230,13 @@ public class WindowManagerService extends IWindowManager.Stub
            }
        }
    }

    private static boolean getShellTransitEnabled() {
        android.content.pm.FeatureInfo autoFeature = SystemConfig.getInstance()
                .getAvailableFeatures().get(PackageManager.FEATURE_AUTOMOTIVE);
        if (autoFeature != null && autoFeature.version >= 0) {
            return SystemProperties.getBoolean(ENABLE_SHELL_TRANSITIONS, true);
        }
        return true;
    }
}