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

Side by Side Diff: platform_tools/android/bin/adb_wait_for_charge

Issue 1926833003: adb_wait_for_charge: Don't download toolchains (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # Wait for the device to be charged enough for testing. 3 # Wait for the device to be charged enough for testing.
4 4
5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6 SKIP_TOOLCHAIN_SETUP="true"
6 source $SCRIPT_DIR/android_setup.sh 7 source $SCRIPT_DIR/android_setup.sh
7 source $SCRIPT_DIR/utils/setup_adb.sh 8 source $SCRIPT_DIR/utils/setup_adb.sh
8 9
9 # Helper function used by get_battery_level. Parses the battery level from 10 # Helper function used by get_battery_level. Parses the battery level from
10 # dumpsys output. 11 # dumpsys output.
11 function _parse_battery_level { 12 function _parse_battery_level {
12 SPLIT=( $@ ) 13 SPLIT=( $@ )
13 14
14 HAS_BATTERY=1 15 HAS_BATTERY=1
15 LEVEL="" 16 LEVEL=""
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 66
66 # Wait for battery charge. 67 # Wait for battery charge.
67 DESIRED_BATTERY_LEVEL=80 68 DESIRED_BATTERY_LEVEL=80
68 CURRENT_BATTERY_LEVEL="$(get_battery_level)" 69 CURRENT_BATTERY_LEVEL="$(get_battery_level)"
69 while [ "${CURRENT_BATTERY_LEVEL}" -lt "${DESIRED_BATTERY_LEVEL}" ]; do 70 while [ "${CURRENT_BATTERY_LEVEL}" -lt "${DESIRED_BATTERY_LEVEL}" ]; do
70 echo "Battery level is ${CURRENT_BATTERY_LEVEL}; waiting to charge to ${DESIRE D_BATTERY_LEVEL}" 71 echo "Battery level is ${CURRENT_BATTERY_LEVEL}; waiting to charge to ${DESIRE D_BATTERY_LEVEL}"
71 sleep 5 72 sleep 5
72 CURRENT_BATTERY_LEVEL="$(get_battery_level)" 73 CURRENT_BATTERY_LEVEL="$(get_battery_level)"
73 done 74 done
74 75
75 echo "Charged!" 76 echo "Charged!"
OLDNEW
« 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