diff options
Diffstat (limited to 'core/java/android/app/Instrumentation.java')
-rw-r--r-- | core/java/android/app/Instrumentation.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index 0cc57ba..653f1b6 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -24,6 +24,7 @@ import android.content.IntentFilter; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.hardware.input.InputManager; +import android.net.Uri; import android.os.Bundle; import android.os.Debug; import android.os.IBinder; @@ -1439,7 +1440,7 @@ public class Instrumentation { * objects and dispatches this call to the system activity manager; you can * override this to watch for the application to start an activity, and * modify what happens when it does. - * + * * <p>This method returns an {@link ActivityResult} object, which you can * use when intercepting application calls to avoid performing the start * activity action but still return the result the application is @@ -1448,10 +1449,10 @@ public class Instrumentation { * you would like the application to see, and don't call up to the super * class. Note that an application is only expecting a result if * <var>requestCode</var> is >= 0. - * + * * <p>This method throws {@link android.content.ActivityNotFoundException} * if there was no Activity found to run the given Intent. - * + * * @param who The Context from which the activity is being started. * @param contextThread The main thread of the Context from which the activity * is being started. @@ -1464,23 +1465,27 @@ public class Instrumentation { * @param requestCode Identifier for this request's result; less than zero * if the caller is not expecting a result. * @param options Addition options. - * + * * @return To force the return of a particular result, return an * ActivityResult object containing the desired data; otherwise * return null. The default implementation always returns null. - * + * * @throws android.content.ActivityNotFoundException - * + * * @see Activity#startActivity(Intent) * @see Activity#startActivityForResult(Intent, int) * @see Activity#startActivityFromChild - * + * * {@hide} */ public ActivityResult execStartActivity( Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options) { IApplicationThread whoThread = (IApplicationThread) contextThread; + Uri referrer = target != null ? target.onProvideReferrer() : null; + if (referrer != null) { + intent.putExtra(Intent.EXTRA_REFERRER, referrer); + } if (mActivityMonitors != null) { synchronized (mSync) { final int N = mActivityMonitors.size(); |