From eb8abf7207aa118065999514f9248affbdd94de1 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Wed, 2 Jul 2014 15:04:09 -0700 Subject: Introduce onNewActivityOptions for return activity When an activity that is already translucent returns to the previous activity using a scene transition the receiving activity did not receive its ActivityOptions for its side of the animation. The new method onNewActivityOptions() delivers those options. Fixes bug 14869070. Change-Id: I09b136b3213aae5d3521894e17a7500ac793f3d2 --- core/java/android/app/ActivityThread.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'core/java/android/app/ActivityThread.java') diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 422d88c6b403..7b48e1d14396 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -77,6 +77,7 @@ import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.util.LogPrinter; +import android.util.Pair; import android.util.PrintWriterPrinter; import android.util.Slog; import android.util.SuperNotCalledException; @@ -1113,6 +1114,11 @@ public final class ActivityThread { sendMessage(H.TRANSLUCENT_CONVERSION_COMPLETE, token, drawComplete ? 1 : 0); } + public void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options) { + sendMessage(H.ON_NEW_ACTIVITY_OPTIONS, + new Pair(token, options)); + } + public void setProcessState(int state) { updateProcessState(state, true); } @@ -1196,6 +1202,7 @@ public final class ActivityThread { public static final int REQUEST_ASSIST_CONTEXT_EXTRAS = 143; public static final int TRANSLUCENT_CONVERSION_COMPLETE = 144; public static final int INSTALL_PROVIDER = 145; + public static final int ON_NEW_ACTIVITY_OPTIONS = 146; String codeToString(int code) { if (DEBUG_MESSAGES) { @@ -1245,6 +1252,7 @@ public final class ActivityThread { case REQUEST_ASSIST_CONTEXT_EXTRAS: return "REQUEST_ASSIST_CONTEXT_EXTRAS"; case TRANSLUCENT_CONVERSION_COMPLETE: return "TRANSLUCENT_CONVERSION_COMPLETE"; case INSTALL_PROVIDER: return "INSTALL_PROVIDER"; + case ON_NEW_ACTIVITY_OPTIONS: return "ON_NEW_ACTIVITY_OPTIONS"; } } return Integer.toString(code); @@ -1459,6 +1467,10 @@ public final class ActivityThread { case INSTALL_PROVIDER: handleInstallProvider((ProviderInfo) msg.obj); break; + case ON_NEW_ACTIVITY_OPTIONS: + Pair pair = (Pair) msg.obj; + onNewActivityOptions(pair.first, pair.second); + break; } if (DEBUG_MESSAGES) Slog.v(TAG, "<<< done: " + codeToString(msg.what)); } @@ -2435,6 +2447,13 @@ public final class ActivityThread { } } + public void onNewActivityOptions(IBinder token, ActivityOptions options) { + ActivityClientRecord r = mActivities.get(token); + if (r != null) { + r.activity.onNewActivityOptions(options); + } + } + public void handleInstallProvider(ProviderInfo info) { installContentProviders(mInitialApplication, Lists.newArrayList(info)); } -- cgit v1.2.3