Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Unified Diff: telemetry/telemetry/internal/platform/android_platform_backend.py

Issue 2995713002: Add GetSharedPrefs to Android platform (Closed)
Patch Set: Address nit Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « telemetry/telemetry/core/android_platform.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « telemetry/telemetry/core/android_platform.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698