Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame^] | 1 | Description: Defer packaging fastdeploy with adb for 29.x.x tags. |
| 2 | Forwarded: not-needed |
| 3 | --- a/system/core/adb/client/commandline.cpp |
| 4 | +++ b/system/core/adb/client/commandline.cpp |
| 5 | @@ -59,7 +59,6 @@ |
| 6 | #include "bugreport.h" |
| 7 | #include "client/file_sync_client.h" |
| 8 | #include "commandline.h" |
| 9 | -#include "fastdeploy.h" |
| 10 | #include "services.h" |
| 11 | #include "shell_protocol.h" |
| 12 | #include "sysdeps/chrono.h" |
| 13 | --- a/system/core/adb/client/adb_install.cpp |
| 14 | +++ b/system/core/adb/client/adb_install.cpp |
| 15 | @@ -35,7 +35,6 @@ |
| 16 | #include "adb_utils.h" |
| 17 | #include "client/file_sync_client.h" |
| 18 | #include "commandline.h" |
| 19 | -#include "fastdeploy.h" |
| 20 | |
| 21 | static constexpr int kFastDeployMinApi = 24; |
| 22 | |
| 23 | @@ -167,14 +166,6 @@ |
| 24 | } |
| 25 | |
| 26 | if (use_fastdeploy) { |
| 27 | - auto metadata = extract_metadata(file); |
| 28 | - if (metadata.has_value()) { |
| 29 | - // pass all but 1st (command) and last (apk path) parameters through to pm for |
| 30 | - // session creation |
| 31 | - std::vector<const char*> pm_args{argv + 1, argv + argc - 1}; |
| 32 | - auto patchFd = install_patch(pm_args.size(), pm_args.data()); |
| 33 | - return stream_patch(file, std::move(metadata.value()), std::move(patchFd)); |
| 34 | - } |
| 35 | } |
| 36 | |
| 37 | struct stat sb; |
| 38 | @@ -267,16 +258,6 @@ |
| 39 | argv[last_apk] = apk_dest.c_str(); /* destination name, not source location */ |
| 40 | |
| 41 | if (use_fastdeploy) { |
| 42 | - auto metadata = extract_metadata(apk_file[0]); |
| 43 | - if (metadata.has_value()) { |
| 44 | - auto patchFd = apply_patch_on_device(apk_dest.c_str()); |
| 45 | - int status = stream_patch(apk_file[0], std::move(metadata.value()), std::move(patchFd)); |
| 46 | - |
| 47 | - result = pm_command(argc, argv); |
| 48 | - delete_device_file(apk_dest); |
| 49 | - |
| 50 | - return status; |
| 51 | - } |
| 52 | } |
| 53 | |
| 54 | if (do_sync_push(apk_file, apk_dest.c_str(), false)) { |
| 55 | @@ -292,7 +273,6 @@ |
| 56 | InstallMode installMode = INSTALL_DEFAULT; |
| 57 | bool use_fastdeploy = false; |
| 58 | bool is_reinstall = false; |
| 59 | - FastDeploy_AgentUpdateStrategy agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion; |
| 60 | |
| 61 | for (int i = 1; i < argc; i++) { |
| 62 | if (!strcmp(argv[i], "--streaming")) { |
| 63 | @@ -313,13 +293,10 @@ |
| 64 | use_fastdeploy = false; |
| 65 | } else if (!strcmp(argv[i], "--force-agent")) { |
| 66 | processedArgIndicies.push_back(i); |
| 67 | - agent_update_strategy = FastDeploy_AgentUpdateAlways; |
| 68 | } else if (!strcmp(argv[i], "--date-check-agent")) { |
| 69 | processedArgIndicies.push_back(i); |
| 70 | - agent_update_strategy = FastDeploy_AgentUpdateNewerTimeStamp; |
| 71 | } else if (!strcmp(argv[i], "--version-check-agent")) { |
| 72 | processedArgIndicies.push_back(i); |
| 73 | - agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | @@ -331,13 +308,11 @@ |
| 78 | error_exit("Attempting to use streaming install on unsupported device"); |
| 79 | } |
| 80 | |
| 81 | - if (use_fastdeploy && get_device_api_level() < kFastDeployMinApi) { |
| 82 | - printf("Fast Deploy is only compatible with devices of API version %d or higher, " |
| 83 | - "ignoring.\n", |
| 84 | - kFastDeployMinApi); |
| 85 | + if (use_fastdeploy) { |
| 86 | + printf("Fast Deploy is unavailable in this build of adb, " |
| 87 | + "ignoring.\n"); |
| 88 | use_fastdeploy = false; |
| 89 | } |
| 90 | - fastdeploy_set_agent_update_strategy(agent_update_strategy); |
| 91 | |
| 92 | std::vector<const char*> passthrough_argv; |
| 93 | for (int i = 0; i < argc; i++) { |