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

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

Issue 338353004: [Android] Switch KillAll, StartActivity, and BroadcastIntent to DeviceUtils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: appeasing windows Created 6 years, 6 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/device/intent.py ('k') | build/android/pylib/forwarder.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 import pylib.android_commands 7 import pylib.android_commands
8 import pylib.device.device_utils 8 import pylib.device.device_utils
9 9
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 self._cmdline_file, cmd_line) 107 self._cmdline_file, cmd_line)
108 file_contents = self._device.old_interface.GetProtectedFileContents( 108 file_contents = self._device.old_interface.GetProtectedFileContents(
109 self._cmdline_file) 109 self._cmdline_file)
110 else: 110 else:
111 self._device.old_interface.SetFileContents(self._cmdline_file, cmd_line) 111 self._device.old_interface.SetFileContents(self._cmdline_file, cmd_line)
112 file_contents = self._device.old_interface.GetFileContents( 112 file_contents = self._device.old_interface.GetFileContents(
113 self._cmdline_file) 113 self._cmdline_file)
114 assert len(file_contents) == 1 and file_contents[0] == cmd_line, ( 114 assert len(file_contents) == 1 and file_contents[0] == cmd_line, (
115 'Failed to set the command line file at %s' % self._cmdline_file) 115 'Failed to set the command line file at %s' % self._cmdline_file)
116 else: 116 else:
117 self._device.RunShellCommand('rm ' + self._cmdline_file, root=use_root) 117 self._device.RunShellCommand('rm ' + self._cmdline_file,
118 as_root=use_root)
118 assert ( 119 assert (
119 not self._device.old_interface.FileExistsOnDevice( 120 not self._device.old_interface.FileExistsOnDevice(
120 self._cmdline_file)), ( 121 self._cmdline_file)), (
121 'Failed to remove the command line file at %s' % self._cmdline_file) 122 'Failed to remove the command line file at %s' % self._cmdline_file)
122 123
123 @staticmethod 124 @staticmethod
124 def _TokenizeFlags(line): 125 def _TokenizeFlags(line):
125 """Changes the string containing the command line into a list of flags. 126 """Changes the string containing the command line into a list of flags.
126 127
127 Follows similar logic to CommandLine.java::tokenizeQuotedArguments: 128 Follows similar logic to CommandLine.java::tokenizeQuotedArguments:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 162
162 # Tack on the last flag. 163 # Tack on the last flag.
163 if not current_flag: 164 if not current_flag:
164 if within_quotations: 165 if within_quotations:
165 logging.warn('Unterminated quoted argument: ' + line) 166 logging.warn('Unterminated quoted argument: ' + line)
166 else: 167 else:
167 tokenized_flags.append(current_flag) 168 tokenized_flags.append(current_flag)
168 169
169 # Return everything but the program name. 170 # Return everything but the program name.
170 return tokenized_flags[1:] 171 return tokenized_flags[1:]
OLDNEW
« no previous file with comments | « build/android/pylib/device/intent.py ('k') | build/android/pylib/forwarder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698