Merge "Ignore task-info changed callbacks in uninitialized Divider" into rvc-dev
This commit is contained in:
@@ -33,10 +33,8 @@ import android.view.SurfaceControl;
|
||||
import android.view.SurfaceSession;
|
||||
import android.window.TaskOrganizer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
class SplitScreenTaskOrganizer extends TaskOrganizer {
|
||||
private static final String TAG = "SplitScreenTaskOrganizer";
|
||||
private static final String TAG = "SplitScreenTaskOrg";
|
||||
private static final boolean DEBUG = Divider.DEBUG;
|
||||
|
||||
RunningTaskInfo mPrimary;
|
||||
@@ -45,7 +43,6 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
|
||||
SurfaceControl mSecondarySurface;
|
||||
SurfaceControl mPrimaryDim;
|
||||
SurfaceControl mSecondaryDim;
|
||||
ArrayList<SurfaceControl> mHomeAndRecentsSurfaces = new ArrayList<>();
|
||||
Rect mHomeBounds = new Rect();
|
||||
final Divider mDivider;
|
||||
private boolean mSplitScreenSupported = false;
|
||||
@@ -110,6 +107,15 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
|
||||
* presentations based on the contents of the split regions.
|
||||
*/
|
||||
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
|
||||
|| mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS;
|
||||
final boolean primaryWasEmpty = mPrimary.topActivityType == ACTIVITY_TYPE_UNDEFINED;
|
||||
|
||||
@@ -174,12 +174,8 @@ public class WindowManagerProxy {
|
||||
if (rootTasks.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
tiles.mHomeAndRecentsSurfaces.clear();
|
||||
for (int i = rootTasks.size() - 1; i >= 0; --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...
|
||||
if (!rootTask.isResizable()) continue;
|
||||
// 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
|
||||
// before reparent (pretty unlikely) are put into fullscreen.
|
||||
TaskOrganizer.setLaunchRoot(Display.DEFAULT_DISPLAY, null);
|
||||
tiles.mHomeAndRecentsSurfaces.clear();
|
||||
// TODO(task-org): Once task-org is more complete, consider using Appeared/Vanished
|
||||
// plus specific APIs to clean this up.
|
||||
List<ActivityManager.RunningTaskInfo> primaryChildren =
|
||||
|
||||
Reference in New Issue
Block a user