Remove unnecessary condition check 47/239947/3
authorChanggyu Choi <changyu.choi@samsung.com>
Fri, 31 Jul 2020 01:50:11 +0000 (10:50 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Fri, 31 Jul 2020 02:12:14 +0000 (11:12 +0900)
Change-Id: I195b3b138914fce82a4b4836bb71b97f2e85f083
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/app_manager.c

index cd0cd25..a02d747 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 2020 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  */
 
 
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 
 #include <aul.h>
 #include <aul_window.h>
-#include <dlog.h>
 #include <cynara-client.h>
+#include <dlog.h>
 #include <package-manager.h>
 
 #include "app_manager.h"
@@ -145,9 +145,6 @@ API int app_manager_resume_app(app_context_h app_context)
        char *instance_id = NULL;
        int retval = APP_MANAGER_ERROR_NONE;
 
-       if (app_context == NULL)
-               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
        if (app_context_get_app_id(app_context, &app_id) != APP_MANAGER_ERROR_NONE)
                return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to get the application ID");
 
@@ -227,9 +224,6 @@ API int app_manager_terminate_app(app_context_h app_context)
        int retval;
        pid_t pid = 0;
 
-       if (app_context == NULL)
-               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
        if (app_context_get_pid(app_context, &pid) != APP_MANAGER_ERROR_NONE)
                return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to get the process ID");
 
@@ -252,9 +246,6 @@ API int app_manager_request_terminate_bg_app(app_context_h app_context)
        int retval = APP_MANAGER_ERROR_NONE;
        pid_t pid = 0;
 
-       if (app_context == NULL)
-               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
        if (app_context_get_pid(app_context, &pid) != APP_MANAGER_ERROR_NONE)
                return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to get the process ID");
 
@@ -663,9 +654,6 @@ API int app_manager_attach_window(const char *parent_app_id, const char *child_a
 {
        int ret;
 
-       if (parent_app_id == NULL || child_app_id == NULL)
-               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
        ret = aul_window_attach(parent_app_id, child_app_id);
        if (ret != AUL_R_OK)
                return app_manager_error(__aul_error_convert(ret), __FUNCTION__, NULL);
@@ -677,9 +665,6 @@ API int app_manager_detach_window(const char *app_id)
 {
        int ret;
 
-       if (app_id == NULL)
-               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
        ret = aul_window_detach(app_id);
        if (ret != AUL_R_OK)
                return app_manager_error(__aul_error_convert(ret), __FUNCTION__, NULL);