2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file task_parental_mode.cpp
18 * @author Janusz Majnert (j.majnert@samsung.com)
20 * @brief Implementation for parental mode check installer task
22 #include <widget_install/task_parental_mode.h>
23 #include <widget_install/widget_install_errors.h>
24 #include <widget_install/widget_install_context.h>
25 #include <dpl/wrt-dao-ro/global_config.h>
26 #include <dpl/log/log.h>
29 namespace WidgetInstall {
30 TaskParentalMode::TaskParentalMode(InstallerContext &installerContext) :
31 DPL::TaskDecl<TaskParentalMode>(this),
32 m_installerContext(installerContext)
34 AddStep(&TaskParentalMode::StepCheckParentalMode);
37 TaskParentalMode::~TaskParentalMode()
39 //Nothing to do for now
42 void TaskParentalMode::StepCheckParentalMode()
44 LogInfo("Step: Checking parental mode status");
46 using namespace WrtDB;
47 if (GlobalDAOReadOnly::GetParentalMode()) {
48 Throw(Exceptions::ParentalModeActive);
51 } //namespace WidgetInstall