Rename CacheLocation to Paths.

We have a general need for overriding more paths (e.g. "/tmp"), mostly
for testing purpose. Rename CacheLocation to Paths, and use that to
manage TEMPORARY_{INSTALL,LOG}_FILE.

Test: mmma -j bootable/recovery
Test: recovery_component_test
Change-Id: Ia8ce8e5695df37ca434f13ac4d3206de1e8e9396
diff --git a/tests/component/applypatch_test.cpp b/tests/component/applypatch_test.cpp
index 292d76e..158ea63 100644
--- a/tests/component/applypatch_test.cpp
+++ b/tests/component/applypatch_test.cpp
@@ -16,7 +16,6 @@
 
 #include <dirent.h>
 #include <fcntl.h>
-#include <gtest/gtest.h>
 #include <libgen.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -36,12 +35,13 @@
 #include <android-base/test_utils.h>
 #include <android-base/unique_fd.h>
 #include <bsdiff/bsdiff.h>
+#include <gtest/gtest.h>
 #include <openssl/sha.h>
 
 #include "applypatch/applypatch.h"
 #include "applypatch/applypatch_modes.h"
 #include "common/test_constants.h"
-#include "otautil/cache_location.h"
+#include "otautil/paths.h"
 #include "otautil/print_sha1.h"
 
 using namespace std::string_literals;
@@ -110,14 +110,14 @@
  protected:
   void SetUp() override {
     ApplyPatchTest::SetUp();
-    CacheLocation::location().set_cache_temp_source(old_file);
+    Paths::Get().set_cache_temp_source(old_file);
   }
 };
 
 class ApplyPatchModesTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    CacheLocation::location().set_cache_temp_source(cache_source.path);
+    Paths::Get().set_cache_temp_source(cache_source.path);
     android::base::InitLogging(nullptr, &test_logger);
     android::base::SetMinimumLogSeverity(android::base::LogSeverity::DEBUG);
   }
@@ -157,7 +157,7 @@
   }
 
   void SetUp() override {
-    CacheLocation::location().set_cache_log_directory(mock_log_dir.path);
+    Paths::Get().set_cache_log_directory(mock_log_dir.path);
   }
 
   // A mock method to calculate the free space. It assumes the partition has a total size of 40960
diff --git a/tests/component/updater_test.cpp b/tests/component/updater_test.cpp
index 5bfd7cb..5d3b2d9 100644
--- a/tests/component/updater_test.cpp
+++ b/tests/component/updater_test.cpp
@@ -41,8 +41,8 @@
 #include "common/test_constants.h"
 #include "edify/expr.h"
 #include "otautil/SysUtil.h"
-#include "otautil/cache_location.h"
 #include "otautil/error_code.h"
+#include "otautil/paths.h"
 #include "otautil/print_sha1.h"
 #include "updater/blockimg.h"
 #include "updater/install.h"
@@ -106,10 +106,9 @@
     RegisterInstallFunctions();
     RegisterBlockImageFunctions();
 
-    // Mock the location of last_command_file.
-    CacheLocation::location().set_cache_temp_source(temp_saved_source_.path);
-    CacheLocation::location().set_last_command_file(temp_last_command_.path);
-    CacheLocation::location().set_stash_directory_base(temp_stash_base_.path);
+    Paths::Get().set_cache_temp_source(temp_saved_source_.path);
+    Paths::Get().set_last_command_file(temp_last_command_.path);
+    Paths::Get().set_stash_directory_base(temp_stash_base_.path);
   }
 
   TemporaryFile temp_saved_source_;
@@ -719,7 +718,7 @@
 }
 
 TEST_F(UpdaterTest, last_command_update) {
-  std::string last_command_file = CacheLocation::location().last_command_file();
+  std::string last_command_file = Paths::Get().last_command_file();
 
   std::string block1 = std::string(4096, '1');
   std::string block2 = std::string(4096, '2');
@@ -806,7 +805,7 @@
 }
 
 TEST_F(UpdaterTest, last_command_update_unresumable) {
-  std::string last_command_file = CacheLocation::location().last_command_file();
+  std::string last_command_file = Paths::Get().last_command_file();
 
   std::string block1 = std::string(4096, '1');
   std::string block2 = std::string(4096, '2');
@@ -861,7 +860,7 @@
 }
 
 TEST_F(UpdaterTest, last_command_verify) {
-  std::string last_command_file = CacheLocation::location().last_command_file();
+  std::string last_command_file = Paths::Get().last_command_file();
 
   std::string block1 = std::string(4096, '1');
   std::string block2 = std::string(4096, '2');