diff options
author | Chester Hsieh <dunno@google.com> | 2015-08-11 22:36:14 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-08-11 22:36:14 +0000 |
commit | 2a00708e9960e37122710832f9c3b2f9691e8a1f (patch) | |
tree | e3915e8e42389622fb481f3482726a546950caea | |
parent | 5ffcd4ecf8f8bfbfae91e1462159f4e96d521966 (diff) | |
parent | f802836b926ea511530214c4675b3585a34cd55e (diff) | |
download | testing-studio-1.4-dev.tar.gz |
Merge "Followup for API change." into studio-1.4-devstudio-1.4-dev
-rw-r--r-- | src/com/google/gct/testing/GhostCloudDevice.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/google/gct/testing/GhostCloudDevice.java b/src/com/google/gct/testing/GhostCloudDevice.java index 7425ebf..3f9519a 100644 --- a/src/com/google/gct/testing/GhostCloudDevice.java +++ b/src/com/google/gct/testing/GhostCloudDevice.java @@ -316,6 +316,21 @@ public class GhostCloudDevice implements IDevice { } @Override + public int getApiLevel() { + String apiString = device.getAndroidDevice().getAndroidVersionId(); + if (apiString == null) { + throw new IllegalStateException("Unexpected error: Device does not have a build API level."); + } + + try { + return Integer.parseInt(apiString); + } + catch (NumberFormatException e) { + throw new IllegalStateException("Unexpected error: Build API level '" + apiString + "' is not an integer: "); + } + } + + @Override public String getName() { return "Cloud device: " + device.getId(); } |