Fingerprint data is now stored in one of two ways depending on the
shipping API version:
For devices shipped before Android P nothing changes, data
is stored under /data/system/users/<user-id>/fpdata/...
Devices shipped from now on will instead store
fingerprint data under /data/vendor_de/<user-id>/fpdata.
Support for /data/vendor_de and /data/vendor_ce has been added to vold.
Bug: 36997597
Change-Id: I615e90d1c9ab08e768a8713968fa043598a0a526
Test: manually
diff --git a/vold_prepare_subdirs.cpp b/vold_prepare_subdirs.cpp
index 02bedde..1b466e9 100644
--- a/vold_prepare_subdirs.cpp
+++ b/vold_prepare_subdirs.cpp
@@ -38,6 +38,8 @@
#include "Utils.h"
#include "android/os/IVold.h"
+#include <private/android_filesystem_config.h>
+
static void usage(const char* progname) {
std::cerr << "Usage: " << progname << " [ prepare | destroy ] <volume_uuid> <user_id> <flags>"
<< std::endl;
@@ -125,6 +127,11 @@
auto misc_de_path = android::vold::BuildDataMiscDePath(user_id);
if (!prepare_dir(sehandle, 0700, 0, 0, misc_de_path + "/vold")) return false;
if (!prepare_dir(sehandle, 0700, 0, 0, misc_de_path + "/storaged")) return false;
+
+ auto vendor_de_path = android::vold::BuildDataVendorDePath(user_id);
+ if (!prepare_dir(sehandle, 0700, AID_SYSTEM, AID_SYSTEM, vendor_de_path + "/fpdata")) {
+ return false;
+ }
}
if (flags & android::os::IVold::STORAGE_FLAG_CE) {
auto misc_ce_path = android::vold::BuildDataMiscCePath(user_id);
@@ -141,10 +148,16 @@
if (flags & android::os::IVold::STORAGE_FLAG_CE) {
auto misc_ce_path = android::vold::BuildDataMiscCePath(user_id);
res &= rmrf_contents(misc_ce_path);
+
+ auto vendor_ce_path = android::vold::BuildDataVendorCePath(user_id);
+ res &= rmrf_contents(vendor_ce_path);
}
if (flags & android::os::IVold::STORAGE_FLAG_DE) {
auto misc_de_path = android::vold::BuildDataMiscDePath(user_id);
res &= rmrf_contents(misc_de_path);
+
+ auto vendor_de_path = android::vold::BuildDataVendorDePath(user_id);
+ res &= rmrf_contents(vendor_de_path);
}
}
return res;