Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: services/android/src/org/chromium/mojo/android/ActivityImpl.java

Issue 1478483003: Use Intent.getDataAndType() to avoid clearing data URI in (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/android/src/org/chromium/mojo/android/ActivityImpl.java
diff --git a/services/android/src/org/chromium/mojo/android/ActivityImpl.java b/services/android/src/org/chromium/mojo/android/ActivityImpl.java
index 961c7ddfc7227bacb6c7c52c44864c14f5b4f77d..3f6232596d846dc905331d04c9b356929572bff7 100644
--- a/services/android/src/org/chromium/mojo/android/ActivityImpl.java
+++ b/services/android/src/org/chromium/mojo/android/ActivityImpl.java
@@ -171,8 +171,8 @@ public class ActivityImpl implements Activity {
*/
@Override
public void startActivity(Intent intent) {
- final android.content.Intent androidIntent =
- new android.content.Intent(intent.action, Uri.parse(intent.url));
+ final Uri uri = Uri.parse(intent.url);
+ final android.content.Intent androidIntent = new android.content.Intent(intent.action, uri);
if (intent.component != null) {
ComponentName component = intent.component;
@@ -192,7 +192,8 @@ public class ActivityImpl implements Activity {
}
if (intent.type != null) {
- androidIntent.setType(intent.type);
+ // Intent.setType() clears data URI; that's why we call setDataAndType() here.
+ androidIntent.setDataAndType(uri, intent.type);
}
try {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698