From d3396f27258eddd1a383491432976dc699f7df62 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 31 May 2017 15:56:50 +0100 Subject: [PATCH] Target: Added get_sdk_version method Added the method to retrieve a devices sdk version taken from WA2. --- devlib/target.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devlib/target.py b/devlib/target.py index 8798ad4..f3aaea0 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -1037,6 +1037,12 @@ class AndroidTarget(Target): return line.split('=', 1)[1] return None + def get_sdk_version(self): + try: + return int(self.getprop('ro.build.version.sdk')) + except (ValueError, TypeError): + return None + def install_apk(self, filepath, timeout=None, replace=False, allow_downgrade=False): # pylint: disable=W0221 ext = os.path.splitext(filepath)[1].lower() if ext == '.apk':