aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-06-29 07:02:54 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-29 07:02:54 -0700
commitd48e5b8640ebe7af2b29930e3839d1595d62d793 (patch)
tree23c07d46cda839346ee64e98764f2c0e9243c633 /platform_tools
parent44fbc79e069c28103a44387d11c62e049ef2967d (diff)
Check for empty output in adb_wait_for_charge.
Diffstat (limited to 'platform_tools')
-rwxr-xr-xplatform_tools/android/bin/adb_wait_for_charge2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform_tools/android/bin/adb_wait_for_charge b/platform_tools/android/bin/adb_wait_for_charge
index e24773aeda..f05c44f455 100755
--- a/platform_tools/android/bin/adb_wait_for_charge
+++ b/platform_tools/android/bin/adb_wait_for_charge
@@ -54,7 +54,7 @@ function get_battery_level {
STATS="$($ADB $DEVICE_SERIAL shell dumpsys battery)"
SPLIT=( $STATS )
RV="$(_parse_battery_level ${SPLIT[@]})"
- if [ "$RV" != "-1" ]; then
+ if [ -n "$RV" ] && [ "$RV" != "-1" ]; then
echo "$RV"
return
fi