#include "xwalk/runtime/browser/runtime.h"
#include "xwalk/runtime/browser/xwalk_runner.h"
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
#include "xwalk/application/browser/installer/tizen/package_installer.h"
#include "xwalk/application/browser/installer/tizen/service_package_installer.h"
#endif
}
}
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
bool InstallPackageOnTizen(xwalk::application::ApplicationService* service,
xwalk::application::ApplicationStorage* storage,
xwalk::application::ApplicationData* application,
}
return true;
}
-#endif // OS_TIZEN
+#endif // OS_TIZEN_MOBILE
bool CopyDirectoryContents(const base::FilePath& from,
const base::FilePath& to) {
return false;
}
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
if (!InstallPackageOnTizen(this, application_storage_,
application_data.get(),
runtime_context_->GetPath())) {
const base::FilePath tmp_dir(app_dir.value()
+ FILE_PATH_LITERAL(".tmp"));
- // FIXME: Need to terminate the application here if it's running, after
- // shared runtime process mode has been implemented.
+ if (Application* app = GetApplicationByID(app_id)) {
+ LOG(INFO) << "Try to terminate the running application before update.";
+ app->Terminate(Application::Immediate);
+ }
+
if (!base::Move(app_dir, tmp_dir) ||
!base::Move(unpacked_dir, app_dir))
return false;
return false;
}
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
if (!UninstallPackageOnTizen(this, application_storage_,
old_application.get(),
runtime_context_->GetPath())) {
LOG(ERROR) << "An Error occurred when updating the application.";
base::DeleteFile(app_dir, true);
base::Move(tmp_dir, app_dir);
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
InstallPackageOnTizen(this, application_storage_,
old_application.get(),
runtime_context_->GetPath());
#endif
return false;
}
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
if (!InstallPackageOnTizen(this, application_storage_,
new_application.get(),
runtime_context_->GetPath()))
return false;
}
-#if defined(OS_TIZEN)
+ if (Application* app = GetApplicationByID(id)) {
+ LOG(INFO) << "Try to terminate the running application before uninstall.";
+ app->Terminate(Application::Immediate);
+ }
+
+#if defined(OS_TIZEN_MOBILE)
if (!UninstallPackageOnTizen(this, application_storage_, application.get(),
runtime_context_->GetPath()))
result = false;