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

Commit d6073dc8 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Extract shared utils so they can be used without depending on core Shell.

This is in preparation of making the Animation library a dependency of
Shell. The Animation lib itself needs to depend on these utilities to
handle transitions, so pulling it out into its own target solves
dependency cycles.

Fix: 321724947
Flag: NA
Test: both soong and gradle builds work
Change-Id: I1c461d976a5d3a72e3cd86fc8b904224c403382f
parent 5e0cc0b9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ filegroup {
}

// Sources that have no dependencies that can be used directly downstream of this library
// TODO(b/322791067): move these sources to WindowManager-Shell-shared
filegroup {
    name: "wm_shell_util-sources",
    srcs: [
@@ -137,6 +138,12 @@ java_library {
    },
}

java_library {
    name: "WindowManager-Shell-shared",

    srcs: ["shared/**/*.java"],
}

android_library {
    name: "WindowManager-Shell",
    srcs: [
@@ -162,6 +169,7 @@ android_library {
        "com_android_wm_shell_flags_lib",
        "com.android.window.flags.window-aconfig-java",
        "WindowManager-Shell-proto",
        "WindowManager-Shell-shared",
        "perfetto_trace_java_protos",
        "dagger2",
        "jsr330",
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.wm.shell.util;
package com.android.wm.shell.shared;

import android.graphics.Point;
import android.util.RotationUtils;
+4 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.wm.shell.util;
package com.android.wm.shell.shared;

import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.view.RemoteAnimationTarget.MODE_CHANGING;
@@ -28,14 +28,13 @@ import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.window.TransitionInfo.FLAG_FIRST_CUSTOM;
import static android.window.TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
import static android.window.TransitionInfo.FLAG_MOVED_TO_TOP;
import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;

import static com.android.wm.shell.common.split.SplitScreenConstants.FLAG_IS_DIVIDER_BAR;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -53,6 +52,8 @@ import java.util.function.Predicate;

/** Various utility functions for transitions. */
public class TransitionUtil {
    /** Flag applied to a transition change to identify it as a divider bar for animation. */
    public static final int FLAG_IS_DIVIDER_BAR = FLAG_FIRST_CUSTOM;

    /** @return true if the transition was triggered by opening something vs closing something */
    public static boolean isOpeningType(@WindowManager.TransitionType int type) {
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import android.window.TransitionInfo;

import androidx.annotation.NonNull;

import com.android.wm.shell.util.TransitionUtil;
import com.android.wm.shell.shared.TransitionUtil;

/**
 * Wrapper to handle the ActivityEmbedding animation update in one
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
import com.android.wm.shell.activityembedding.ActivityEmbeddingAnimationAdapter.SnapshotAdapter;
import com.android.wm.shell.common.ScreenshotUtils;
import com.android.wm.shell.util.TransitionUtil;
import com.android.wm.shell.shared.TransitionUtil;

import java.util.ArrayList;
import java.util.List;
Loading