summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorHenry Daitx <daitx@google.com>2019-01-23 20:52:01 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-23 20:52:01 +0000
commit09158b1d5a2da7d71b7046734e1f96c98d8fc81f (patch)
treeff42e9e8efe8e85a65c78b276155a88e66fb7ace /adb
parenta5e0d695fa9ac8624681fb9effc51bbe6f75853e (diff)
parentf788f67c23648be208317ba6a4b902e09359925d (diff)
downloadsystem_core-09158b1d5a2da7d71b7046734e1f96c98d8fc81f.tar.gz
system_core-09158b1d5a2da7d71b7046734e1f96c98d8fc81f.tar.bz2
system_core-09158b1d5a2da7d71b7046734e1f96c98d8fc81f.zip
Merge "Fix fastdeploy failure in Windows"
Diffstat (limited to 'adb')
-rw-r--r--adb/client/adb_install.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/adb/client/adb_install.cpp b/adb/client/adb_install.cpp
index 21e08745a..d56a25fb8 100644
--- a/adb/client/adb_install.cpp
+++ b/adb/client/adb_install.cpp
@@ -35,7 +35,6 @@
#include "client/file_sync_client.h"
#include "commandline.h"
#include "fastdeploy.h"
-#include "sysdeps.h"
static constexpr int kFastDeployMinApi = 24;
@@ -161,17 +160,23 @@ static int install_app_streamed(int argc, const char** argv, bool use_fastdeploy
if (use_fastdeploy == true) {
TemporaryFile metadataTmpFile;
- TemporaryFile patchTmpFile;
+ std::string patchTmpFilePath;
+ {
+ TemporaryFile patchTmpFile;
+ patchTmpFile.DoNotRemove();
+ patchTmpFilePath = patchTmpFile.path;
+ }
FILE* metadataFile = fopen(metadataTmpFile.path, "wb");
extract_metadata(file, metadataFile);
fclose(metadataFile);
- create_patch(file, metadataTmpFile.path, patchTmpFile.path);
+ create_patch(file, metadataTmpFile.path, patchTmpFilePath.c_str());
// pass all but 1st (command) and last (apk path) parameters through to pm for
// session creation
std::vector<const char*> pm_args{argv + 1, argv + argc - 1};
- install_patch(file, patchTmpFile.path, pm_args.size(), pm_args.data());
+ install_patch(file, patchTmpFilePath.c_str(), pm_args.size(), pm_args.data());
+ adb_unlink(patchTmpFilePath.c_str());
delete_device_patch_file(file);
return 0;
} else {