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

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

Issue 1556023002: Android devices: wait for 100% charge (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 ready to run tests. 3 # Wait for the device to be ready to run tests.
4 4
5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6 source $SCRIPT_DIR/android_setup.sh 6 source $SCRIPT_DIR/android_setup.sh
7 source $SCRIPT_DIR/utils/setup_adb.sh 7 source $SCRIPT_DIR/utils/setup_adb.sh
8 8
9 # Helper function used by get_battery_level. Parses the battery level from 9 # Helper function used by get_battery_level. Parses the battery level from
10 # dumpsys output. 10 # dumpsys output.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 set -e 66 set -e
67 67
68 # Wait for the device to be connected and fully booted. 68 # Wait for the device to be connected and fully booted.
69 while [ "$($ADB $DEVICE_SERIAL shell getprop sys.boot_completed | tr -d '\r')" ! = "1" ]; do 69 while [ "$($ADB $DEVICE_SERIAL shell getprop sys.boot_completed | tr -d '\r')" ! = "1" ]; do
70 echo "Waiting for the device to be connected and ready." 70 echo "Waiting for the device to be connected and ready."
71 sleep 5 71 sleep 5
72 done 72 done
73 73
74 # Wait for battery charge. 74 # Wait for battery charge.
75 DESIRED_BATTERY_LEVEL=30 75 DESIRED_BATTERY_LEVEL=100
76 CURRENT_BATTERY_LEVEL="$(get_battery_level)" 76 CURRENT_BATTERY_LEVEL="$(get_battery_level)"
77 while [ "${CURRENT_BATTERY_LEVEL}" -lt "${DESIRED_BATTERY_LEVEL}" ]; do 77 while [ "${CURRENT_BATTERY_LEVEL}" -lt "${DESIRED_BATTERY_LEVEL}" ]; do
78 echo "Battery level is ${CURRENT_BATTERY_LEVEL}; waiting to charge to ${DESIRE D_BATTERY_LEVEL}" 78 echo "Battery level is ${CURRENT_BATTERY_LEVEL}; waiting to charge to ${DESIRE D_BATTERY_LEVEL}"
79 sleep 5 79 sleep 5
80 CURRENT_BATTERY_LEVEL="$(get_battery_level)" 80 CURRENT_BATTERY_LEVEL="$(get_battery_level)"
81 done 81 done
82 82
83 echo "Ready!" 83 echo "Ready!"
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