Merge "Fix jank when app launched from quick panels on the lock screen" into sc-v2-dev
This commit is contained in:
@@ -1634,21 +1634,21 @@ public class AppTransition implements Dump {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TransitionType int getKeyguardTransition() {
|
@TransitionType int getKeyguardTransition() {
|
||||||
// In case we unocclude Keyguard and occlude it again, meaning that we never actually
|
if (mNextAppTransitionRequests.indexOf(TRANSIT_KEYGUARD_GOING_AWAY) != -1) {
|
||||||
// unoccclude/occlude Keyguard, but just run a normal transition.
|
return TRANSIT_KEYGUARD_GOING_AWAY;
|
||||||
final int occludeIndex = mNextAppTransitionRequests.indexOf(TRANSIT_KEYGUARD_UNOCCLUDE);
|
}
|
||||||
if (occludeIndex != -1
|
final int unoccludeIndex = mNextAppTransitionRequests.indexOf(TRANSIT_KEYGUARD_UNOCCLUDE);
|
||||||
&& occludeIndex < mNextAppTransitionRequests.indexOf(TRANSIT_KEYGUARD_OCCLUDE)) {
|
final int occludeIndex = mNextAppTransitionRequests.indexOf(TRANSIT_KEYGUARD_OCCLUDE);
|
||||||
|
// No keyguard related transition requests.
|
||||||
|
if (unoccludeIndex == -1 && occludeIndex == -1) {
|
||||||
return TRANSIT_NONE;
|
return TRANSIT_NONE;
|
||||||
}
|
}
|
||||||
|
// In case we unocclude Keyguard and occlude it again, meaning that we never actually
|
||||||
for (int i = 0; i < mNextAppTransitionRequests.size(); ++i) {
|
// unoccclude/occlude Keyguard, but just run a normal transition.
|
||||||
final @TransitionType int transit = mNextAppTransitionRequests.get(i);
|
if (unoccludeIndex != -1 && unoccludeIndex < occludeIndex) {
|
||||||
if (isKeyguardTransit(transit)) {
|
return TRANSIT_NONE;
|
||||||
return transit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return TRANSIT_NONE;
|
return unoccludeIndex != -1 ? TRANSIT_KEYGUARD_UNOCCLUDE : TRANSIT_KEYGUARD_OCCLUDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TransitionType int getFirstAppTransition() {
|
@TransitionType int getFirstAppTransition() {
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ import static android.view.WindowManager.TRANSIT_CHANGE;
|
|||||||
import static android.view.WindowManager.TRANSIT_CLOSE;
|
import static android.view.WindowManager.TRANSIT_CLOSE;
|
||||||
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
|
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
|
||||||
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
|
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
|
||||||
|
import static android.view.WindowManager.TRANSIT_KEYGUARD_OCCLUDE;
|
||||||
|
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
|
||||||
|
import static android.view.WindowManager.TRANSIT_NONE;
|
||||||
import static android.view.WindowManager.TRANSIT_OLD_CRASHING_ACTIVITY_CLOSE;
|
import static android.view.WindowManager.TRANSIT_OLD_CRASHING_ACTIVITY_CLOSE;
|
||||||
import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY;
|
import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY;
|
||||||
import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE;
|
import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE;
|
||||||
@@ -92,6 +95,7 @@ public class AppTransitionTests extends WindowTestsBase {
|
|||||||
final ActivityRecord activity = createActivityRecord(dc);
|
final ActivityRecord activity = createActivityRecord(dc);
|
||||||
|
|
||||||
mDc.prepareAppTransition(TRANSIT_OPEN);
|
mDc.prepareAppTransition(TRANSIT_OPEN);
|
||||||
|
mDc.prepareAppTransition(TRANSIT_KEYGUARD_OCCLUDE);
|
||||||
mDc.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY);
|
mDc.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY);
|
||||||
mDc.mOpeningApps.add(activity);
|
mDc.mOpeningApps.add(activity);
|
||||||
assertEquals(TRANSIT_OLD_KEYGUARD_GOING_AWAY,
|
assertEquals(TRANSIT_OLD_KEYGUARD_GOING_AWAY,
|
||||||
@@ -101,6 +105,22 @@ public class AppTransitionTests extends WindowTestsBase {
|
|||||||
null /* oldWallpaper */, false /*skipAppTransitionAnimation*/));
|
null /* oldWallpaper */, false /*skipAppTransitionAnimation*/));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testKeyguardUnoccludeOcclude() {
|
||||||
|
final DisplayContent dc = createNewDisplay(Display.STATE_ON);
|
||||||
|
final ActivityRecord activity = createActivityRecord(dc);
|
||||||
|
|
||||||
|
mDc.prepareAppTransition(TRANSIT_KEYGUARD_UNOCCLUDE);
|
||||||
|
mDc.prepareAppTransition(TRANSIT_KEYGUARD_OCCLUDE);
|
||||||
|
mDc.mOpeningApps.add(activity);
|
||||||
|
assertEquals(TRANSIT_NONE,
|
||||||
|
AppTransitionController.getTransitCompatType(mDc.mAppTransition,
|
||||||
|
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||||
|
mDisplayContent.mChangingContainers, null /* wallpaperTarget */,
|
||||||
|
null /* oldWallpaper */, false /*skipAppTransitionAnimation*/));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testKeyguardKeep() {
|
public void testKeyguardKeep() {
|
||||||
final DisplayContent dc = createNewDisplay(Display.STATE_ON);
|
final DisplayContent dc = createNewDisplay(Display.STATE_ON);
|
||||||
|
|||||||
Reference in New Issue
Block a user