Commit f53799fb authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Fix --incremental install for apk_operations.py

It was forgetting to pass in dex_files.
Also adds in explicit calls to pFinish(), which according to the docs
should be necessary (although they don't seem to be).

BUG=674250

Change-Id: Iefab37b1ef77413f54d2b6e036700cdbb8bf361d
Reviewed-on: https://chromium-review.googlesource.com/575329Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487301}
parent 0d9d3758
......@@ -38,13 +38,13 @@ def _InstallApk(install_incremental, inc_install_script, devices_obj,
from incremental_install import installer
installer.Install(device, helper, split_globs=params['splits'],
native_libs=params['native_libs'],
permissions=None)
dex_files=params['dex_files'], permissions=None)
devices_obj.pMap(install_incremental_apk)
return
# Install the regular apk on devices.
def install(device):
device.Install(apk_to_install)
devices_obj.pMap(install)
else:
# Install the regular apk on devices.
def install(device):
device.Install(apk_to_install)
devices_obj.pMap(install)
def _UninstallApk(install_incremental, devices_obj, apk_package):
......@@ -316,6 +316,7 @@ def main():
elif command == 'run':
_InstallApk(install_incremental, inc_install_script, devices_obj,
active_apk)
devices_obj.pFinish(None)
_LaunchUrl(devices_obj, args.args, gn_args.command_line_flags_file,
args.url, apk_package)
elif command == 'stop':
......@@ -342,6 +343,8 @@ def main():
args = [adb_path, 'logcat']
os.execv(adb_path, args)
# Wait for all threads to finish.
devices_obj.pFinish(None)
# Save back to the cache.
if use_cache:
......
......@@ -128,8 +128,8 @@ def Install(device, apk, split_globs=None, native_libs=None, dex_files=None,
# Push .so and .dex files to the device (if they have changed).
def do_push_files():
push_native_timer.Start()
if native_libs:
push_native_timer.Start()
with build_utils.TempDir() as temp_dir:
device_lib_dir = posixpath.join(device_incremental_dir, 'lib')
for path in native_libs:
......@@ -138,10 +138,10 @@ def Install(device, apk, split_globs=None, native_libs=None, dex_files=None,
shutil.copy(path, os.path.join(temp_dir, os.path.basename(path)))
device.PushChangedFiles([(temp_dir, device_lib_dir)],
delete_device_stale=True)
push_native_timer.Stop(log=False)
push_native_timer.Stop(log=False)
push_dex_timer.Start()
if dex_files:
push_dex_timer.Start()
# Put all .dex files to be pushed into a temporary directory so that we
# can use delete_device_stale=True.
with build_utils.TempDir() as temp_dir:
......@@ -155,7 +155,7 @@ def Install(device, apk, split_globs=None, native_libs=None, dex_files=None,
shutil.copy(src_path, os.path.join(temp_dir, dest_name))
device.PushChangedFiles([(temp_dir, device_dex_dir)],
delete_device_stale=True)
push_dex_timer.Stop(log=False)
push_dex_timer.Stop(log=False)
def check_selinux():
# Marshmallow has no filesystem access whatsoever. It might be possible to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment