Remove duplicated Update() calling 75/297275/1
authorChanggyu Choi <changyu.choi@samsung.com>
Wed, 16 Aug 2023 06:37:50 +0000 (15:37 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Wed, 16 Aug 2023 06:37:50 +0000 (15:37 +0900)
_terminate_app_local() is calling Update() method.
This patch removes them.

Change-Id: I08543992cca622c127ed50ab2e7ecce8b2484f37
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/lib/amd_launch.cc
src/lib/app_status/app_status_manager.cc

index 4cb26fd..6d4787a 100644 (file)
@@ -1513,10 +1513,8 @@ int _terminate_app_local(uid_t uid, int pid) {
 
   SendAppTerminateRequestSignal(app_status);
   int ret = amd::AppRequest::Terminate(pid, req.get());
-  if (ret == 0) {
-    amd::AppStatusManager::GetInst().Update(app_status, STATUS_DYING,
-        false, true);
-  }
+  amd::AppStatusManager::GetInst().Update(app_status, STATUS_DYING,
+      false, true);
 
   return ret;
 }
index 1c061cf..908e078 100644 (file)
@@ -381,8 +381,6 @@ int AppStatusManager::TerminateApps(const std::string& appid, uid_t uid) {
           app_status->GetPID());
       if (ret < 0)
         _E("Failed to terminate app_status(%d)", app_status->GetPID());
-
-      Update(app_status, STATUS_DYING, false, true);
     }
   }
 
@@ -400,7 +398,6 @@ int AppStatusManager::TerminateAppsByPkgId(const std::string& pkgid,
       if (ret < 0)
         _E("Failed to terminate app_status(%d)", app_status->GetPID());
 
-      Update(app_status, STATUS_DYING, false, true);
       DeleteSocketPath(app_status->GetPID(), app_status->GetUID());
     }
   }
@@ -432,7 +429,6 @@ int AppStatusManager::TerminateAppsByResPackageID(const std::string& pkgid,
       if (ret < 0)
         _E("Failed to terminate app_status(%d)", app_status->GetPID());
 
-      Update(app_status, STATUS_DYING, false, true);
       DeleteSocketPath(app_status->GetPID(), app_status->GetUID());
     }
   }
@@ -518,8 +514,6 @@ void AppStatusManager::CleanUp(AppStatusPtr app_status) {
           app_status->GetPID());
       if (ret < 0)
         _E("Failed to terminate app_status(%d)", app_status->GetPID());
-
-      Update(app_status, STATUS_DYING, false, true);
     }
   }
 
@@ -647,7 +641,6 @@ void AppStatusManager::CleanupBackgroundUiApps(int cleanup_cnt) {
         continue;
       }
 
-      Update(app_status, STATUS_DYING, false, true);
       done++;
     }
   }