static const wchar_t* _SYSTEM_INFO_NETWORK_BLUETOOTH = L"http://tizen.org/feature/network.bluetooth";
static const wchar_t* _SYSTEM_INFO_INPUT_KEYBOARD = L"http://tizen.org/feature/input.keyboard";
static const wchar_t* _SYSTEM_INFO_TVOUT_SUPPORTED = L"http://tizen.org/feature/screen.output.rca";
+static const wchar_t* _SYSTEM_INFO_HDMI = L"http://tizen.org/feature/screen.output.hdmi";
_DeviceManagerImpl* _DeviceManagerImpl::__pDeviceManagerImpl = null;
-
class _DeviceManagerEventArg : public IEventArg
{
public:
IDeviceEventListener* pListener = dynamic_cast<IDeviceEventListener*> (&listener);
const _DeviceManagerEventArg* pArg = dynamic_cast<const _DeviceManagerEventArg*>(&arg);
- if(pListener == null || pArg == null)
- {
- SysLogException(NID_SYS, E_SYSTEM, "listener or arg is null.");
- return;
- }
+ SysTryReturnVoidResult(NID_SYS, pListener != null && pArg != null, E_SYSTEM, "Parameters are not available.");
pListener->OnDeviceStateChanged(pArg->deviceType, pArg->state);
}
String event;
int value = 0;
int ret = vconf_get_int(VCONFKEY_APPSERVICE_MMC_STATUS, &value);
- if(ret == -1)
- {
- SysLogException(NID_SYS, E_SYSTEM, "VCONFKEY_APPSERVICE_MMC_STATUS is error");
- }
+ SysTryReturnVoidResult(NID_SYS, ret == 0, E_SYSTEM, "VCONFKEY_APPSERVICE_MMC_STATUS is error");
+
if (value == 1)
{
event = _DEVICE_MANAGER_STATE_MOUNTED;
return;
}
std::unique_ptr<_DeviceManagerEventArg> pDeviceManagerEventArg(new (std::nothrow) _DeviceManagerEventArg());
- if(pDeviceManagerEventArg == null)
- {
- SysLogException(NID_SYS, E_OUT_OF_MEMORY, "It is failed to create instance of DeviceManagerEventArg");
- return;
- }
+ SysTryReturnVoidResult(NID_SYS, pDeviceManagerEventArg != null, E_OUT_OF_MEMORY, "It is failed to create instance of DeviceManagerEventArg");
+
pDeviceManagerEventArg->deviceType = deviceType;
pDeviceManagerEventArg->state = state;
{
int value = 0;
int ret = 0;
+ bool supported = false;
+ r = _SystemInfoImpl::GetSysInfo(_SYSTEM_INFO_HDMI, supported);
+ SysTryReturnResult(NID_SYS, supported == true, E_UNSUPPORTED_OPERATION, "Current device does not support HDMI.");
+
ret = vconf_get_int(VCONFKEY_SYSMAN_HDMI, &value);
SysTryReturnResult(NID_SYS, !(ret < 0), E_SYSTEM, "vconf_get_int failed Output value is %d", value);
- if(value < 0)
- {
- return E_UNSUPPORTED_OPERATION;
- }
+ SysTryReturnResult(NID_SYS, value >= 0, E_UNSUPPORTED_OPERATION, "Current device does not support HDMI.");
+
if(pDeviceEventListenerContainer->__hdmi == true)
{
r = E_OBJ_ALREADY_EXIST;
bool state = false;
ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_USB_CONNECTED, &state);
- if (ret != RUNTIME_INFO_ERROR_NONE)
- {
- SysLogException(NID_SYS, E_SYSTEM, "It is failed to get usb state");
- return;
- }
+ SysTryReturnVoidResult(NID_SYS, ret == RUNTIME_INFO_ERROR_NONE, E_SYSTEM, "It is failed to get usb state.");
if (state == true)
{
bool state = false;
ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_CHARGER_CONNECTED, &state);
- if (ret != RUNTIME_INFO_ERROR_NONE)
- {
- SysLogException(NID_SYS, E_SYSTEM, "It is failed to get charger state");
- return;
- }
+ SysTryReturnVoidResult(NID_SYS, ret == RUNTIME_INFO_ERROR_NONE, E_SYSTEM, "It is failed to get charger state.");
if (state == true)
{
bool state = false;
ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_TV_OUT_CONNECTED, &state);
- if (ret != RUNTIME_INFO_ERROR_NONE)
- {
- SysLogException(NID_SYS, E_SYSTEM, "It is failed to get tv connect state");
- return;
- }
+ SysTryReturnVoidResult(NID_SYS, ret == RUNTIME_INFO_ERROR_NONE, E_SYSTEM, "It is failed to get tv connect state.");
if (state == true)
{
{
int state = 0;
ret = runtime_info_get_value_int(RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, &state);
- if (ret != RUNTIME_INFO_ERROR_NONE)
- {
- SysLogException(NID_SYS, E_SYSTEM, "It is failed to get audion jack state");
- return;
- }
+ SysTryReturnVoidResult(NID_SYS, ret == RUNTIME_INFO_ERROR_NONE, E_SYSTEM, "It is failed to get audio connect state.");
if (state == RUNTIME_INFO_AUDIO_JACK_STATUS_UNCONNECTED)
{
bool state = false;
ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_SLIDING_KEYBOARD_OPENED, &state);
- if (ret != RUNTIME_INFO_ERROR_NONE)
- {
- SysLogException(NID_SYS, E_SYSTEM, "It is failed to get keyboard state");
- return;
- }
+ SysTryReturnVoidResult(NID_SYS, ret == RUNTIME_INFO_ERROR_NONE, E_SYSTEM, "It is failed to get built-in keyboard state.");
if (state == true)
{
{
bool keyboard = false;
r = _SystemInfoImpl::GetSysInfo(_SYSTEM_INFO_INPUT_KEYBOARD, keyboard);
- SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "Fail to get keyboard option.");
+ SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to get keyboard option.");
if (keyboard == false)
{
if(!_AppInfo::IsOspCompat())
case DEVICE_TYPE_HDMI:
{
int ret = 0;
+ bool supported = false;
+ r = _SystemInfoImpl::GetSysInfo(_SYSTEM_INFO_HDMI, supported);
+ SysTryReturnResult(NID_SYS, supported == false, E_UNSUPPORTED_OPERATION, "Current device does not support HDMI.");
+
ret = vconf_get_int(VCONFKEY_SYSMAN_HDMI, &value);
SysTryReturnResult(NID_SYS, !(ret < 0), E_SYSTEM, "vconf_get_int failed Output value is %d", value);
if (value == 1)