Touch to Lock Device Screen
To reduce hardware button usage for turning screen off implements this soft switch mechanism.
/*
Add <privilege>http://tizen.org/privilege/display</privilege> and
<feature name="http://tizen.org/feature/screen.size.all">true</feature>
*/
#include <tizen.h>
#include <device/display.h>
#include <device/callback.h>
static bool app_create(void * data) {
int device_display_state;
device_display_state = device_display_change_state(DISPLAY_STATE_SCREEN_OFF);
if (device_display_state < 0)
dlog_print(DLOG_ERROR, LOG_TAG, "Error: [%d]", device_display_state);
app_exit();
return false;
}