| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from telemetry.core import android_action_runner | 5 from telemetry.core import android_action_runner |
| 6 from telemetry.core import platform | 6 from telemetry.core import platform |
| 7 from telemetry.internal.app import android_app | 7 from telemetry.internal.app import android_app |
| 8 from telemetry.internal.backends import android_app_backend | 8 from telemetry.internal.backends import android_app_backend |
| 9 | 9 |
| 10 | 10 |
| 11 class AndroidPlatform(platform.Platform): | 11 class AndroidPlatform(platform.Platform): |
| 12 | 12 |
| 13 def __init__(self, platform_backend): | 13 def __init__(self, platform_backend): |
| 14 super(AndroidPlatform, self).__init__(platform_backend) | 14 super(AndroidPlatform, self).__init__(platform_backend) |
| 15 self._android_action_runner = android_action_runner.AndroidActionRunner( | 15 self._android_action_runner = android_action_runner.AndroidActionRunner( |
| 16 platform_backend) | 16 platform_backend) |
| 17 | 17 |
| 18 def Initialize(self): |
| 19 self._platform_backend.EnsureBackgroundApkInstalled() |
| 20 |
| 18 @property | 21 @property |
| 19 def android_action_runner(self): | 22 def android_action_runner(self): |
| 20 return self._android_action_runner | 23 return self._android_action_runner |
| 21 | 24 |
| 22 @property | 25 @property |
| 23 def system_ui(self): | 26 def system_ui(self): |
| 24 """Returns an AppUi object to interact with Android's system UI. | 27 """Returns an AppUi object to interact with Android's system UI. |
| 25 | 28 |
| 26 See devil.android.app_ui for the documentation of the API provided. | 29 See devil.android.app_ui for the documentation of the API provided. |
| 27 """ | 30 """ |
| (...skipping 20 matching lines...) Expand all Loading... |
| 48 object may be used to access them. | 51 object may be used to access them. |
| 49 | 52 |
| 50 Returns: | 53 Returns: |
| 51 A reference to the android_app launched. | 54 A reference to the android_app launched. |
| 52 """ | 55 """ |
| 53 self._platform_backend.DismissCrashDialogIfNeeded() | 56 self._platform_backend.DismissCrashDialogIfNeeded() |
| 54 app_backend = android_app_backend.AndroidAppBackend( | 57 app_backend = android_app_backend.AndroidAppBackend( |
| 55 self._platform_backend, start_intent, is_app_ready_predicate, | 58 self._platform_backend, start_intent, is_app_ready_predicate, |
| 56 app_has_webviews) | 59 app_has_webviews) |
| 57 return android_app.AndroidApp(app_backend, self._platform_backend) | 60 return android_app.AndroidApp(app_backend, self._platform_backend) |
| OLD | NEW |