diff options
author | Jeff Sharkey <jsharkey@android.com> | 2017-05-03 11:38:01 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2017-05-05 14:58:47 -0600 |
commit | fd65813157e4dd7fa9f0b7c5dd4c8f536cc6316a (patch) | |
tree | 5e475f046b4815f6b8bdb01eb96550d2608113c7 /cmds/pm | |
parent | e44125cd3a5fc25306285bdfcacc00459e01307b (diff) |
Offer to wait until broadcasts have drained.
We've seen evidence of lab devices racing with other apps that are
using cache space immediately after tests wipe it clean, which can
cause test failures. To mitigate this, try our best to wait for the
device to go "idle" by watching for broadcast queues to fully drain.
Also improve javadocs along the way.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 37486230, 37566983, 37913442, 37914374
Change-Id: I4d430db443b6fa6d33a625fe07b90279b5d51c12
Diffstat (limited to 'cmds/pm')
-rw-r--r-- | cmds/pm/src/com/android/commands/pm/Pm.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java index deb5b3114e8f..588a1bf5f0cc 100644 --- a/cmds/pm/src/com/android/commands/pm/Pm.java +++ b/cmds/pm/src/com/android/commands/pm/Pm.java @@ -1441,10 +1441,10 @@ public final class Pm { System.err.println("Error: no size specified"); return showUsage(); } - int len = size.length(); long multiplier = 1; - if (len > 1) { - char c = size.charAt(len-1); + int len = size.length(); + char c = size.charAt(len - 1); + if (c < '0' || c > '9') { if (c == 'K' || c == 'k') { multiplier = 1024L; } else if (c == 'M' || c == 'm') { |