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

Unified Diff: mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java

Issue 1151363004: Mojo: Send Android args in a string array, not JSON. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 5 years, 6 months 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 | mojo/tools/mopy/android.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
diff --git a/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java b/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
index 901012fbb217adecdb4368f37cbb26f0e3f22984..bf7495656b883edc83fbc2c8c9a49444030168bd 100644
--- a/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
+++ b/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
@@ -8,26 +8,24 @@ import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
-import android.util.JsonReader;
import org.chromium.base.Log;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Activity for managing the Mojo Shell.
*/
public class MojoShellActivity extends Activity {
private static final String TAG = "MojoShellActivity";
+ private static final String EXTRAS = "org.chromium.mojo.shell.extras";
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- String[] parameters = getParametersFromIntent(getIntent());
+ String[] parameters = getIntent().getStringArrayExtra(EXTRAS);
+ for (String s : parameters) {
+ s = s.replace("\\,", ",");
+ }
if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
Uri uri = getIntent().getData();
if (uri != null) {
@@ -55,31 +53,4 @@ public class MojoShellActivity extends Activity {
// TODO(eseidel): ShellMain can fail, but we're ignoring the return.
ShellMain.start();
}
-
- private static String[] getParametersFromIntent(Intent intent) {
- if (intent == null) {
- return null;
- }
- String[] parameters = intent.getStringArrayExtra("parameters");
- if (parameters != null) {
- return parameters;
- }
- String encodedParameters = intent.getStringExtra("encodedParameters");
- if (encodedParameters != null) {
- JsonReader reader = new JsonReader(new StringReader(encodedParameters));
- List<String> parametersList = new ArrayList<String>();
- try {
- reader.beginArray();
- while (reader.hasNext()) {
- parametersList.add(reader.nextString());
- }
- reader.endArray();
- reader.close();
- return parametersList.toArray(new String[parametersList.size()]);
- } catch (IOException e) {
- Log.w(TAG, e.getMessage(), e);
- }
- }
- return null;
- }
}
« no previous file with comments | « no previous file | mojo/tools/mopy/android.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698