static int __on_login_monitor_login(const char* msg,
int arg1, int arg2, void* arg3, bundle* arg4) {
uid_state state = static_cast<uid_state>(arg2);
- if (state == UID_STATE_OPENING) {
+ if (state & (UID_STATE_OPENING | UID_STATE_ONLINE | UID_STATE_ACTIVE)) {
uid_t uid = static_cast<uid_t>(arg1);
AppSvcManager::GetInst().LoadAppSvc(uid);
}
}
void AppSvcManager::LoadAppSvc(uid_t uid) {
- if (!PrepareAppSvcChunk(uid))
- return;
-
- AppSvcDB db(uid);
- try {
- db.Open();
- if (!db.IntegrityCheck())
- return;
-
- for (auto& kv : db.Select())
- AddAppSvc(uid, kv.first, kv.second);
- } catch (Exception& e) {
- _E("Exception(%d) occurs", e.GetErrorCode());
- }
+ PrepareAppSvcChunk(uid);
}
std::string AppSvcManager::GetDefaultAppId(uid_t uid,
}
appsvc_chunk_[uid] = std::shared_ptr<AppSvcChunk>(chunk);
+ AppSvcDB db(uid);
+ try {
+ db.Open();
+ if (!db.IntegrityCheck())
+ return true;
+
+ for (auto& kv : db.Select())
+ appsvc_chunk_[uid]->Add(kv.first, kv.second);
+ } catch (Exception& e) {
+ _E("Exception(%d) occurs", e.GetErrorCode());
+ }
+
return true;
}