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

Side by Side Diff: build/android/pylib/device_settings.py

Issue 477153003: [Android] Make adb shell commands with single quotes run correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import logging 5 import logging
6 6
7 from pylib import content_settings 7 from pylib import content_settings
8 8
9 _LOCK_SCREEN_SETTINGS_PATH = '/data/system/locksettings.db' 9 _LOCK_SCREEN_SETTINGS_PATH = '/data/system/locksettings.db'
10 PASSWORD_QUALITY_UNSPECIFIED = '0' 10 PASSWORD_QUALITY_UNSPECIFIED = '0'
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 cmd = """begin transaction; 86 cmd = """begin transaction;
87 delete from '%(table)s' where %(primary_key)s='%(primary_value)s'; 87 delete from '%(table)s' where %(primary_key)s='%(primary_value)s';
88 insert into '%(table)s' (%(columns)s) values (%(values)s); 88 insert into '%(table)s' (%(columns)s) values (%(values)s);
89 commit transaction;""" % { 89 commit transaction;""" % {
90 'table': table, 90 'table': table,
91 'primary_key': columns[0], 91 'primary_key': columns[0],
92 'primary_value': values[0], 92 'primary_value': values[0],
93 'columns': ', '.join(columns), 93 'columns': ', '.join(columns),
94 'values': ', '.join(["'%s'" % value for value in values]) 94 'values': ', '.join(["'%s'" % value for value in values])
95 } 95 }
96 output_msg = device.RunShellCommand('\'sqlite3 %s "%s"\'' % (db, cmd)) 96 output_msg = device.RunShellCommand('sqlite3 %s "%s"' % (db, cmd))
97 if output_msg: 97 if output_msg:
98 print ' '.join(output_msg) 98 print ' '.join(output_msg)
99 99
100 100
101 ENABLE_LOCATION_SETTING = { 101 ENABLE_LOCATION_SETTING = {
102 'settings/secure': { 102 'settings/secure': {
103 # Ensure Geolocation is enabled and allowed for tests. 103 # Ensure Geolocation is enabled and allowed for tests.
104 'location_providers_allowed': 'gps,network', 104 'location_providers_allowed': 'gps,network',
105 } 105 }
106 } 106 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 }, 167 },
168 } 168 }
169 169
170 170
171 NETWORK_DISABLED_SETTINGS = { 171 NETWORK_DISABLED_SETTINGS = {
172 'settings/global': { 172 'settings/global': {
173 'airplane_mode_on': 1, 173 'airplane_mode_on': 1,
174 'wifi_on': 0, 174 'wifi_on': 0,
175 }, 175 },
176 } 176 }
OLDNEW
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698