diff --git a/core/java/android/service/dreams/DreamActivity.java b/core/java/android/service/dreams/DreamActivity.java
index 0a29edc81f2fb..09d1bb9d2b123 100644
--- a/core/java/android/service/dreams/DreamActivity.java
+++ b/core/java/android/service/dreams/DreamActivity.java
@@ -21,6 +21,8 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.WindowInsets;
+import com.android.internal.R;
+
/**
* 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
@@ -56,8 +58,20 @@ public class DreamActivity extends Activity {
if (callback != null) {
callback.onActivityCreated(this);
}
+ }
+ @Override
+ public void onResume() {
+ super.onResume();
// Hide all insets (nav bar, status bar, etc) when the dream is showing
getWindow().getInsetsController().hide(WindowInsets.Type.systemBars());
+ 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);
}
}
diff --git a/core/java/android/service/dreams/DreamService.java b/core/java/android/service/dreams/DreamService.java
index 337027ef5bc99..4e9e3d49694e1 100644
--- a/core/java/android/service/dreams/DreamService.java
+++ b/core/java/android/service/dreams/DreamService.java
@@ -1052,7 +1052,6 @@ public class DreamService extends Service implements Window.Callback {
mWindow.requestFeature(Window.FEATURE_NO_TITLE);
WindowManager.LayoutParams lp = mWindow.getAttributes();
- lp.windowAnimations = com.android.internal.R.style.Animation_Dream;
lp.flags |= (WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
diff --git a/core/res/res/anim/dream_activity_close_exit.xml b/core/res/res/anim/dream_activity_close_exit.xml
new file mode 100644
index 0000000000000..c4599dad31a06
--- /dev/null
+++ b/core/res/res/anim/dream_activity_close_exit.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/core/res/res/anim/dream_activity_open_enter.xml b/core/res/res/anim/dream_activity_open_enter.xml
new file mode 100644
index 0000000000000..9e1c6e2ee0d72
--- /dev/null
+++ b/core/res/res/anim/dream_activity_open_enter.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
diff --git a/core/res/res/anim/dream_activity_open_exit.xml b/core/res/res/anim/dream_activity_open_exit.xml
new file mode 100644
index 0000000000000..740f52856b7f0
--- /dev/null
+++ b/core/res/res/anim/dream_activity_open_exit.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index bcce1f05f0ddc..f920083f5cb30 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -248,12 +248,6 @@ please see styles_device_defaults.xml.
- @anim/fast_fade_out
-
-
-