summaryrefslogtreecommitdiffstats
path: root/tests/ActivityTests
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-11-04 10:31:54 -0800
committerDianne Hackborn <hackbod@google.com>2014-11-11 00:42:18 +0000
commit85d558cd486d195aabfc4b43cff8f338126f60a5 (patch)
tree0a228ca6ffb9079635434a740abeeece370f055d /tests/ActivityTests
parent993e3d2d40cbd95d78cd3d2a76c77af2f4ab0e88 (diff)
downloadframeworks_base-85d558cd486d195aabfc4b43cff8f338126f60a5.zip
frameworks_base-85d558cd486d195aabfc4b43cff8f338126f60a5.tar.gz
frameworks_base-85d558cd486d195aabfc4b43cff8f338126f60a5.tar.bz2
Add Activity API to get referrer information.
This expands the use of EXTRA_REFERRER to be relevant anywhere, allowing apps to supply referrer information if they want. However, if they don't explicitly supply it, then the platform now keeps track of package names that go with Intents when delivering them to apps, which it can be returned as the default value. The new method Activity.getReferrer() is used to retrieve this referrer information. It knows about EXTRA_REFERRER, it can return the default package name tracked internally, and it also can return a new EXTRA_REFERRER_NAME if that exists. The latter is needed because we can't use EXTRA_REFERRER in some cases since it is a Uri, and things like #Intent; URI extras can only generate primitive type extras. We really need to support this syntax for referrers, so we need to have this additional extra field as an option. When a referrer is to a native app, we are adopting the android-app scheme. Since we are doing this, Intent's URI creation and parsing now supports this scheme, and we improve its syntax to be able to build intents with custom actions and stuff, instead of being all hung up on custom schemes. While doing this, fixed a problem when parsing both intent: and new android-app: schemes with a selector portion, where we were not respecting any scheme that was specified. Change-Id: I06e55221e21a8156c1d6ac755a254fea386917a2
Diffstat (limited to 'tests/ActivityTests')
-rw-r--r--tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java b/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java
index 94874c8..b065b88 100644
--- a/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java
+++ b/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java
@@ -140,6 +140,8 @@ public class ActivityTestMain extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ Log.i(TAG, "Referrer: " + getReferrer());
+
mAm = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
if (savedInstanceState != null) {
mOverrideConfig = savedInstanceState.getParcelable(KEY_CONFIGURATION);