Created
May 10, 2012 22:12
-
-
Save dhylands/2656232 to your computer and use it in GitHub Desktop.
Enable OMTC for B2G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script to enable/disable OMTC | |
# Make disable-omtc a symlink to enable-omtc | |
#set -x | |
script_name=$(basename $0) | |
ENABLE_OMTC=/tmp/enable-omtc | |
DISABLE_OMTC=/tmp/disable-omtc | |
LOCAL_PREFS_JS=/tmp/prefs.js | |
PROFILE_DIR=$(adb shell echo -n "/data/b2g/mozilla/*.default") | |
REMOTE_PREFS_JS=${PROFILE_DIR}/prefs.js | |
rm -f ${LOCAL_PREFS_JS} | |
adb pull ${REMOTE_PREFS_JS} ${LOCAL_PREFS_JS} | |
if [ "${script_name}" == "enable-omtc" ] | |
then | |
enable="true" | |
else | |
enable="false" | |
fi | |
grep -v layers.offmainthreadcomposition.enabled ${LOCAL_PREFS_JS} > ${LOCAL_PREFS_JS}.tmp | |
echo 'user_pref("layers.offmainthreadcomposition.enabled", '${enable}');' >> ${LOCAL_PREFS_JS}.tmp | |
set -x | |
adb push ${LOCAL_PREFS_JS}.tmp ${REMOTE_PREFS_JS} | |
adb shell killall b2g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment