From 88a2a965e6f0bd11e30afb0cc52820611c88f82d Mon Sep 17 00:00:00 2001 From: Android Tools Maintainers Date: Tue, 22 Mar 2022 22:50:07 +0000 Subject: [PATCH] Defer packaging fastdeploy with adb for 29.x.x tags. Forwarded: not-needed Gbp-Pq: Topic system/core Gbp-Pq: Name stub-out-fastdeploy.patch --- system/core/adb/client/adb_install.cpp | 31 +++----------------------- system/core/adb/client/commandline.cpp | 1 - 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/system/core/adb/client/adb_install.cpp b/system/core/adb/client/adb_install.cpp index 2bcd0a68..5a933916 100644 --- a/system/core/adb/client/adb_install.cpp +++ b/system/core/adb/client/adb_install.cpp @@ -35,7 +35,6 @@ #include "adb_utils.h" #include "client/file_sync_client.h" #include "commandline.h" -#include "fastdeploy.h" static constexpr int kFastDeployMinApi = 24; @@ -167,14 +166,6 @@ static int install_app_streamed(int argc, const char** argv, bool use_fastdeploy } if (use_fastdeploy) { - auto metadata = extract_metadata(file); - if (metadata.has_value()) { - // pass all but 1st (command) and last (apk path) parameters through to pm for - // session creation - std::vector pm_args{argv + 1, argv + argc - 1}; - auto patchFd = install_patch(pm_args.size(), pm_args.data()); - return stream_patch(file, std::move(metadata.value()), std::move(patchFd)); - } } struct stat sb; @@ -267,16 +258,6 @@ static int install_app_legacy(int argc, const char** argv, bool use_fastdeploy) argv[last_apk] = apk_dest.c_str(); /* destination name, not source location */ if (use_fastdeploy) { - auto metadata = extract_metadata(apk_file[0]); - if (metadata.has_value()) { - auto patchFd = apply_patch_on_device(apk_dest.c_str()); - int status = stream_patch(apk_file[0], std::move(metadata.value()), std::move(patchFd)); - - result = pm_command(argc, argv); - delete_device_file(apk_dest); - - return status; - } } if (do_sync_push(apk_file, apk_dest.c_str(), false)) { @@ -292,7 +273,6 @@ int install_app(int argc, const char** argv) { InstallMode installMode = INSTALL_DEFAULT; bool use_fastdeploy = false; bool is_reinstall = false; - FastDeploy_AgentUpdateStrategy agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion; for (int i = 1; i < argc; i++) { if (!strcmp(argv[i], "--streaming")) { @@ -313,13 +293,10 @@ int install_app(int argc, const char** argv) { use_fastdeploy = false; } else if (!strcmp(argv[i], "--force-agent")) { processedArgIndicies.push_back(i); - agent_update_strategy = FastDeploy_AgentUpdateAlways; } else if (!strcmp(argv[i], "--date-check-agent")) { processedArgIndicies.push_back(i); - agent_update_strategy = FastDeploy_AgentUpdateNewerTimeStamp; } else if (!strcmp(argv[i], "--version-check-agent")) { processedArgIndicies.push_back(i); - agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion; } } @@ -331,13 +308,11 @@ int install_app(int argc, const char** argv) { error_exit("Attempting to use streaming install on unsupported device"); } - if (use_fastdeploy && get_device_api_level() < kFastDeployMinApi) { - printf("Fast Deploy is only compatible with devices of API version %d or higher, " - "ignoring.\n", - kFastDeployMinApi); + if (use_fastdeploy) { + printf("Fast Deploy is unavailable in this build of adb, " + "ignoring.\n"); use_fastdeploy = false; } - fastdeploy_set_agent_update_strategy(agent_update_strategy); std::vector passthrough_argv; for (int i = 0; i < argc; i++) { diff --git a/system/core/adb/client/commandline.cpp b/system/core/adb/client/commandline.cpp index c3029652..ad7a344d 100644 --- a/system/core/adb/client/commandline.cpp +++ b/system/core/adb/client/commandline.cpp @@ -59,7 +59,6 @@ #include "bugreport.h" #include "client/file_sync_client.h" #include "commandline.h" -#include "fastdeploy.h" #include "services.h" #include "shell_protocol.h" #include "sysdeps/chrono.h" -- 2.30.2