OSDN Git Service

Consider lock state when determining next activity to become visible.
authorBryce Lee <brycelee@google.com>
Sat, 14 Apr 2018 00:58:02 +0000 (17:58 -0700)
committerBryce Lee <brycelee@google.com>
Fri, 20 Apr 2018 15:32:11 +0000 (08:32 -0700)
commitc961e0a52b6884914c1edb450e47edd1e2bd8ef1
treecebd74c3293ba0c2af70f43be949e7150f6d96fd
parent069c5b58b09d14263b9a86852d60da45651b3099
Consider lock state when determining next activity to become visible.

When an activity shown on top of the lock screen finishes, the next
activity to become visible is considered. This activity is determined
by the supervisor's top running activity. When the focused stack does
not have a top running activity, the top most non-focused stack's
top running activity is considered. In the case the device is locked,
this value may be an activity that does not show on lock screen. As
a result, the finishing activity will wait indefinitely for an
activity that will never appear.

This changelist introduces the ability to ask for the top running
activity taking the current locked state into consideration. When
locked, only activities that can show on top of the lock screen will
be returned if we consider non-focused stacks.

Change-Id: I235e345c0b1d255b44d147bc71069c164389db4f
Fixes: 76424176
Test: atest FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests#testNonFocusedTopRunningActivity
services/core/java/com/android/server/am/ActivityStack.java
services/core/java/com/android/server/am/ActivityStackSupervisor.java
services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java
services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java