2 * Copyright (c) 2014 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.
18 #include <device/power.h>
19 #include <device/display.h>
21 #include "MsgCallStatusManager.h"
24 #include "MsgGconfWrapper.h"
25 #include "MsgDevicedWrapper.h"
38 if (g_lock_cnt <= 0) {
39 ret = device_power_request_lock(POWER_LOCK_CPU, 0);
41 MSG_DEBUG("device_power_request_lock() is failed [%d]", ret);
49 MSG_DEBUG("Display lock count = [%d]", g_lock_cnt);
55 void MsgDisplayUnlock()
65 MSG_DEBUG("Display lock count = [%d]", g_lock_cnt);
67 if (g_lock_cnt <= 0) {
68 ret = device_power_release_lock(POWER_LOCK_CPU);
70 MSG_DEBUG("device_power_release_lock() is failed [%d]", ret);
80 void MsgChangePmState()
85 callStatus = MsgGetCallStatus();
86 MSG_DEBUG("Call Status = %d", callStatus);
88 if (callStatus > 0 && callStatus < 3) {
89 MSG_DEBUG("Call is activated. Do not turn on the lcd.");
91 MSG_DEBUG("Call is not activated. Turn on the lcd.");
92 device_display_change_state(DISPLAY_STATE_NORMAL);