Revert "Skip global user check" 34/322334/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 7 Apr 2025 22:07:40 +0000 (07:07 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 7 Apr 2025 22:07:43 +0000 (07:07 +0900)
This reverts commit 10ad086285d12991d137f429cbec76865f428265.

Change-Id: I206bc3958f1c031481bd79c519986b602e75a8aa

src/lib/app_info/app_info_manager.cc

index 2bbd58d7f6ce0c16ab8faaf63d77c3fe75a13d4b..e573546913e965b5c6a3d6d56c75eff0e1a314b9 100644 (file)
@@ -667,8 +667,6 @@ void AppInfoManager::OnPkgmgrEvent(std::shared_ptr<PkgmgrEventArgs> args) {
 
 void AppInfoManager::DisableAppInfo(uid_t target_uid,
     const std::string& appid, const std::string& global) {
-  _D("taget_uid(%u), appid(%s), global(%s)", target_uid, appid.c_str(),
-     global.c_str());
   if (target_uid < REGULAR_UID_MIN) {
     for (auto const& iter : app_info_chunk_) {
       uid_t uid = iter.first;
@@ -686,6 +684,9 @@ void AppInfoManager::DisableAppInfo(uid_t target_uid,
   if (info == nullptr)
     return;
 
+  if (info->GetGlobal() != global)
+    return;
+
   info->SetEnablement("0");
   _E("[PKGMGR] Terminate app(%s). uid(%u)", appid.c_str(), target_uid);
   AppStatusManager::GetInst().TerminateApps(appid, target_uid);
@@ -694,8 +695,6 @@ void AppInfoManager::DisableAppInfo(uid_t target_uid,
 
 void AppInfoManager::EnableAppInfo(uid_t target_uid,
     const std::string& appid, const std::string& global) {
-  _D("taget_uid(%u), appid(%s), global(%s)", target_uid, appid.c_str(),
-     global.c_str());
   if (target_uid < REGULAR_UID_MIN) {
     for (auto const& iter : app_info_chunk_) {
       uid_t uid = iter.first;
@@ -728,14 +727,15 @@ void AppInfoManager::EnableAppInfo(uid_t target_uid,
     return;
   }
 
+  if (info->GetGlobal() != global)
+    return;
+
   info->SetEnablement("1");
   helper::NotiSend(AMD_NOTI_MSG_APPINFO_APP_ENABLED_END, target_uid, appid);
 }
 
 void AppInfoManager::DisableAppInfoSplashScreenDisplay(uid_t target_uid,
     const std::string& appid, const std::string& global) {
-  _D("taget_uid(%u), appid(%s), global(%s)", target_uid, appid.c_str(),
-     global.c_str());
   if (target_uid < REGULAR_UID_MIN) {
     for (auto const& iter : app_info_chunk_) {
       uid_t uid = iter.first;
@@ -753,13 +753,14 @@ void AppInfoManager::DisableAppInfoSplashScreenDisplay(uid_t target_uid,
   if (info == nullptr)
     return;
 
+  if (info->GetGlobal() != global)
+    return;
+
   info->SetSplashScreenDisplay("0");
 }
 
 void AppInfoManager::EnableAppInfoSplashScreenDisplay(uid_t target_uid,
     const std::string& appid, const std::string& global) {
-  _D("taget_uid(%u), appid(%s), global(%s)", target_uid, appid.c_str(),
-     global.c_str());
   if (target_uid < REGULAR_UID_MIN) {
     for (auto const& iter : app_info_chunk_) {
       uid_t uid = iter.first;
@@ -777,6 +778,9 @@ void AppInfoManager::EnableAppInfoSplashScreenDisplay(uid_t target_uid,
   if (info == nullptr)
     return;
 
+  if (info->GetGlobal() != global)
+    return;
+
   info->SetSplashScreenDisplay("1");
 }