OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Install *_incremental.apk targets as well as their dependent files.""" | 7 """Install *_incremental.apk targets as well as their dependent files.""" |
8 | 8 |
9 import argparse | 9 import argparse |
10 import glob | 10 import glob |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 'disable_incremental_isolated_processes=true to do so.') | 118 'disable_incremental_isolated_processes=true to do so.') |
119 | 119 |
120 # Install .apk(s) if any of them have changed. | 120 # Install .apk(s) if any of them have changed. |
121 def do_install(): | 121 def do_install(): |
122 install_timer.Start() | 122 install_timer.Start() |
123 if args.splits: | 123 if args.splits: |
124 splits = [] | 124 splits = [] |
125 for split_glob in args.splits: | 125 for split_glob in args.splits: |
126 splits.extend((f for f in glob.glob(split_glob))) | 126 splits.extend((f for f in glob.glob(split_glob))) |
127 device.InstallSplitApk(args.apk_path, splits, reinstall=True, | 127 device.InstallSplitApk(args.apk_path, splits, reinstall=True, |
128 allow_cached_props=True) | 128 allow_cached_props=True, permissions=()) |
129 else: | 129 else: |
130 device.Install(args.apk_path, reinstall=True) | 130 device.Install(args.apk_path, reinstall=True, permissions=()) |
131 install_timer.Stop(log=False) | 131 install_timer.Stop(log=False) |
132 | 132 |
133 # Push .so and .dex files to the device (if they have changed). | 133 # Push .so and .dex files to the device (if they have changed). |
134 def do_push_files(): | 134 def do_push_files(): |
135 if args.lib_dir: | 135 if args.lib_dir: |
136 push_native_timer.Start() | 136 push_native_timer.Start() |
137 device_lib_dir = posixpath.join(device_incremental_dir, 'lib') | 137 device_lib_dir = posixpath.join(device_incremental_dir, 'lib') |
138 device.PushChangedFiles([(args.lib_dir, device_lib_dir)], | 138 device.PushChangedFiles([(args.lib_dir, device_lib_dir)], |
139 delete_device_stale=True) | 139 delete_device_stale=True) |
140 push_native_timer.Stop(log=False) | 140 push_native_timer.Stop(log=False) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 reraiser_thread.RunAsync((do_install, do_push_files)) | 180 reraiser_thread.RunAsync((do_install, do_push_files)) |
181 release_installer_lock() | 181 release_installer_lock() |
182 logging.info('Took %s seconds (install=%s, libs=%s, dex=%s)', | 182 logging.info('Took %s seconds (install=%s, libs=%s, dex=%s)', |
183 main_timer.GetDelta(), install_timer.GetDelta(), | 183 main_timer.GetDelta(), install_timer.GetDelta(), |
184 push_native_timer.GetDelta(), push_dex_timer.GetDelta()) | 184 push_native_timer.GetDelta(), push_dex_timer.GetDelta()) |
185 | 185 |
186 | 186 |
187 if __name__ == '__main__': | 187 if __name__ == '__main__': |
188 sys.exit(main()) | 188 sys.exit(main()) |
189 | 189 |
OLD | NEW |