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 e7a26ae59f3d30f73f5ac11eb255d6502617d68a..2f0def7dae8839171ab50746e69fc37ade437282 100644 |
--- a/telemetry/telemetry/internal/platform/android_platform_backend.py |
+++ b/telemetry/telemetry/internal/platform/android_platform_backend.py |
@@ -39,6 +39,7 @@ from devil.android import device_utils |
from devil.android.perf import cache_control |
from devil.android.perf import perf_control |
from devil.android.perf import thermal_throttle |
+from devil.android.sdk import shared_prefs |
from devil.android.sdk import version_codes |
from devil.android.tools import video_recorder |
@@ -137,6 +138,24 @@ class AndroidPlatformBackend( |
self._system_ui = app_ui.AppUi(self.device, 'com.android.systemui') |
return self._system_ui |
+ def GetSharedPrefs(self, package, filename): |
+ """Creates a Devil SharedPrefs instance. |
+ |
+ See devil.android.sdk.shared_prefs for the documentation of the returned |
+ object. |
+ |
+ Args: |
+ package: A string containing the package of the app that the SharedPrefs |
+ instance will be for. |
+ filename: A string containing the specific settings file of the app that |
+ the SharedPrefs instance will be for. |
+ |
+ Returns: |
+ A reference to a SharedPrefs object for the given package and filename |
+ on whatever device the platform backend has a reference to. |
+ """ |
+ return shared_prefs.SharedPrefs(self._device, package, filename) |
+ |
def IsSvelte(self): |
description = self._device.GetProp('ro.build.description', cache=True) |
if description is not None: |