Merge "Updates visibility before trying to notify task stack changes" into rvc-dev
This commit is contained in:
@@ -1276,6 +1276,8 @@ class ActivityStack extends Task {
|
|||||||
prev.cpuTimeAtResume = 0; // reset it
|
prev.cpuTimeAtResume = 0; // reset it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mRootWindowContainer.ensureActivitiesVisible(resuming, 0, !PRESERVE_WINDOWS);
|
||||||
|
|
||||||
// Notify when the task stack has changed, but only if visibilities changed (not just
|
// Notify when the task stack has changed, but only if visibilities changed (not just
|
||||||
// focus). Also if there is an active pinned stack - we always want to notify it about
|
// focus). Also if there is an active pinned stack - we always want to notify it about
|
||||||
// task stack changes, because its positioning may depend on it.
|
// task stack changes, because its positioning may depend on it.
|
||||||
@@ -1284,8 +1286,6 @@ class ActivityStack extends Task {
|
|||||||
mAtmService.getTaskChangeNotificationController().notifyTaskStackChanged();
|
mAtmService.getTaskChangeNotificationController().notifyTaskStackChanged();
|
||||||
mStackSupervisor.mAppVisibilitiesChangedSinceLastPause = false;
|
mStackSupervisor.mAppVisibilitiesChangedSinceLastPause = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mRootWindowContainer.ensureActivitiesVisible(resuming, 0, !PRESERVE_WINDOWS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isTopStackInDisplayArea() {
|
boolean isTopStackInDisplayArea() {
|
||||||
|
|||||||
@@ -58,6 +58,8 @@
|
|||||||
android:screenOrientation="sensorLandscape"
|
android:screenOrientation="sensorLandscape"
|
||||||
android:showWhenLocked="true"
|
android:showWhenLocked="true"
|
||||||
android:turnScreenOn="true" />
|
android:turnScreenOn="true" />
|
||||||
|
<activity android:name="com.android.server.wm.TaskStackChangedListenerTest$ResumeWhilePausingActivity"
|
||||||
|
android:resumeWhilePausing="true"/>
|
||||||
<activity android:name="com.android.server.wm.ScreenDecorWindowTests$TestActivity"
|
<activity android:name="com.android.server.wm.ScreenDecorWindowTests$TestActivity"
|
||||||
android:showWhenLocked="true" android:allowEmbedded="true"/>
|
android:showWhenLocked="true" android:allowEmbedded="true"/>
|
||||||
</application>
|
</application>
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public class TaskStackChangedListenerTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
mService = ActivityManager.getService();
|
mService = ActivityManager.getService();
|
||||||
|
sTaskStackChangedCalled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
@@ -112,6 +113,28 @@ public class TaskStackChangedListenerTest {
|
|||||||
assertTrue(sActivityBResumed);
|
assertTrue(sActivityBResumed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Presubmit
|
||||||
|
public void testTaskStackChanged_resumeWhilePausing() throws Exception {
|
||||||
|
registerTaskStackChangedListener(new TaskStackListener() {
|
||||||
|
@Override
|
||||||
|
public void onTaskStackChanged() throws RemoteException {
|
||||||
|
synchronized (sLock) {
|
||||||
|
sTaskStackChangedCalled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Context context = getInstrumentation().getContext();
|
||||||
|
context.startActivity(new Intent(context, ResumeWhilePausingActivity.class).addFlags(
|
||||||
|
Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||||
|
UiDevice.getInstance(getInstrumentation()).waitForIdle();
|
||||||
|
|
||||||
|
synchronized (sLock) {
|
||||||
|
assertTrue(sTaskStackChangedCalled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Presubmit
|
@Presubmit
|
||||||
public void testTaskDescriptionChanged() throws Exception {
|
public void testTaskDescriptionChanged() throws Exception {
|
||||||
@@ -617,5 +640,7 @@ public class TaskStackChangedListenerTest {
|
|||||||
// Activity that has {@link android.R.attr#resizeableActivity} attribute set to {@code true}
|
// Activity that has {@link android.R.attr#resizeableActivity} attribute set to {@code true}
|
||||||
public static class ActivityInActivityView extends TestActivity {}
|
public static class ActivityInActivityView extends TestActivity {}
|
||||||
|
|
||||||
|
public static class ResumeWhilePausingActivity extends TestActivity {}
|
||||||
|
|
||||||
public static class LandscapeActivity extends TestActivity {}
|
public static class LandscapeActivity extends TestActivity {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user