Remove using assert() in ExternalStorage 17/202517/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 20 Feb 2019 10:10:06 +0000 (19:10 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 29 Mar 2019 08:32:28 +0000 (08:32 +0000)
Just return error instead of assert.

Change-Id: I0804ec330aa8d7b0d2ea57440b49ff5bae650a79
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
(cherry picked from commit 39b0ac57f9072f9ad593fc4a8c428d306f847542)

src/common/external_storage.cc

index 5d0cb8d9d942b6eb13178e774fab6f65fbdacbca..8604c23e0c2d3787f0fd54cd7b353cdee202a3e1 100644 (file)
@@ -115,7 +115,7 @@ bool ExternalStorage::Finalize(bool success) {
                                                             uid_);
     break;
   default:
-    assert(false && "Not supported installation mode");
+    LOG(ERROR) << "Not supported installation mode";
   }
   return ret == APP2EXT_STATUS_SUCCESS;
 }
@@ -219,18 +219,10 @@ bool ExternalStorage::Initialize(
     ret = handle_->interface.client_usr_pre_migrate_legacy(pkgid_.c_str(),
                                                            uid_);
     break;
-  case RequestType::Reinstall:
-  case RequestType::Recovery:
-  case RequestType::RecoveryUpdate:
-  case RequestType::ManifestDirectInstall:
-  case RequestType::ManifestDirectUpdate:
-  case RequestType::MountInstall:
-  case RequestType::MountUpdate:
+  default:
     LOG(ERROR) << "Installation type is not supported by external installation";
     ret = -1;
     break;
-  default:
-    assert(false && "Invalid installation mode");
   }
 
   g_list_free_full(glist, &ClearApp2ExtDirDetail);