Merge "Fix issue #18510117: Returning from an activity started with..." into lmp-mr1-dev

This commit is contained in:
Dianne Hackborn
2014-12-02 19:22:06 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 7 deletions

View File

@@ -2436,7 +2436,7 @@ public final class ActivityThread {
private void deliverNewIntents(ActivityClientRecord r, List<ReferrerIntent> intents) {
final int N = intents.size();
for (int i=0; i<N; i++) {
Intent intent = intents.get(i);
ReferrerIntent intent = intents.get(i);
intent.setExtrasClassLoader(r.activity.getClassLoader());
intent.prepareToEnterProcess();
r.activity.mFragments.noteStateNotSaved();

View File

@@ -1208,14 +1208,17 @@ public class Instrumentation {
* @param intent The new intent being received.
*/
public void callActivityOnNewIntent(Activity activity, Intent intent) {
activity.onNewIntent(intent);
}
/**
* @hide
*/
public void callActivityOnNewIntent(Activity activity, ReferrerIntent intent) {
final String oldReferrer = activity.mReferrer;
try {
try {
activity.mReferrer = ((ReferrerIntent)intent).mReferrer;
} catch (ClassCastException e) {
activity.mReferrer = null;
}
activity.onNewIntent(intent);
activity.mReferrer = intent.mReferrer;
callActivityOnNewIntent(activity, new Intent(intent));
} finally {
activity.mReferrer = oldReferrer;
}