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

Commit 8176ed8b authored by Darrell Shi's avatar Darrell Shi Committed by Xiaowen Lei
Browse files

Add WM transit types for dream activity.

This change adds two WM transit types for opening and closing dream
activities, which allows the system to define transition in and out of
dreams, that are currently being overriden by other transitions.

Set the priority to be just below keyguard transit. The keyguard
occlude/unocclude already correctly handles the dream open/close
animation.

Bug: 222507937
Bug: 220311554
Test: atest WmTests:AppTransitionControllerTest
Test: manually on device by entering and exiting dreams over keyguard,
launcher, and settings. observed animation and relevant types of WM logs.

Change-Id: Iedfa279d56cd9d4c4679cb3b697ee74a98ef727b
parent 3c803c92
Loading
Loading
Loading
Loading
+0 −15
Original line number Original line Diff line number Diff line
@@ -21,8 +21,6 @@ import android.app.Activity;
import android.os.Bundle;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.TextUtils;


import com.android.internal.R;

/**
/**
 * The Activity used by the {@link DreamService} to draw screensaver content
 * The Activity used by the {@link DreamService} to draw screensaver content
 * on the screen. This activity runs in dream application's process, but is started by a
 * on the screen. This activity runs in dream application's process, but is started by a
@@ -65,17 +63,4 @@ public class DreamActivity extends Activity {
            callback.onActivityCreated(this);
            callback.onActivityCreated(this);
        }
        }
    }
    }

    @Override
    public void onResume() {
        super.onResume();
        overridePendingTransition(R.anim.dream_activity_open_enter,
                                  R.anim.dream_activity_open_exit);
    }

    @Override
    public void finishAndRemoveTask() {
        super.finishAndRemoveTask();
        overridePendingTransition(0, R.anim.dream_activity_close_exit);
    }
}
}
+15 −1
Original line number Original line Diff line number Diff line
@@ -340,6 +340,18 @@ public interface WindowManager extends ViewManager {
     */
     */
    int TRANSIT_OLD_TASK_FRAGMENT_CHANGE = 30;
    int TRANSIT_OLD_TASK_FRAGMENT_CHANGE = 30;


    /**
     * A dream activity is being opened.
     * @hide
     */
    int TRANSIT_OLD_DREAM_ACTIVITY_OPEN = 31;

    /**
     * A dream activity is being closed.
     * @hide
     */
    int TRANSIT_OLD_DREAM_ACTIVITY_CLOSE = 32;

    /**
    /**
     * @hide
     * @hide
     */
     */
@@ -368,7 +380,9 @@ public interface WindowManager extends ViewManager {
            TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE,
            TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE,
            TRANSIT_OLD_TASK_FRAGMENT_OPEN,
            TRANSIT_OLD_TASK_FRAGMENT_OPEN,
            TRANSIT_OLD_TASK_FRAGMENT_CLOSE,
            TRANSIT_OLD_TASK_FRAGMENT_CLOSE,
            TRANSIT_OLD_TASK_FRAGMENT_CHANGE
            TRANSIT_OLD_TASK_FRAGMENT_CHANGE,
            TRANSIT_OLD_DREAM_ACTIVITY_OPEN,
            TRANSIT_OLD_DREAM_ACTIVITY_CLOSE
    })
    })
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    @interface TransitionOldType {}
    @interface TransitionOldType {}
+3 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@


package android.window;
package android.window;


import static android.view.WindowManager.transitTypeToString;

import android.annotation.Nullable;
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.ActivityManager;
import android.app.WindowConfiguration;
import android.app.WindowConfiguration;
@@ -366,7 +368,7 @@ public final class TransitionRequestInfo implements Parcelable {
        // String fieldNameToString() { ... }
        // String fieldNameToString() { ... }


        return "TransitionRequestInfo { " +
        return "TransitionRequestInfo { " +
                "type = " + mType + ", " +
                "type = " + transitTypeToString(mType) + ", " +
                "triggerTask = " + mTriggerTask + ", " +
                "triggerTask = " + mTriggerTask + ", " +
                "remoteTransition = " + mRemoteTransition + ", " +
                "remoteTransition = " + mRemoteTransition + ", " +
                "displayChange = " + mDisplayChange +
                "displayChange = " + mDisplayChange +
+9 −0
Original line number Original line Diff line number Diff line
@@ -2422,6 +2422,15 @@
        <!--  When closing the current activity, this is the animation that is
        <!--  When closing the current activity, this is the animation that is
              run on the current activity (which is exiting the screen). -->
              run on the current activity (which is exiting the screen). -->
        <attr name="activityCloseExitAnimation" format="reference" />
        <attr name="activityCloseExitAnimation" format="reference" />
        <!--  When closing a dream activity, this is the animation that is
              run on the dream activity (which is exiting the screen). -->
        <attr name="dreamActivityCloseExitAnimation" format="reference" />
        <!--  When opening a dream activity, this is the animation that is
              run on the dream activity (which is entering the screen). -->
        <attr name="dreamActivityOpenEnterAnimation" format="reference" />
        <!--  When opening a dream activity, this is the animation that is
              run on the old activity (which is exiting the screen). -->
        <attr name="dreamActivityOpenExitAnimation" format="reference" />
        <!--  When opening an activity in a new task, this is the animation that is
        <!--  When opening an activity in a new task, this is the animation that is
              run on the activity of the new task (which is entering the screen). -->
              run on the activity of the new task (which is entering the screen). -->
        <attr name="taskOpenEnterAnimation" format="reference" />
        <attr name="taskOpenEnterAnimation" format="reference" />
+3 −0
Original line number Original line Diff line number Diff line
@@ -85,6 +85,9 @@ please see styles_device_defaults.xml.
        <item name="activityOpenExitAnimation">@anim/activity_open_exit</item>
        <item name="activityOpenExitAnimation">@anim/activity_open_exit</item>
        <item name="activityCloseEnterAnimation">@anim/activity_close_enter</item>
        <item name="activityCloseEnterAnimation">@anim/activity_close_enter</item>
        <item name="activityCloseExitAnimation">@anim/activity_close_exit</item>
        <item name="activityCloseExitAnimation">@anim/activity_close_exit</item>
        <item name="dreamActivityCloseExitAnimation">@anim/dream_activity_close_exit</item>
        <item name="dreamActivityOpenEnterAnimation">@anim/dream_activity_open_enter</item>
        <item name="dreamActivityOpenExitAnimation">@anim/dream_activity_open_exit</item>
        <item name="taskOpenEnterAnimation">@anim/task_open_enter</item>
        <item name="taskOpenEnterAnimation">@anim/task_open_enter</item>
        <item name="taskOpenExitAnimation">@anim/task_open_exit</item>
        <item name="taskOpenExitAnimation">@anim/task_open_exit</item>
        <item name="launchTaskBehindTargetAnimation">@anim/launch_task_behind_target</item>
        <item name="launchTaskBehindTargetAnimation">@anim/launch_task_behind_target</item>
Loading