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

Unified Diff: base/android/java/src/org/chromium/base/CommandLineInitUtil.java

Issue 2160243002: android: Use /data/local/tmp/ for the command line on userdebug and eng builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/CommandLineInitUtil.java
diff --git a/base/android/java/src/org/chromium/base/CommandLineInitUtil.java b/base/android/java/src/org/chromium/base/CommandLineInitUtil.java
index 6aa227c932332e603ccf18e0b502225ca584775f..fa10cd662cbb6368c55d20707a285cdbe2c50d35 100644
--- a/base/android/java/src/org/chromium/base/CommandLineInitUtil.java
+++ b/base/android/java/src/org/chromium/base/CommandLineInitUtil.java
@@ -51,7 +51,9 @@ public final class CommandLineInitUtil {
public static void initCommandLine(Context context, String fileName) {
if (!CommandLine.isInitialized()) {
File commandLineFile = getAlternativeCommandLinePath(context, fileName);
- if (commandLineFile == null) {
+ if (commandLineFile != null) {
+ Log.i(TAG, "Using alternative command line file in " + commandLineFile.getPath());
+ } else {
commandLineFile = new File(COMMAND_LINE_FILE_PATH, fileName);
}
CommandLine.initFromFile(commandLineFile.getPath());
@@ -59,7 +61,9 @@ public final class CommandLineInitUtil {
}
/**
- * Use an alternative path if adb is enabled and this is the debug app.
+ * Use an alternative path if:
+ * - The current build is "eng" or "userdebug", OR
+ * - adb is enabled and this is the debug app.
*/
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
private static File getAlternativeCommandLinePath(Context context, String fileName) {
@@ -67,13 +71,15 @@ public final class CommandLineInitUtil {
new File(COMMAND_LINE_FILE_PATH_DEBUG_APP, fileName);
if (!alternativeCommandLineFile.exists()) return null;
try {
+ if ("eng".equals(Build.TYPE) || "userdebug".equals(Build.TYPE)) {
+ return alternativeCommandLineFile;
+ }
+
String debugApp = Build.VERSION.SDK_INT < 17
? getDebugAppPreJBMR1(context) : getDebugAppJBMR1(context);
if (debugApp != null
&& debugApp.equals(context.getApplicationContext().getPackageName())) {
- Log.i(TAG, "Using alternative command line file in "
- + alternativeCommandLineFile.getPath());
return alternativeCommandLineFile;
}
} catch (RuntimeException e) {
« 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