Context context;
int GetPkgIdFromDB(int pid, char* buf, int len, uid_t uid) {
- auto appid = context.GetPreInitAppId();
+ const auto& appid = context.GetPreInitAppId();
if (appid.empty()) {
_E("Failed to get pre-initialized appid");
return -1;
if (getpid() == pid || getpgid(getpid()) == pid) {
context.Initialize();
- auto& preinit_appid = context.GetPreInitAppId();
+ const auto& preinit_appid = context.GetPreInitAppId();
if (!preinit_appid.empty()) {
snprintf(appid, len, "%s", preinit_appid.c_str());
return AUL_R_OK;
if (getpid() == pid || getpgid(getpid()) == pid) {
context.Initialize();
- auto& preinit_pkgid = context.GetPreInitPkgId();
+ const auto& preinit_pkgid = context.GetPreInitPkgId();
if (!preinit_pkgid.empty()) {
snprintf(pkgid, len, "%s", preinit_pkgid.c_str());
return AUL_R_OK;
if (getpid() == pid || getpgid(getpid()) == pid) {
context.Initialize();
- auto& preinit_appid = context.GetPreInitAppId();
+ const auto& preinit_appid = context.GetPreInitAppId();
if (!preinit_appid.empty()) {
callback(AUL_R_OK, pid, preinit_appid.c_str(), user_data);
return AUL_R_OK;