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

Unified Diff: chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastApplication.java

Issue 625823002: Chromecast Android buildfix: rework CommandLine initialization logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastBrowserHelper.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastApplication.java
diff --git a/chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastApplication.java b/chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastApplication.java
index 65ad319c7ca7e40f7964f96955602df46dfa2a08..2fb50a3201ec61cbec4188406df1388406d95437 100644
--- a/chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastApplication.java
+++ b/chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastApplication.java
@@ -4,6 +4,10 @@
package org.chromium.chromecast.shell;
+import android.os.Build;
+import android.util.Log;
+
+import org.chromium.base.CommandLine;
import org.chromium.base.PathUtils;
import org.chromium.base.ResourceExtractor;
import org.chromium.content.app.ContentApplication;
@@ -17,9 +21,11 @@ import org.chromium.content.app.ContentApplication;
* require a few basic pieces (found here).
*/
public class CastApplication extends ContentApplication {
+ private static final String TAG = "CastApplication";
private static final String[] MANDATORY_PAK_FILES = new String[] {"cast_shell.pak"};
private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "cast_shell";
+ private static final String COMMAND_LINE_FILE = "/data/local/tmp/castshell-command-line";
@Override
public void onCreate() {
@@ -32,4 +38,17 @@ public class CastApplication extends ContentApplication {
PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
}
+ @Override
+ public void initCommandLine() {
+ if (allowCommandLineImport()) {
+ Log.d(TAG, "Initializing command line from " + COMMAND_LINE_FILE);
+ CommandLine.initFromFile(COMMAND_LINE_FILE);
+ } else {
+ CommandLine.init(null);
+ }
+ }
+
+ private static boolean allowCommandLineImport() {
+ return !Build.TYPE.equals("user");
+ }
}
« no previous file with comments | « no previous file | chromecast/shell/android/apk/src/org/chromium/chromecast/shell/CastBrowserHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698