#include <sys/time.h>
#include <system_info.h>
#include <sysman_managed.h>
+#include <telephony_network.h>
+#include <telephony-client/ITapiModem.h>
#include <vconf.h>
#include <FBaseSysLog.h>
else
{
bool supported = false;
- r = __systemInfo.GetValue(L"http://tizen.org/feature/telephony", supported);
+ r = __systemInfo.GetValue(L"http://tizen.org/feature/network.telephony", supported);
if(r != E_SUCCESS || supported == false)
{
SysLogException(NID_SYS, E_SYSTEM, "Current device does not support telephony feature.");
else
{
char* pImei = null;
- ret = system_info_get_value_string(SYSTEM_INFO_KEY_MOBILE_DEVICE_ID, &pImei);
- if(ret != SYSTEM_INFO_ERROR_NONE || pImei == null)
+ int time_count = 0;
+ int status = 0;
+ TapiHandle* handle = null;
+ handle = tel_init(null);
+ if(handle == null)
{
- SysLogException(NID_SYS, E_SYSTEM, "It is failed to get IMEI.");
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to init TAPI.");
resultId = new (std::nothrow) String(_SYSTEM_RESULT_ERROR);
}
else
{
- resultId = new (std::nothrow) String(_SYSTEM_RESULT_OK);
- returnValue = new (std::nothrow) String(pImei);
+ while(time_count < 30) //Wait 30 second.
+ {
+ ret = tel_check_modem_power_status(handle, &status);
+ SysLog(NID_SYS, "Modem check result is %d, status is %d.", handle, status);
+ if(ret != TAPI_API_SUCCESS)
+ {
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to get Modem status.");
+ break;
+ }
+
+ if(status == 0)
+ {
+ break;
+ }
+
+ usleep(1000000);
+ time_count++;
+ }
+
+ if(ret != TAPI_API_SUCCESS)
+ {
+ tel_deinit(handle);
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to get IMEI.");
+ resultId = new (std::nothrow) String(_SYSTEM_RESULT_ERROR);
+ }
+ else
+ {
+ pImei = tel_get_misc_me_imei_sync(handle);
+ tel_deinit(handle);
+ if(pImei == null)
+ {
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to get IMEI.");
+ resultId = new (std::nothrow) String(_SYSTEM_RESULT_ERROR);
+ }
+ else
+ {
+ resultId = new (std::nothrow) String(_SYSTEM_RESULT_OK);
+ returnValue = new (std::nothrow) String(pImei);
+ free(pImei);
+ }
+ }
}
}
}
#include <bluetooth.h>
#include <system_info.h>
+#include <telephony_network.h>
+#include <telephony-client/ITapiModem.h>
#include <FSys_SystemInfoImpl.h>
#include <FTextUtf8Encoder.h>
result
_DeviceId::GetId(Tizen::Base::String& deviceId, int type)
{
+ int ret = 0;
result r = E_SUCCESS;
-
if(__deviceId != "")
{
deviceId = __deviceId;
if(type == 0)
{
- int ret = system_info_get_value_string(SYSTEM_INFO_KEY_MOBILE_DEVICE_ID, &pDeviceString);
- SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE && pDeviceString != null, E_SYSTEM, "It is failed to get SYSTEM_INFO_KEY_MOBILE_DEVICE_ID.");
- SysLog(NID_SYS, "IMEI is [%s]", pDeviceString);
+ int time_count = 0;
+ int status = 0;
+ TapiHandle* handle = null;
+ handle = tel_init(null);
+ SysTryReturnResult(NID_SYS, handle != null, E_SYSTEM, "It is failed to init TAPI.");
+
+ while(time_count < 30) //Wait 30 second.
+ {
+ ret = tel_check_modem_power_status(handle, &status);
+ SysLog(NID_SYS, "Modem check result is %d, status is %d.", handle, status);
+ SysTryReturnResult(NID_SYS, ret == TAPI_API_SUCCESS, E_SYSTEM, "It is failed to get Modem status.");
+
+ if(status == 0)
+ {
+ break;
+ }
+
+ usleep(1000000);
+ time_count++;
+ }
+
+ if(ret != TAPI_API_SUCCESS)
+ {
+ tel_deinit(handle);
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to get IMEI.");
+ return E_SYSTEM;
+ }
+ else
+ {
+ pDeviceString = tel_get_misc_me_imei_sync(handle);
+ tel_deinit(handle);
+ SysTryReturnResult(NID_SYS, pDeviceString != null, E_SYSTEM, "It is failed to get IMEI");
+ }
}
else if(type == 1)
{
char* wifiMacAddress = null;
- int ret = wifi_get_mac_address(&wifiMacAddress);
+ ret = wifi_get_mac_address(&wifiMacAddress);
SysTryReturnResult(NID_SYS, ret == WIFI_ERROR_NONE && wifiMacAddress != null, E_SYSTEM, "It is failed to get Wi-Fi MAC address.");
SysLog(NID_SYS, "Wifi Address is [%s]", wifiMacAddress);
data->Add(new (std::nothrow) String(_RUNTIME_SERVICE_ID));
data->Add(new (std::nothrow) String(_RUNTIME_GET_SIZE));
data->Add(new (std::nothrow) String(msg_id));
- value = new String();
+ value = new (std::nothrow) String();
value->Append(size);
- data->Add(*value);
-
data->Add(value);
if(rcode == E_SUCCESS)
//Keyboard
static const wchar_t* _INPUT_KEYBOARD = L"http://tizen.org/feature/input.keyboard";
static const wchar_t* _INPUT_KEYBOARD_LAYOUT = L"http://tizen.org/feature/input.keyboard.layout";
+static const wchar_t* _INPUT_OPTIONKEY = L"http://tizen.org/feature/input.option_key";
//Location
static const wchar_t* _LOCATION = L"http://tizen.org/feature/location";
reg.AddValue(_SYSTEM_CACHING_SECTION, _INPUT_KEYBOARD_LAYOUT, sValue);
reg.Flush();
+ this->GetValue(_INPUT_OPTIONKEY, bValue);
+ if(bValue == true)
+ systemValue = _SYSTEM_CACHING_TRUE;
+ else
+ systemValue = _SYSTEM_CACHING_FALSE;
+ reg.AddValue(_SYSTEM_CACHING_SECTION, _INPUT_OPTIONKEY, systemValue);
+ reg.Flush();
+
this->GetValue(_LOCATION, bValue);
if(bValue == true)
systemValue = _SYSTEM_CACHING_TRUE;
}
free(pKeyboardType);
}
+ else if (key == _INPUT_OPTIONKEY)
+ {
+ value = true;
+ }
else if (key == _NETWORK_PUSH)
{
value = File::IsFileExist(_NETWORK_PUSH_BIN);