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

Unified Diff: build/android/adb_chrome_public_command_line

Issue 1165753002: Fix adb_chrome_public_command_line for Android M & refactor into a helper .sh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use sdklevel rather than feature detection for su style Created 5 years, 7 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
Index: build/android/adb_chrome_public_command_line
diff --git a/build/android/adb_chrome_public_command_line b/build/android/adb_chrome_public_command_line
index efbd6ff9d8bcafac5d863c683539a4946208cb1c..9bf91c6ace77a3dc002c7dbca85f3fa702e0686d 100755
--- a/build/android/adb_chrome_public_command_line
+++ b/build/android/adb_chrome_public_command_line
@@ -13,25 +13,7 @@
# To remove all Chrome flags, pass an empty string for the flags:
# adb_chrome_public_command_line ""
+. $(dirname $0)/adb_command_line_functions.sh
CMD_LINE_FILE=/data/local/chrome-command-line
-
-if [ $# -eq 0 ] ; then
- # If nothing specified, print the command line (stripping off "chrome")
- tempfile=$(tempfile)
- adb pull $CMD_LINE_FILE $tempfile 2>/dev/null
- if [ $? -eq 0 ] ; then
- rm $tempfile
- adb shell cat $CMD_LINE_FILE | cut -d " " -f "2-" 2>/dev/null
- fi
-elif [ $# -eq 1 ] && [ "$1" = '' ] ; then
- # If given an empty string, delete the command line.
- set -x
- adb shell su -c rm $CMD_LINE_FILE >/dev/null
-else
- # Else set it.
- set -x
- adb shell "echo 'chrome $*' | su -c dd of=$CMD_LINE_FILE"
- # Prevent other apps from modifying flags -- this can create security issues.
- adb shell su -c chmod 0664 $CMD_LINE_FILE
-fi
-
+REQUIRES_SU=1
+set_command_line "$@"

Powered by Google App Engine
This is Rietveld 408576698