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