Merge "Allow non-leaf task to be moved to top" into rvc-dev
This commit is contained in:
@@ -3112,7 +3112,8 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
|
||||
@Override
|
||||
boolean showToCurrentUser() {
|
||||
return mForceShowForAllUsers || showForAllUsers() || mWmService.isCurrentProfile(mUserId);
|
||||
return mForceShowForAllUsers || showForAllUsers()
|
||||
|| mWmService.isCurrentProfile(getTopMostTask().mUserId);
|
||||
}
|
||||
|
||||
void setForceShowForAllUsers(boolean forceShowForAllUsers) {
|
||||
|
||||
@@ -72,6 +72,13 @@ public class TaskStackTests extends WindowTestsBase {
|
||||
stack.positionChildAt(WindowContainer.POSITION_TOP, task2, false /* includingParents */);
|
||||
assertEquals(stack.mChildren.get(0), task2);
|
||||
assertEquals(stack.mChildren.get(1), task1);
|
||||
|
||||
// Non-leaf task should be moved to top regardless of the user id.
|
||||
createTaskInStack((ActivityStack) task2, 0 /* userId */);
|
||||
createTaskInStack((ActivityStack) task2, 1 /* userId */);
|
||||
stack.positionChildAt(WindowContainer.POSITION_TOP, task2, false /* includingParents */);
|
||||
assertEquals(stack.mChildren.get(0), task1);
|
||||
assertEquals(stack.mChildren.get(1), task2);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user