Merge "Make PINNED mode alwaysCreateStack" into rvc-dev am: 71d6e68736
Change-Id: I569a9a09b0baeb07d43314b927fc685e9ddb2eea
This commit is contained in:
@@ -783,6 +783,11 @@ class ActivityStack extends Task {
|
||||
if (currentMode == WINDOWING_MODE_PINNED) {
|
||||
mAtmService.getTaskChangeNotificationController().notifyActivityUnpinned();
|
||||
}
|
||||
if (likelyResolvedMode == WINDOWING_MODE_PINNED
|
||||
&& taskDisplayArea.getRootPinnedTask() != null) {
|
||||
// Can only have 1 pip at a time, so replace an existing pip
|
||||
taskDisplayArea.getRootPinnedTask().dismissPip();
|
||||
}
|
||||
if (likelyResolvedMode != WINDOWING_MODE_FULLSCREEN
|
||||
&& topActivity != null && !topActivity.noDisplay
|
||||
&& topActivity.isNonResizableOrForcedResizable(likelyResolvedMode)) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import static android.app.WindowConfiguration.ROTATION_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
|
||||
@@ -5028,6 +5029,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
|
||||
return activityType == ACTIVITY_TYPE_STANDARD
|
||||
&& (windowingMode == WINDOWING_MODE_FULLSCREEN
|
||||
|| windowingMode == WINDOWING_MODE_FREEFORM
|
||||
|| windowingMode == WINDOWING_MODE_PINNED
|
||||
|| windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY
|
||||
|| windowingMode == WINDOWING_MODE_MULTI_WINDOW);
|
||||
}
|
||||
|
||||
@@ -3072,6 +3072,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
mForceShowForAllUsers = forceShowForAllUsers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAttached() {
|
||||
final TaskDisplayArea taskDisplayArea = getDisplayArea();
|
||||
return taskDisplayArea != null && !taskDisplayArea.isRemoved();
|
||||
|
||||
@@ -879,6 +879,11 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
|
||||
+ windowingMode);
|
||||
}
|
||||
|
||||
if (windowingMode == WINDOWING_MODE_PINNED && getRootPinnedTask() != null) {
|
||||
// Only 1 stack can be PINNED at a time, so dismiss the existing one
|
||||
getRootPinnedTask().dismissPip();
|
||||
}
|
||||
|
||||
final int stackId = getNextStackId();
|
||||
return createStackUnchecked(windowingMode, activityType, stackId, onTop, info, intent,
|
||||
createdByOrganizer);
|
||||
|
||||
@@ -737,6 +737,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
return parent != null ? parent.getDisplayArea() : null;
|
||||
}
|
||||
|
||||
boolean isAttached() {
|
||||
return getDisplayArea() != null;
|
||||
}
|
||||
|
||||
void setWaitingForDrawnIfResizingChanged() {
|
||||
for (int i = mChildren.size() - 1; i >= 0; --i) {
|
||||
final WindowContainer wc = mChildren.get(i);
|
||||
|
||||
@@ -129,6 +129,10 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
||||
final Map.Entry<IBinder, WindowContainerTransaction.Change> entry =
|
||||
entries.next();
|
||||
final WindowContainer wc = WindowContainer.fromBinder(entry.getKey());
|
||||
if (!wc.isAttached()) {
|
||||
Slog.e(TAG, "Attempt to operate on detached container: " + wc);
|
||||
continue;
|
||||
}
|
||||
int containerEffect = applyWindowContainerChange(wc, entry.getValue());
|
||||
effects |= containerEffect;
|
||||
|
||||
@@ -146,6 +150,10 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
||||
for (int i = 0, n = hops.size(); i < n; ++i) {
|
||||
final WindowContainerTransaction.HierarchyOp hop = hops.get(i);
|
||||
final WindowContainer wc = WindowContainer.fromBinder(hop.getContainer());
|
||||
if (!wc.isAttached()) {
|
||||
Slog.e(TAG, "Attempt to operate on detached container: " + wc);
|
||||
continue;
|
||||
}
|
||||
effects |= sanitizeAndApplyHierarchyOp(wc, hop);
|
||||
}
|
||||
if ((effects & TRANSACT_EFFECTS_LIFECYCLE) != 0) {
|
||||
|
||||
@@ -172,7 +172,7 @@ public class TaskDisplayAreaTests extends WindowTestsBase {
|
||||
assertGetOrCreateStack(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, type, candidateTask,
|
||||
false /* reuseCandidate */);
|
||||
assertGetOrCreateStack(WINDOWING_MODE_PINNED, type, candidateTask,
|
||||
false /* reuseCandidate */);
|
||||
true /* reuseCandidate */);
|
||||
|
||||
final int windowingMode = WINDOWING_MODE_FULLSCREEN;
|
||||
assertGetOrCreateStack(windowingMode, ACTIVITY_TYPE_HOME, candidateTask,
|
||||
|
||||
Reference in New Issue
Block a user