OSDN Git Service

DO NOT MERGE -- Only use saved surface if started by launcher or moved to front
authorChong Zhang <chz@google.com>
Thu, 25 Aug 2016 19:12:33 +0000 (12:12 -0700)
committerChong Zhang <chz@google.com>
Fri, 26 Aug 2016 22:41:58 +0000 (15:41 -0700)
commit813be138ae6f1fbe60a9efc082a30e7d25d03f7e
treece64115971ffd12746e16af065c03344f2891270
parentd6a64d788bfa9d9e5c765fe62ce105525aed3898
DO NOT MERGE -- Only use saved surface if started by launcher or moved to front

Restrict saved surface to launcher start (ACTION_MAIN&CATEGORY_
LAUNCHER), or there is no intent at all (eg. task being brought to
front). If the intent is something else, likely the app is going
to show some specific page or view, instead of what's left last time.

This solves problems like the launcher shortcuts on DeckClock,
each of them is a different intent and will show one specific
view regardless of last states. Another example is Chrome tab
opened directly by action VIEW to open some URL.

(Note that this doesn't solve the problem with Chrome homescreen
shortcuts, it will still start with saved surface (if Chrome
is already open). This is because the shortcut is a trampoline
activity that starts the real chrome tab activity, but when
the trampoline is started, the whole task is already brought
to front, and ChromeTab could become visible with the task
before we actually start it.)

bug: 31055479
bug: 27747315

Change-Id: Id3e61c61ef516b0edc1f174320f02661222f226b
(cherry picked from commit ad24f96def42016049de05220593aa049b136def)
core/java/android/view/IWindowManager.aidl
services/core/java/com/android/server/am/ActivityRecord.java
services/core/java/com/android/server/am/ActivityStack.java
services/core/java/com/android/server/wm/AppWindowToken.java
services/core/java/com/android/server/wm/WindowManagerService.java
tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java