diff options
author | Dianne Hackborn <hackbod@google.com> | 2014-12-10 19:21:58 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2014-12-10 19:21:58 +0000 |
commit | 9b287368b05f36e322f339b82d2bb495f230ca50 (patch) | |
tree | f75f3543dcd897f836c5f33deda6724f2c28fa18 | |
parent | 71433a9047721e48d0f49b990dc921561c173e50 (diff) | |
parent | 7557ec128f3d2e6dca42b92b2771d1cf486cbb0c (diff) | |
download | frameworks_base-9b287368b05f36e322f339b82d2bb495f230ca50.zip frameworks_base-9b287368b05f36e322f339b82d2bb495f230ca50.tar.gz frameworks_base-9b287368b05f36e322f339b82d2bb495f230ca50.tar.bz2 |
am 6bdbae07: Merge "Fix issue #18665625 CTS:android.app.cts.InstrumentationTest#..." into lmp-mr1-dev
automerge: 7557ec1
* commit '7557ec128f3d2e6dca42b92b2771d1cf486cbb0c':
Fix issue #18665625 CTS:android.app.cts.InstrumentationTest#...
-rw-r--r-- | core/java/android/app/Instrumentation.java | 6 | ||||
-rw-r--r-- | core/java/android/content/Intent.java | 23 |
2 files changed, 18 insertions, 11 deletions
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index 3c30404..ad2b61f 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -1217,8 +1217,10 @@ public class Instrumentation { public void callActivityOnNewIntent(Activity activity, ReferrerIntent intent) { final String oldReferrer = activity.mReferrer; try { - activity.mReferrer = intent.mReferrer; - callActivityOnNewIntent(activity, new Intent(intent)); + if (intent != null) { + activity.mReferrer = intent.mReferrer; + } + callActivityOnNewIntent(activity, intent != null ? new Intent(intent) : null); } finally { activity.mReferrer = oldReferrer; } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index de7fbab..5ebbf16 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -4391,7 +4391,7 @@ public class Intent implements Parcelable, Cloneable { // scheme else if (uri.startsWith("scheme=", i)) { if (inSelector) { - intent.mData = Uri.parse(value); + intent.mData = Uri.parse(value + ":"); } else { scheme = value; } @@ -4461,14 +4461,19 @@ public class Intent implements Parcelable, Cloneable { String authority = null; intent.mPackage = data.substring(14, end); int newEnd; - if (end < data.length() && (newEnd=data.indexOf('/', end+1)) >= 0) { - // Found a scheme, remember it. - scheme = data.substring(end+1, newEnd); - end = newEnd; - if (end < data.length() && (newEnd=data.indexOf('/', end+1)) >= 0) { - // Found a authority, remember it. - authority = data.substring(end+1, newEnd); + if ((end+1) < data.length()) { + if ((newEnd=data.indexOf('/', end+1)) >= 0) { + // Found a scheme, remember it. + scheme = data.substring(end+1, newEnd); end = newEnd; + if (end < data.length() && (newEnd=data.indexOf('/', end+1)) >= 0) { + // Found a authority, remember it. + authority = data.substring(end+1, newEnd); + end = newEnd; + } + } else { + // All we have is a scheme. + scheme = data.substring(end+1); } } if (scheme == null) { @@ -7355,7 +7360,7 @@ public class Intent implements Parcelable, Cloneable { toUriInner(frag, scheme, defAction, defPackage, flags); if (mSelector != null) { - uri.append("SEL;"); + frag.append("SEL;"); // Note that for now we are not going to try to handle the // data part; not clear how to represent this as a URI, and // not much utility in it. |