Merge "Ignore task-info changed callbacks in uninitialized Divider" into rvc-dev am: 695a430cb5 am: eeeffd3f73
Change-Id: Icbbee3fc1a8ec8f1438903b9f0a645bbc60c3105
This commit is contained in:
@@ -33,10 +33,8 @@ import android.view.SurfaceControl;
|
|||||||
import android.view.SurfaceSession;
|
import android.view.SurfaceSession;
|
||||||
import android.window.TaskOrganizer;
|
import android.window.TaskOrganizer;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
class SplitScreenTaskOrganizer extends TaskOrganizer {
|
class SplitScreenTaskOrganizer extends TaskOrganizer {
|
||||||
private static final String TAG = "SplitScreenTaskOrganizer";
|
private static final String TAG = "SplitScreenTaskOrg";
|
||||||
private static final boolean DEBUG = Divider.DEBUG;
|
private static final boolean DEBUG = Divider.DEBUG;
|
||||||
|
|
||||||
RunningTaskInfo mPrimary;
|
RunningTaskInfo mPrimary;
|
||||||
@@ -45,7 +43,6 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
|
|||||||
SurfaceControl mSecondarySurface;
|
SurfaceControl mSecondarySurface;
|
||||||
SurfaceControl mPrimaryDim;
|
SurfaceControl mPrimaryDim;
|
||||||
SurfaceControl mSecondaryDim;
|
SurfaceControl mSecondaryDim;
|
||||||
ArrayList<SurfaceControl> mHomeAndRecentsSurfaces = new ArrayList<>();
|
|
||||||
Rect mHomeBounds = new Rect();
|
Rect mHomeBounds = new Rect();
|
||||||
final Divider mDivider;
|
final Divider mDivider;
|
||||||
private boolean mSplitScreenSupported = false;
|
private boolean mSplitScreenSupported = false;
|
||||||
@@ -110,6 +107,15 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
|
|||||||
* presentations based on the contents of the split regions.
|
* presentations based on the contents of the split regions.
|
||||||
*/
|
*/
|
||||||
private void handleTaskInfoChanged(RunningTaskInfo info) {
|
private void handleTaskInfoChanged(RunningTaskInfo info) {
|
||||||
|
if (!mSplitScreenSupported) {
|
||||||
|
// This shouldn't happen; but apparently there is a chance that SysUI crashes without
|
||||||
|
// system server receiving binder-death (or maybe it receives binder-death too late?).
|
||||||
|
// In this situation, when sys-ui restarts, the split root-tasks will still exist so
|
||||||
|
// there is a small window of time during init() where WM might send messages here
|
||||||
|
// before init() fails. So, avoid a cycle of crashes by returning early.
|
||||||
|
Log.e(TAG, "Got handleTaskInfoChanged when not initialized: " + info);
|
||||||
|
return;
|
||||||
|
}
|
||||||
final boolean secondaryWasHomeOrRecents = mSecondary.topActivityType == ACTIVITY_TYPE_HOME
|
final boolean secondaryWasHomeOrRecents = mSecondary.topActivityType == ACTIVITY_TYPE_HOME
|
||||||
|| mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS;
|
|| mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS;
|
||||||
final boolean primaryWasEmpty = mPrimary.topActivityType == ACTIVITY_TYPE_UNDEFINED;
|
final boolean primaryWasEmpty = mPrimary.topActivityType == ACTIVITY_TYPE_UNDEFINED;
|
||||||
|
|||||||
@@ -174,12 +174,8 @@ public class WindowManagerProxy {
|
|||||||
if (rootTasks.isEmpty()) {
|
if (rootTasks.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tiles.mHomeAndRecentsSurfaces.clear();
|
|
||||||
for (int i = rootTasks.size() - 1; i >= 0; --i) {
|
for (int i = rootTasks.size() - 1; i >= 0; --i) {
|
||||||
final ActivityManager.RunningTaskInfo rootTask = rootTasks.get(i);
|
final ActivityManager.RunningTaskInfo rootTask = rootTasks.get(i);
|
||||||
if (isHomeOrRecentTask(rootTask)) {
|
|
||||||
tiles.mHomeAndRecentsSurfaces.add(rootTask.token.getLeash());
|
|
||||||
}
|
|
||||||
// Only move resizeable task to split secondary. WM will just ignore this anyways...
|
// Only move resizeable task to split secondary. WM will just ignore this anyways...
|
||||||
if (!rootTask.isResizable()) continue;
|
if (!rootTask.isResizable()) continue;
|
||||||
// Only move fullscreen tasks to split secondary.
|
// Only move fullscreen tasks to split secondary.
|
||||||
@@ -211,7 +207,6 @@ public class WindowManagerProxy {
|
|||||||
// Set launch root first so that any task created after getChildContainers and
|
// Set launch root first so that any task created after getChildContainers and
|
||||||
// before reparent (pretty unlikely) are put into fullscreen.
|
// before reparent (pretty unlikely) are put into fullscreen.
|
||||||
TaskOrganizer.setLaunchRoot(Display.DEFAULT_DISPLAY, null);
|
TaskOrganizer.setLaunchRoot(Display.DEFAULT_DISPLAY, null);
|
||||||
tiles.mHomeAndRecentsSurfaces.clear();
|
|
||||||
// TODO(task-org): Once task-org is more complete, consider using Appeared/Vanished
|
// TODO(task-org): Once task-org is more complete, consider using Appeared/Vanished
|
||||||
// plus specific APIs to clean this up.
|
// plus specific APIs to clean this up.
|
||||||
List<ActivityManager.RunningTaskInfo> primaryChildren =
|
List<ActivityManager.RunningTaskInfo> primaryChildren =
|
||||||
|
|||||||
Reference in New Issue
Block a user