diff options
| author | Wale Ogunwale <ogunwale@google.com> | 2016-09-13 08:25:54 -0700 |
|---|---|---|
| committer | Wale Ogunwale <ogunwale@google.com> | 2016-09-13 10:38:30 -0700 |
| commit | 826c706156a5b9eff2bdd4d7ef5fecf75cc884b1 (patch) | |
| tree | 6501eca00e1cec7bb79948fda2f69b08aa575585 /core/java/android/app/ApplicationThreadNative.java | |
| parent | e0ca918e23439488bb699f741fd751285ae762ce (diff) | |
Immediately deliver new intent to paused activity in docked stack
When the docked stack is minimized and we are unminimizing it
due to a request to start it's currently paused top activity,
it is possible for the new intent not do be delivered immediately
because it isn't resumed due to another activity been launched in
the system (Recents) which is resumed instead. So, the user won't
see the effect of the new intent until they touch the docked activity
causing it to get the new intent and resume.
We now deliver new intents to the top activity in the docked stack if
it is in a minimized state. Then on the client side we temporarily
resume the activity and pause it again to guarantee onResume is called
after onNewIntent.
Bug: 31371093
Change-Id: Ib1764ccf5efc9d6498ce6cc8a34236c79fc07dad
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
| -rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index d6da3f44f4a0..05d9d7e412f0 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -190,7 +190,8 @@ public abstract class ApplicationThreadNative extends Binder data.enforceInterface(IApplicationThread.descriptor); List<ReferrerIntent> pi = data.createTypedArrayList(ReferrerIntent.CREATOR); IBinder b = data.readStrongBinder(); - scheduleNewIntent(pi, b); + final boolean andPause = data.readInt() == 1; + scheduleNewIntent(pi, b, andPause); return true; } @@ -909,12 +910,13 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } - public void scheduleNewIntent(List<ReferrerIntent> intents, IBinder token) + public void scheduleNewIntent(List<ReferrerIntent> intents, IBinder token, boolean andPause) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeTypedList(intents); data.writeStrongBinder(token); + data.writeInt(andPause ? 1 : 0); mRemote.transact(SCHEDULE_NEW_INTENT_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); |
