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

Unified Diff: build/android/pylib/device_settings.py

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
Index: build/android/pylib/device_settings.py
diff --git a/build/android/pylib/device_settings.py b/build/android/pylib/device_settings.py
index 246c1d13e169ecb64a8c9e5d3c8c177c0ccaf593..73ffa72966da777e22d15ed495221269ec576aeb 100644
--- a/build/android/pylib/device_settings.py
+++ b/build/android/pylib/device_settings.py
@@ -6,6 +6,7 @@ import logging
from pylib import constants
from pylib import content_settings
+from pylib.device import device_errors
_LOCK_SCREEN_SETTINGS_PATH = '/data/system/locksettings.db'
_ALTERNATE_LOCK_SCREEN_SETTINGS_PATH = (
@@ -29,17 +30,16 @@ def ConfigureContentSettings(device, desired_settings):
settings to configure.
"""
try:
- sdk_version = int(device.GetProp('ro.build.version.sdk'))
- except ValueError:
- logging.error('Skipping content settings configuration, unknown sdk %s',
- device.GetProp('ro.build.version.sdk'))
+ sdk_version = device.build_version_sdk
+ except device_errors.CommandFailedError as exc:
+ logging.error('Skipping content settings configuration: %s', str(exc))
return
if sdk_version < constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN:
logging.error('Skipping content settings configuration due to outdated sdk')
return
- if device.GetProp('ro.build.type') == 'userdebug':
+ if device.build_type == 'userdebug':
for table, key_value in desired_settings:
settings = content_settings.ContentSettings(table, device)
for key, value in key_value:
@@ -68,7 +68,7 @@ def SetLockScreenSettings(device):
Raises:
Exception if the setting was not properly set.
"""
- if device.GetProp('ro.build.type') != 'userdebug':
+ if device.build_type != 'userdebug':
logging.warning('Unable to disable lockscreen on user builds.')
return
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/pylib/gtest/filter/unit_tests_disabled » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698