Let DreamActivity handle all configuration changes

On configuration changes such as screen orientation change,
activities are usually recreated to reload resources.
However, when DreamActivity is destroyed (also in the process
of activity recreation) the dream is dismissed.
To prevent this, DreamActivity was previously set to handle
orientation change without activity recreation, but orientation changes
often go along with screen size/layout changes, which still caused the
DreamActivity to be recreated.
This change lets DreamActivity handle all configuration changes without
recreation, similar to how Window-based dreams used to work.

Bug: 240892000
Merged-In: I345eb1d17ae88d893789dfcc160b4a9a664ba57f
Change-Id: I4fdf0fe5f0bcd28b9af5cbe55f20760a3719da9c
This commit is contained in:
Robert Horvath
2022-11-01 14:21:47 +00:00
parent 6c70a328e5
commit 998ef9a536

View File

@@ -1441,7 +1441,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
a.colorMode = ActivityInfo.COLOR_MODE_DEFAULT; a.colorMode = ActivityInfo.COLOR_MODE_DEFAULT;
a.flags |= ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS; a.flags |= ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS;
a.resizeMode = RESIZE_MODE_UNRESIZEABLE; a.resizeMode = RESIZE_MODE_UNRESIZEABLE;
a.configChanges = ActivityInfo.CONFIG_ORIENTATION; a.configChanges = 0xffffffff;
final ActivityOptions options = ActivityOptions.makeBasic(); final ActivityOptions options = ActivityOptions.makeBasic();
options.setLaunchActivityType(ACTIVITY_TYPE_DREAM); options.setLaunchActivityType(ACTIVITY_TYPE_DREAM);