displayHandle = ecore_wl2_display_connect(NULL);
if (!displayHandle) {
ret = get_last_result();
- ERR("ecore_wl2_display_connect() Fail(%s)\n", get_error_message(ret));
+ ERR("ecore_wl2_display_connect() Fail(%d)", ret);
return MODES_ERROR_SYSTEM;
}
gestureHandle = efl_util_gesture_initialize();
if (NULL == gestureHandle) {
ret = get_last_result();
- ERR("efl_util_gesture_initialize() Fail(%s)", get_error_message(ret));
+ ERR("efl_util_gesture_initialize() Fail(%d)", ret);
return MODES_ERROR_SYSTEM;
}
if (EFL_UTIL_ERROR_NONE == ret) {
modesRet = MODES_ERROR_NONE;
} else {
- ERR("efl_util_gesture_activate_set() Fail(%s)", get_error_message(ret));
+ ERR("efl_util_gesture_activate_set() Fail(%d)", ret);
modesRet = MODES_ERROR_SYSTEM;
}
+++ /dev/null
-/*
- * Copyright (c) 2019 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 "DisplayAlwaysOn.h"
-#include <sstream>
-#include <string>
-#include <vconf.h>
-#include <modes_errors.h>
-#include "plugin-log.h"
-
-MODES_NAMESPACE_USE;
-
-const std::string DisplayAlwaysOn::NAME = "alwaysOn";
-DisplayAlwaysOn::DisplayAlwaysOn()
- :DisplayAction(NAME), key(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL), oldDisplayTimeout(-1), curVal(false)
-{
-}
-
-DisplayAlwaysOn::~DisplayAlwaysOn()
-{
-}
-
-int DisplayAlwaysOn::set(bool val)
-{
- int ret;
- curVal = val;
- if (true == val) {
- ret = vconf_get_int(key, &oldDisplayTimeout);
- if (0 != ret) {
- ERR("vconf_get_int(%s) Fail(%s)", key, get_error_message(ret));
- return MODES_ERROR_SYSTEM;
- }
- ret = vconf_set_int(key, 0);
- if (0 != ret) {
- ERR("vconf_set_int(%s, 0) Fail(%s)", key, get_error_message(ret));
- return MODES_ERROR_SYSTEM;
- }
- }
-
- return MODES_ERROR_NONE;
-}
-
-int DisplayAlwaysOn::undo()
-{
- int ret;
- DBG("undo AlwaysOn(%s, %d)",
- key, oldDisplayTimeout);
- if (true == curVal) {
- ret = vconf_set_int(key, oldDisplayTimeout);
- if (0 != ret) {
- ERR("vconf_set_int(%s, %d) Fail(%s)", key, oldDisplayTimeout, get_error_message(ret));
- return MODES_ERROR_SYSTEM;
- }
- }
- return MODES_ERROR_NONE;
-}
-
-std::string DisplayAlwaysOn::serialize()
-{
- std::ostringstream ostr;
-
- ostr << oldDisplayTimeout;
- return ostr.str();
-}
-
-int DisplayAlwaysOn::parse(const std::string &archive)
-{
- std::istringstream iss(archive);
- iss >> oldDisplayTimeout;
-
- return MODES_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 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.
- */
-#pragma once
-
-#include <string>
-#include "plugin-def.h"
-#include "DisplayAction.h"
-
-MODES_NAMESPACE_BEGIN
-
-class DisplayAlwaysOn : public DisplayAction {
-public:
- DisplayAlwaysOn();
- ~DisplayAlwaysOn();
-
- int set(bool val) override;
- int undo() override;
- std::string serialize() override;
- int parse(const std::string &archive) override;
-
- static const std::string NAME;
-private:
- const char* const key;
- int oldDisplayTimeout;
- bool curVal;
-};
-
-MODES_NAMESPACE_END
#include <device/power.h>
#include "plugin-log.h"
#include "DisplayBrightness.h"
-#include "DisplayAlwaysOn.h"
+#include "DisplayTimeout.h"
#include "DisplayAllowPalmTouch.h"
MODES_NAMESPACE_USE;
DisplayFactory::DisplayFactory()
{
actionMap[DisplayBrightness::NAME] = BRIGHTNESS;
- actionMap[DisplayAlwaysOn::NAME] = ALWAYS_ON;
+ actionMap[DisplayTimeout::NAME] = TIMEOUT;
actionMap[DisplayAllowPalmTouch::NAME] = ALLOW_PALM_TOUCH;
}
case BRIGHTNESS:
action = new DisplayBrightness();
break;
- case ALWAYS_ON:
- action = new DisplayAlwaysOn();
+ case TIMEOUT:
+ action = new DisplayTimeout();
break;
case ALLOW_PALM_TOUCH:
action = new DisplayAllowPalmTouch();
private:
enum actionKey{
BRIGHTNESS,
- ALWAYS_ON,
+ TIMEOUT,
ALLOW_PALM_TOUCH,
};
--- /dev/null
+/*
+ * Copyright (c) 2019 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 "DisplayTimeout.h"
+#include <sstream>
+#include <string>
+#include <vconf.h>
+#include <modes_errors.h>
+#include "plugin-log.h"
+
+MODES_NAMESPACE_USE;
+
+const std::string DisplayTimeout::NAME = "Timeout";
+DisplayTimeout::DisplayTimeout()
+ :DisplayAction(NAME), key(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL), oldDisplayTimeout(-1)
+{
+}
+
+DisplayTimeout::~DisplayTimeout()
+{
+}
+
+int DisplayTimeout::set(int val)
+{
+ int ret = vconf_get_int(key, &oldDisplayTimeout);
+ if (0 != ret) {
+ ERR("vconf_get_int(%s) Fail(%d)", key, ret);
+ return MODES_ERROR_SYSTEM;
+ }
+ ret = vconf_set_int(key, val);
+ if (0 != ret) {
+ ERR("vconf_set_int(%s, %d) Fail(%d)", key, val, ret);
+ return MODES_ERROR_SYSTEM;
+ }
+
+ return MODES_ERROR_NONE;
+}
+
+int DisplayTimeout::undo()
+{
+ DBG("undo Display Timeout(%s, %d)",
+ key, oldDisplayTimeout);
+ int ret = vconf_set_int(key, oldDisplayTimeout);
+ if (0 != ret) {
+ ERR("vconf_set_int(%s, %d) Fail(%d)", key, oldDisplayTimeout, ret);
+ return MODES_ERROR_SYSTEM;
+ }
+ return MODES_ERROR_NONE;
+}
+
+std::string DisplayTimeout::serialize()
+{
+ std::ostringstream ostr;
+
+ ostr << oldDisplayTimeout;
+ return ostr.str();
+}
+
+int DisplayTimeout::parse(const std::string &archive)
+{
+ std::istringstream iss(archive);
+ iss >> oldDisplayTimeout;
+
+ return MODES_ERROR_NONE;
+}
--- /dev/null
+/*
+ * Copyright (c) 2019 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.
+ */
+#pragma once
+
+#include <string>
+#include "plugin-def.h"
+#include "DisplayAction.h"
+
+MODES_NAMESPACE_BEGIN
+
+class DisplayTimeout : public DisplayAction {
+public:
+ DisplayTimeout();
+ ~DisplayTimeout();
+
+ int set(int val) override;
+ int undo() override;
+ std::string serialize() override;
+ int parse(const std::string &archive) override;
+
+ static const std::string NAME;
+private:
+ const char* const key;
+ int oldDisplayTimeout;
+};
+
+MODES_NAMESPACE_END
<desc>Display brightness</desc>
<domain>System</domain>
</rule>
- <rule name="display.alwaysOn" type="bool" since="6.0" plugin="display">
- <alias name="on">1</alias>
- <alias name="off">0</alias>
- <desc>Always on display</desc>
+ <rule name="display.Timeout" type="int" since="6.0" plugin="display">
+ <alias name="ALWAYS_ON">0</alias>
+ <desc>Display Timeout</desc>
<domain>System</domain>
</rule>
<rule name="display.allowPalmTouch" type="bool" since="6.0" plugin="display">
static gboolean displayPluginAlwaysOnIdler(gpointer data)
{
PluginAction *action;
- result = plugin->set("alwaysOn", true, &action);
+ result = plugin->set("Timeout", 0, &action);
EXPECT_EQ(MODES_ERROR_NONE, result);
result = plugin->undo(action);
<?xml version="1.0" encoding="utf-8"?>
<tizenModes xmlns="http://www.tizen.org" version="6.0">
<mode name="displayBlock" type="exclusive">
- <action rule="display.alwaysOn">on</action>
+ <action rule="display.Timeout">ALWAYS_ON</action>
<action rule="display.allowPalmTouch">off</action>
</mode>
</tizenModes>