summaryrefslogtreecommitdiffstats
path: root/chromecast/tools
diff options
context:
space:
mode:
authorgunsch <gunsch@chromium.org>2014-10-01 12:31:35 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-01 19:32:06 +0000
commitcc40100c7c9b5be5ae9f13b888e875d63f2844cd (patch)
tree067d73eaa952b1c66fe825cb26fd51cea843f829 /chromecast/tools
parentf903e53c0f6922ca15796f338a278d4c0013ea98 (diff)
downloadchromium_src-cc40100c7c9b5be5ae9f13b888e875d63f2844cd.zip
chromium_src-cc40100c7c9b5be5ae9f13b888e875d63f2844cd.tar.gz
chromium_src-cc40100c7c9b5be5ae9f13b888e875d63f2844cd.tar.bz2
Chromecast: script to set command line flags for Android build.
R=lcwu@chromium.org,byungchul@chromium.org BUG=None Review URL: https://codereview.chromium.org/619723003 Cr-Commit-Position: refs/heads/master@{#297691}
Diffstat (limited to 'chromecast/tools')
-rwxr-xr-xchromecast/tools/apk_command_line36
1 files changed, 36 insertions, 0 deletions
diff --git a/chromecast/tools/apk_command_line b/chromecast/tools/apk_command_line
new file mode 100755
index 0000000..0fd0001
--- /dev/null
+++ b/chromecast/tools/apk_command_line
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# If no flags are given, prints the current cast shell flags.
+#
+# Otherwise, the given flags are used to REPLACE (not modify) the cast shell
+# flags. For example:
+# apk_command_line --enable-webgl
+#
+# To remove all content shell flags, pass an empty string for the flags:
+# apk_command_line ""
+
+CMD_LINE_FILE=/data/local/tmp/castshell-command-line
+
+if [ $# -eq 0 ] ; then
+ # If nothing specified, print the command line (stripping off "castshell")
+ 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 rm $CMD_LINE_FILE >/dev/null
+else
+ # Else set it.
+ set -x
+ adb shell "echo 'castshell $*' > $CMD_LINE_FILE"
+ # Prevent other apps from modifying flags -- this can create security issues.
+ adb shell chmod 0664 $CMD_LINE_FILE
+fi