Commit 4501fb69 authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

Support profiling chromium with profile-chrome-startup.sh

Also handles a possible security exception when trying to grant
permissions that chrome probably already has.

Change-Id: I6c6ed7e35885ac4784e1f6b13c3bd9b16aaf9571
Reviewed-on: https://chromium-review.googlesource.com/c/1374390
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: default avatarMohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615961}
parent 76c6ec2d
......@@ -205,6 +205,9 @@ case $browser in
stable)
browser_package="com.android.chrome"
;;
chromium)
browser_package="org.chromium.chrome"
;;
*)
echo "Unknown browser $browser"
exit 1
......@@ -251,8 +254,13 @@ if [ $checktabs = true ] || [ $killg = true ] || [ ! -z "$taburl" ]; then
fi
# Make sure Chrome can write the trace file.
$adb shell "pm grant $browser_package android.permission.READ_EXTERNAL_STORAGE"
$adb shell "pm grant $browser_package android.permission.WRITE_EXTERNAL_STORAGE"
# These commands may fail with a security exception on some Android devices that
# don't allow changing permissions. Chrome likely already has these permissions
# so the script should still work.
$adb shell "pm grant $browser_package \
android.permission.READ_EXTERNAL_STORAGE" || true
$adb shell "pm grant $browser_package \
android.permission.WRITE_EXTERNAL_STORAGE" || true
if [ ! -z "$taburl" ]; then
echo "Opening $taburl in a single tab..."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment