diff options
| author | Dianne Hackborn <hackbod@google.com> | 2015-06-09 23:33:50 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-09 23:33:52 +0000 |
| commit | 476695227393b6c35c6777754b0e3b6448ceb7d2 (patch) | |
| tree | 1ea49051f4cadd6bc07c70d39e4924e04bd4c0a0 /core/java/android/app/Instrumentation.java | |
| parent | 64d6ce8a661fd63b90b4c9f3f7d400208cb2430a (diff) | |
| parent | a3acdb33df7c7be7ff3d9f376ff833e4b0c1d897 (diff) | |
| download | frameworks_base-476695227393b6c35c6777754b0e3b6448ceb7d2.zip frameworks_base-476695227393b6c35c6777754b0e3b6448ceb7d2.tar.gz frameworks_base-476695227393b6c35c6777754b0e3b6448ceb7d2.tar.bz2 | |
Merge "Fix issue #21621920: VI: need mechanism to get current request" into mnc-dev
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(); |
