From b85378ddd60e07fbc07095e7dc000628c5484762 Mon Sep 17 00:00:00 2001 From: deepti Date: Fri, 9 Mar 2018 15:52:27 +0530 Subject: [PATCH] Saving App Control Data Change-Id: Icd2555eb5451de82bb5223f8ac7d493f53defbe0 Signed-off-by: deepti --- atom/app/ui_runtime.cc | 11 +++++++++-- tizen/common/common.gyp | 2 ++ tizen/common/constants.cc | 25 +++++++++++++++++++++++++ tizen/common/constants.h | 24 ++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 tizen/common/constants.cc create mode 100644 tizen/common/constants.h diff --git a/atom/app/ui_runtime.cc b/atom/app/ui_runtime.cc index 97ef0a9..c85a63f 100644 --- a/atom/app/ui_runtime.cc +++ b/atom/app/ui_runtime.cc @@ -25,6 +25,9 @@ #include "atom/common/atom_command_line.h" #include "base/logging.h" #include "content/public/app/content_main.h" +#include "tizen/common/app_db.h" +#include "tizen/common/app_control.h" +#include "tizen/common/constants.h" namespace runtime { @@ -59,6 +62,11 @@ void UiRuntime::OnResume() { void UiRuntime::OnAppControl(app_control_h app_control) { LOG(ERROR) << "OnAppControl()"; + std::unique_ptr + appcontrol(new common::AppControl(app_control)); + common::AppDB* appdb = common::AppDB::GetInstance(); + appdb->Set(kAppDBRuntimeSection, kAppDBRuntimeBundle, + appcontrol->encoded_bundle()); } void UiRuntime::OnLanguageChanged(const std::string& language) { @@ -111,5 +119,4 @@ int UiRuntime::Exec() { return ui_app_main(_params->argc, const_cast(_params->argv), &ops, this); } - -} //namespace \ No newline at end of file +} //namespace diff --git a/tizen/common/common.gyp b/tizen/common/common.gyp index 7d56a2e..dfc2494 100644 --- a/tizen/common/common.gyp +++ b/tizen/common/common.gyp @@ -9,6 +9,8 @@ 'sources': [ 'command_line.h', 'command_line.cc', + 'constants.h', + 'constants.cc', 'file_utils.h', 'file_utils.cc', 'string_utils.h', diff --git a/tizen/common/constants.cc b/tizen/common/constants.cc new file mode 100644 index 0000000..59f9b7a --- /dev/null +++ b/tizen/common/constants.cc @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#include "tizen/common/constants.h" +#include "constants.h" + +namespace runtime { + +const char kAppDBRuntimeSection[] = "Runtime"; +const char kAppDBRuntimeBundle[] = "encoded_bundle"; + +} // namespace runtime diff --git a/tizen/common/constants.h b/tizen/common/constants.h new file mode 100644 index 0000000..bada698 --- /dev/null +++ b/tizen/common/constants.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +namespace runtime { + +extern const char kAppDBRuntimeSection[]; +extern const char kAppDBRuntimeBundle[]; + +} // namespace runtime + -- 2.7.4