Merge "No using inside header files" am: 17e1a0919d am: 23aaf5a7a6

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1285212

Change-Id: I9299b2f0762c02dae28b4dad8a6ee67fd03ad1a1
diff --git a/KeyUtil.cpp b/KeyUtil.cpp
index 886054e..2f9c876 100644
--- a/KeyUtil.cpp
+++ b/KeyUtil.cpp
@@ -36,6 +36,9 @@
 namespace android {
 namespace vold {
 
+using android::fscrypt::EncryptionOptions;
+using android::fscrypt::EncryptionPolicy;
+
 const KeyGeneration neverGen() {
     return KeyGeneration{0, false, false};
 }
diff --git a/KeyUtil.h b/KeyUtil.h
index 73255a3..5940b8a 100644
--- a/KeyUtil.h
+++ b/KeyUtil.h
@@ -28,8 +28,6 @@
 namespace android {
 namespace vold {
 
-using namespace android::fscrypt;
-
 // Description of how to generate a key when needed.
 struct KeyGeneration {
     size_t keysize;
@@ -63,8 +61,8 @@
 //
 // Returns %true on success, %false on failure.  On success also sets *policy
 // to the EncryptionPolicy used to refer to this key.
-bool installKey(const std::string& mountpoint, const EncryptionOptions& options,
-                const KeyBuffer& key, EncryptionPolicy* policy);
+bool installKey(const std::string& mountpoint, const android::fscrypt::EncryptionOptions& options,
+                const KeyBuffer& key, android::fscrypt::EncryptionPolicy* policy);
 
 // Evict a file-based encryption key from the kernel.
 //
@@ -72,7 +70,7 @@
 //
 // If the kernel doesn't support the filesystem-level keyring, the caller is
 // responsible for dropping caches.
-bool evictKey(const std::string& mountpoint, const EncryptionPolicy& policy);
+bool evictKey(const std::string& mountpoint, const android::fscrypt::EncryptionPolicy& policy);
 
 // Retrieves the key from the named directory, or generates it if it doesn't
 // exist.
@@ -82,7 +80,8 @@
 
 // Re-installs a file-based encryption key of fscrypt-provisioning type from the
 // global session keyring back into fs keyring of the mountpoint.
-bool reloadKeyFromSessionKeyring(const std::string& mountpoint, const EncryptionPolicy& policy);
+bool reloadKeyFromSessionKeyring(const std::string& mountpoint,
+                                 const android::fscrypt::EncryptionPolicy& policy);
 
 }  // namespace vold
 }  // namespace android
diff --git a/MetadataCrypt.cpp b/MetadataCrypt.cpp
index ee3b45a..5fe7918 100644
--- a/MetadataCrypt.cpp
+++ b/MetadataCrypt.cpp
@@ -49,6 +49,7 @@
 
 using android::fs_mgr::FstabEntry;
 using android::fs_mgr::GetEntryForMountPoint;
+using android::fscrypt::GetFirstApiLevel;
 using android::vold::KeyBuffer;
 using namespace android::dm;