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

Unified Diff: platform_tools/android/bin/adb_wait_for_charge

Issue 2105813003: Check for empty output in adb_wait_for_charge. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/bin/adb_wait_for_charge
diff --git a/platform_tools/android/bin/adb_wait_for_charge b/platform_tools/android/bin/adb_wait_for_charge
index e24773aedaad18bbde976b4d589935a7630598fb..f05c44f4557b75843ea4a72bb62371fd91df9738 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
« 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