#include <pkgmgr/pkgmgr_parser_db.h>
#include <tzplatform_config.h>
#include <drm-tizen-apps.h>
+#include <dd-display.h>
#ifdef TIZEN_FEATURE_CSR
#include <csr-content-screening.h>
#endif
static char backend_busy = 0;
extern int num_of_backends;
bool is_drm_busy = false;
+static bool is_lock_set = false;
static GIOChannel *sio;
static guint swid;
backend_busy = backend_busy & ~(1 << position);
}
+static void __set_power_lock(void)
+{
+ if (is_lock_set)
+ return;
+
+ if (display_lock_state(LCD_OFF, STAY_CUR_STATE, 0) == 0)
+ is_lock_set = true;
+}
+
+static void __release_power_lock(void)
+{
+ if (!is_lock_set)
+ return;
+
+ if (display_unlock_state(LCD_OFF, PM_SLEEP_MARGIN) == 0)
+ is_lock_set = false;
+}
+
static gboolean getsize_io_handler(GIOChannel *io, GIOCondition cond,
gpointer data)
{
if (__check_backend_status_for_exit() &&
__check_queue_status_for_exit() && !is_drm_busy) {
g_main_loop_quit(mainloop);
+ if (is_lock_set)
+ __release_power_lock();
return FALSE;
}
return TRUE;
switch (job->req_type) {
case REQUEST_TYPE_INSTALL:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_install(job);
__post_process(ret, x, job);
break;
case REQUEST_TYPE_MOUNT_INSTALL:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_mount_install(job);
__post_process(ret, x, job);
break;
case REQUEST_TYPE_REINSTALL:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_reinstall(job);
__post_process(ret, x, job);
break;
case REQUEST_TYPE_UNINSTALL:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_uninstall(job);
__post_process(ret, x, job);
break;
case REQUEST_TYPE_MOVE:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_move(job);
__post_process(ret, x, job);
break;
case REQUEST_TYPE_ENABLE_PKG:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_enable_pkg(job);
if (ret < 0)
_send_fail_signal(job);
break;
case REQUEST_TYPE_DISABLE_PKG:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_disable_pkg(job);
if (ret < 0)
_send_fail_signal(job);
break;
case REQUEST_TYPE_CLEARDATA:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_cleardata(job);
__post_process(ret, x, job);
break;
case REQUEST_TYPE_CLEARCACHE:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_clearcache(job);
__post_process(ret, x, job);
break;
break;
case REQUEST_TYPE_MIGRATE_EXTERNAL_IMAGE:
__set_backend_busy(x);
+ __set_power_lock();
ret = __process_migrate_external_image(job);
__post_process(ret, x, job);
break;