Chromium Code Reviews| Index: telemetry/telemetry/internal/platform/android_platform_backend.py |
| diff --git a/telemetry/telemetry/internal/platform/android_platform_backend.py b/telemetry/telemetry/internal/platform/android_platform_backend.py |
| index 3b57f66779275d245392320e15b66ce60fb323f7..45313b3ac091f0631b3f08f8716df21af140cd4f 100644 |
| --- a/telemetry/telemetry/internal/platform/android_platform_backend.py |
| +++ b/telemetry/telemetry/internal/platform/android_platform_backend.py |
| @@ -238,6 +238,22 @@ class AndroidPlatformBackend( |
| android_prebuilt_profiler_helper.GetDevicePath('memtrack_helper'), |
| '-d'], as_root=True, check_return=True) |
| + def EnsureBackgroundApkInstalled(self): |
| + name = 'PushAppsToBackground.apk' |
| + directories = util.GetBuildDirectories() |
|
nednguyen
2016/10/10 18:42:31
Hmhh, don't rely on this method. Instead, use depe
|
| + if not directories: |
| + raise Exception("Error installing PushAppsToBackground.apk:" |
| + "No build directories found.") |
| + possible_paths = [os.path.join(d, 'apks', name) for d in directories] |
| + paths = [path for path in possible_paths if os.path.exists(path)] |
| + if not paths: |
| + raise Exception("Error installing PushAppsToBackground.apk: " |
| + "Couldn't find apk. Looked for it at: " |
| + "\n".join(possible_paths)) |
| + # Choose the first path |
| + path = paths[0] |
| + self.InstallApplication(path) |
| + |
| def PurgeUnpinnedMemory(self): |
| """Purges the unpinned ashmem memory for the whole system. |