From 01daebbe68943725e7b80e30082330c6bd042a88 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Thu, 8 Mar 2018 12:34:19 -0800 Subject: Set the update locations to default in CacheLocation's constructor Otherwise the applypatch executable will fail to back up the source file to /cache when patching the recovery image. Bug: 74198354 Test: run applypatch from boot to recovery (cherry picked from commit b4e3a370bf6fe2bbb6ad8e33d16ce3210595aaef) Change-Id: I37b7fd88d66ab49ef953d4b7dca22577bd1472e1 --- otautil/cache_location.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'otautil/cache_location.cpp') diff --git a/otautil/cache_location.cpp b/otautil/cache_location.cpp index 8f289487f..8ddefec5e 100644 --- a/otautil/cache_location.cpp +++ b/otautil/cache_location.cpp @@ -25,8 +25,7 @@ CacheLocation& CacheLocation::location() { return cache_location; } -void CacheLocation::ResetLocations() { - cache_temp_source_ = kDefaultCacheTempSource; - last_command_file_ = kDefaultLastCommandFile; - stash_directory_base_ = kDefaultStashDirectoryBase; -} +CacheLocation::CacheLocation() + : cache_temp_source_(kDefaultCacheTempSource), + last_command_file_(kDefaultLastCommandFile), + stash_directory_base_(kDefaultStashDirectoryBase) {} -- cgit v1.2.3