bool DBHandleProvider::is_memory_ = false;
DBHandleProvider::DBHandleProvider(uid_t uid) : uid_(uid),
+ global_parser_memory_db_handle_(nullptr, sqlite3_close_v2),
parser_memory_db_handle_(nullptr, sqlite3_close_v2),
cert_memory_db_handle_(nullptr, sqlite3_close_v2) {
char *tmp_path = getUserPkgParserDBPathUID(GetGlobalUID());
parser_memory_db_path_);
if (parser_db != nullptr)
parser_memory_db_handle_.reset(parser_db);
+ sqlite3* global_parser_file_db = GetMemoryDBHandle(global_parser_file_db_path_,
+ global_parser_memory_db_path_);
+ if (global_parser_file_db)
+ global_parser_memory_db_handle_.reset(global_parser_file_db);
sqlite3* cert_db = GetMemoryDBHandle(cert_file_db_path_,
cert_memory_db_path_);
if (cert_db != nullptr)
} else {
parser_memory_db_handle_.reset(nullptr);
cert_memory_db_handle_.reset(nullptr);
+ global_parser_memory_db_handle_.reset(nullptr);
}
LOGD("Set Memory mode : %s", flag ? "Memory" : "File");
private:
static std::unordered_map<uid_t, std::unique_ptr<DBHandleProvider>> provider_;
uid_t uid_;
+ std::unique_ptr<sqlite3, decltype(sqlite3_close_v2)*> global_parser_memory_db_handle_;
std::unique_ptr<sqlite3, decltype(sqlite3_close_v2)*> parser_memory_db_handle_;
std::unique_ptr<sqlite3, decltype(sqlite3_close_v2)*> cert_memory_db_handle_;
std::string parser_memory_db_path_;