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

Commit 11b470d4 authored by Chris Li's avatar Chris Li
Browse files

Check if Shell Transition is enabled for auto

Bug: 362992157
Bug: 339562797
Flag: EXEMPT with config flag
Test: atest CtsWindowManagerJetpackTestCases

Change-Id: I24a8ea18181ce9d949008460a9df399252e5353c
parent 6995c933
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -58,18 +58,22 @@ import android.app.Activity;
import android.app.ActivityClient;
import android.app.ActivityOptions;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.app.Application;
import android.app.Instrumentation;
import android.app.servertransaction.ClientTransactionListenerController;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
@@ -116,7 +120,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 = true;
    static final boolean ENABLE_SHELL_TRANSITIONS = getShellTransitEnabled();

    // 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.
@@ -3308,4 +3312,17 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
            transactionRecord.apply(false /* shouldApplyIndependently */);
        }
    }

    // TODO(b/207070762): cleanup with legacy app transition
    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;
    }
}