#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <TimeTracer.h>
-#include <tapi_common.h>
-#include <ITapiModem.h>
-#include <sim.h>
#include "Systeminfo.h"
#include <Logger.h>
using namespace WrtDeviceApis::CommonsJavaScript;
using namespace WrtDeviceApis::Commons;
-
+#define SIM_VALUE_MAX 4
namespace DeviceAPI {
namespace Systeminfo {
}
}
+void OrientationValueVconfCallback(keynode_t *node, void *event_ptr)
+{
+ LoggerD("enter");
+ if(event_ptr) {
+ ((Systeminfo*)event_ptr)->getWatchValue(WATCH_TYPE_DEVICE_ORIENTATION);
+ }
+}
+
void NetworkTypeValueCallback(connection_type_e type, void* event_ptr)
{
if(event_ptr) {
void OrientationValueCallback(unsigned int event_type, sensor_event_data_t *event , void *event_ptr)
{
- LoggerD("enter");
if(event_ptr) {
((Systeminfo*)event_ptr)->getWatchValue(WATCH_TYPE_DEVICE_ORIENTATION);
}
void localeChangedCallback(runtime_info_key_e key, void* event_ptr)
{
- LoggerD("enter");
if(event_ptr) {
((Systeminfo*)event_ptr)->getWatchValue(WATCH_TYPE_LOCALE);
- }
+ }
+}
+
+void SimCphsValueCallback(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ TelSimAccessResult_t access_rt = (TelSimAccessResult_t)result;
+ TelSimCphsNetName_t *cphsInfo = (TelSimCphsNetName_t *)data;
+
+ LoggerD("access_rt : " << access_rt);
+
+ if (user_data != NULL){
+ SysteminfoAsyncPendingEvent *pendingEvent = (SysteminfoAsyncPendingEvent *)user_data;
+ Systeminfo *systeminfo = (Systeminfo *)pendingEvent->getThisObject();
+ EventGetSysteminfoPtr event = pendingEvent->getEvent();
+
+ if (access_rt == TAPI_SIM_ACCESS_SUCCESS) {
+ if (cphsInfo->full_name) {
+ systeminfo->setSimValue(SIM_CPHS_VALUE, (char *)cphsInfo->full_name, event);
+ } else if (cphsInfo->short_name) {
+ systeminfo->setSimValue(SIM_CPHS_VALUE, (char *)cphsInfo->short_name, event);
+ } else {
+ systeminfo->setSimValue(SIM_CPHS_VALUE, NULL, event);
+ }
+ } else {
+ systeminfo->setSimValue(SIM_CPHS_VALUE, NULL, event);
+ }
+
+ delete pendingEvent;
+ pendingEvent = NULL;
+ user_data = NULL;
+ }
+}
+
+void SimMsisdnValueCallback(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ TelSimAccessResult_t access_rt = (TelSimAccessResult_t)result;
+ TelSimMsisdnList_t *msisdnInfo = (TelSimMsisdnList_t *)data;
+
+ LoggerD("access_rt : " << access_rt);
+
+ if (user_data != NULL){
+ SysteminfoAsyncPendingEvent *pendingEvent = (SysteminfoAsyncPendingEvent *)user_data;
+ Systeminfo *systeminfo = (Systeminfo *)pendingEvent->getThisObject();
+ EventGetSysteminfoPtr event = pendingEvent->getEvent();
+
+ if (access_rt == TAPI_SIM_ACCESS_SUCCESS) {
+ systeminfo->setSimValue(SIM_MSISDN_VALUE, (char *)msisdnInfo->list[0].num, event);
+ } else {
+ systeminfo->setSimValue(SIM_MSISDN_VALUE, NULL, event);
+ }
+
+ delete pendingEvent;
+ pendingEvent = NULL;
+ user_data = NULL;
+ }
+}
+
+void SimIccidValueCallback(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ TelSimAccessResult_t access_rt = (TelSimAccessResult_t)result;
+ TelSimIccIdInfo_t *iccidInfo = (TelSimIccIdInfo_t *)data;
+
+ LoggerD("access_rt : " << access_rt);
+
+ if (user_data != NULL){
+ SysteminfoAsyncPendingEvent *pendingEvent = (SysteminfoAsyncPendingEvent *)user_data;
+ Systeminfo *systeminfo = (Systeminfo *)pendingEvent->getThisObject();
+ EventGetSysteminfoPtr event = pendingEvent->getEvent();
+
+ if (access_rt == TAPI_SIM_ACCESS_SUCCESS) {
+ systeminfo->setSimValue(SIM_ICCID_VALUE, (char *)iccidInfo->icc_num, event);
+ } else {
+ systeminfo->setSimValue(SIM_ICCID_VALUE, NULL, event);
+ }
+
+ delete pendingEvent;
+ pendingEvent = NULL;
+ user_data = NULL;
+ }
+}
+
+void SimSpnValueCallback(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ TelSimAccessResult_t access_rt = (TelSimAccessResult_t)result;
+ TelSimSpn_t *spnInfo = (TelSimSpn_t *)data;
+
+ LoggerD("access_rt : " << access_rt);
+
+ if (user_data != NULL){
+ SysteminfoAsyncPendingEvent *pendingEvent = (SysteminfoAsyncPendingEvent *)user_data;
+ Systeminfo *systeminfo = (Systeminfo *)pendingEvent->getThisObject();
+ EventGetSysteminfoPtr event = pendingEvent->getEvent();
+
+ if (access_rt == TAPI_SIM_ACCESS_SUCCESS) {
+ systeminfo->setSimValue(SIM_SPN_VALUE, (char *)spnInfo->spn, event);
+ } else {
+ systeminfo->setSimValue(SIM_ICCID_VALUE, NULL, event);
+ }
+
+ delete pendingEvent;
+ pendingEvent = NULL;
+ user_data = NULL;
+ }
}
}
LoggerD("failed");
}
}
+
+ m_tapiHandle = tel_init(0);
+ if (m_tapiHandle == NULL) {
+ LoggerE ("tel init fail");
+ }
}
Systeminfo::~Systeminfo()
LoggerD("Network Client deregistration failed");
}
+ if (m_tapiHandle != NULL) {
+ tel_deinit(m_tapiHandle);
+ }
+
state = sf_stop(m_sensorHandle);
LoggerD("handle 1 state = " << state);
void Systeminfo::get(const EventGetSysteminfoPtr& event)
{
+ event->setTapiHandle((void*)m_tapiHandle);
EventRequestReceiver<EventGetSysteminfo>::PostRequest(event);
}
}
event->setSysteminfoPtr(this);
+ event->setTapiHandle((void*)m_tapiHandle);
m_EventMgrPtr->addEvent(event, event->getWatchType());
EventRequestReceiver<EventWatchSysteminfo>::PostRequest(event);
break;
case WATCH_TYPE_DEVICE_ORIENTATION:
if ((m_EventMgrPtr->getEventDeviceOrientationList()).size() == 1) {
+ vconf_ignore_key_changed(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, OrientationValueVconfCallback);
int state = sf_unregister_event(m_sensorHandle, ACCELEROMETER_EVENT_ROTATION_CHECK);
if (state < 0) {
LoggerD("sf_unregister_event fail to gather data\n");
for (EventStorageList::iterator it = eventList.begin(); it != eventList.end(); it++) {
int storageCnt = 1;
int sdcardState = 0;
- int usbhostState = 0;
if(vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sdcardState) == 0) {
if(sdcardState == VCONFKEY_SYSMAN_MMC_MOUNTED) {
storageCnt++;
}
}
- if(vconf_get_int(VCONFKEY_SYSMAN_USB_HOST_STATUS, &usbhostState) == 0) {
- if(usbhostState == VCONFKEY_SYSMAN_USB_HOST_CONNECTED) {
- storageCnt++;
- }
- }
LoggerD("storage cnt : " << storageCnt);
(*it)->getWatchValue(storageCnt);
}
return JSCpuInfo::createJSObject(context, cpuPtr);
}
+void Systeminfo::setSimValue(const int simAttribute, char* value, const EventGetSysteminfoPtr &event)
+{
+ int ret = 0;
+ if (!value) {
+ ret = event->addSimValueCnt();
+ } else {
+ ret = event->setSimValue(simAttribute, value);
+ }
+
+ if (ret == SIM_VALUE_MAX) {
+ event->makeSimObject();
+ EventRequestReceiver<EventGetSysteminfo>::ManualAnswer(event);
+ }
+}
+
void Systeminfo::OnRequestReceived(const EventGetSysteminfoPtr& event)
{
LoggerD("enter");
- event->processGetValue((void *)m_connectionHandle);
+
+ if (strcmp(event->getProperty(), (const char*)"SIM") == 0) {
+ int cardChanged = 0;
+ TelSimCardStatus_t simCardState;
+ TelSimImsiInfo_t imsi;
+ char* simState = NULL;
+
+ event->switchToManualAnswer();
+ event->setCancelAllowed(true);
+
+ if (tel_get_sim_init_info(m_tapiHandle, &simCardState, &cardChanged) == TAPI_API_SUCCESS) {
+ switch(simCardState) {
+ case TAPI_SIM_STATUS_CARD_NOT_PRESENT :
+ case TAPI_SIM_STATUS_CARD_REMOVED :
+ simState = strdup("ABSENT");
+ break;
+ case TAPI_SIM_STATUS_SIM_INITIALIZING :
+ simState = strdup("INITIALIZING");
+ break;
+ case TAPI_SIM_STATUS_SIM_INIT_COMPLETED :
+ simState = strdup("READY");
+ break;
+ case TAPI_SIM_STATUS_SIM_PIN_REQUIRED :
+ simState = strdup("PIN_REQUIRED");
+ break;
+ case TAPI_SIM_STATUS_SIM_PUK_REQUIRED :
+ simState = strdup("PUK_REQUIRED");
+ break;
+ case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED :
+ case TAPI_SIM_STATUS_CARD_BLOCKED :
+ simState = strdup("SIM_LOCKED");
+ break;
+ case TAPI_SIM_STATUS_SIM_NCK_REQUIRED :
+ case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED :
+ simState = strdup("NETWORK_LOCKED");
+ break;
+ default:
+ simState = strdup("UNKNOWN");
+ break;
+ }
+ LoggerD("simState : " << simState);
+ event->setSimState(simState);
+ if (simState)
+ free(simState);
+ if(strcmp(simState, "READY") == 0) {
+ if (tel_get_sim_imsi(m_tapiHandle, &imsi) == TAPI_API_SUCCESS) {
+ LoggerD("mcc : " << imsi.szMcc << \r" mnc : " << imsi.szMnc << " msin : " << imsi.szMsin);
+ event->setSimImsi(imsi.szMcc, imsi.szMnc, imsi.szMsin);
+ } else {
+ LoggerE("get fail sim imsi");
+ }
+ SysteminfoAsyncPendingEvent *cphsPendingEvent = new SysteminfoAsyncPendingEvent((void *)this, event);
+ tel_get_sim_cphs_netname(m_tapiHandle, SimCphsValueCallback, cphsPendingEvent);
+ SysteminfoAsyncPendingEvent *msisdnPendingEvent = new SysteminfoAsyncPendingEvent((void *)this, event);
+ tel_get_sim_msisdn(m_tapiHandle, SimMsisdnValueCallback, msisdnPendingEvent);
+ SysteminfoAsyncPendingEvent *iccidPendingEvent = new SysteminfoAsyncPendingEvent((void *)this, event);
+ tel_get_sim_iccid(m_tapiHandle, SimIccidValueCallback, iccidPendingEvent);
+ SysteminfoAsyncPendingEvent *spnPendingEvent = new SysteminfoAsyncPendingEvent((void *)this, event);
+ tel_get_sim_spn(m_tapiHandle, SimSpnValueCallback, spnPendingEvent);
+ } else {
+ event->makeSimObject();
+ EventRequestReceiver<EventGetSysteminfo>::ManualAnswer(event);
+ }
+ } else {
+ LoggerE("get fail sim state");
+ }
+ } else {
+ event->processGetValue((void *)m_connectionHandle);
+ }
}
void Systeminfo::OnRequestReceived(const EventWatchSysteminfoPtr& event)
case WATCH_TYPE_DEVICE_ORIENTATION:
LoggerD("regist sensor");
if ((m_EventMgrPtr->getEventDeviceOrientationList()).size() == 1) {
+ vconf_notify_key_changed(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, OrientationValueVconfCallback, (void *)this);
int state = sf_register_event(m_sensorHandle, ACCELEROMETER_EVENT_ROTATION_CHECK, NULL, OrientationValueCallback, (void *)this);
if (state < 0) {
LoggerD("sensor_register_cb fail to gather data");
PROPERTY_GET_SYSTEMINFO_DEFINITION(Storage) {
Converter converter(context);
int sdcardState=0;
- int usbhostState=0;
- int storageCnt=0;
struct statfs fs;
- StoragePropertiesPtr internal(new StorageProperties());
- StoragePropertiesPtr mmc(new StorageProperties());
- StoragePropertiesPtr usbhost(new StorageProperties());
- std::vector <JSObjectRef> storagelist;
if (statfs(STORAGE_INTERNAL_PATH, &fs) < 0) {
return JSValueMakeNull(context);
}
-
- internal->type = "INTERNAL";
- internal->capacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_blocks;
- internal->availableCapacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_bavail;
- internal->isRemoveable = false;
- internal->isRemovable = false;
- storagelist.push_back(JSStorageInfo::createJSObject(context, internal));
- storageCnt++;
-
- if(vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sdcardState) == 0){
+ StoragePropertiesPtr storagePtr(new StorageProperties());
+ storagePtr->units[0].type = "INTERNAL";
+ storagePtr->units[0].capacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_blocks;
+ storagePtr->units[0].availableCapacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_bavail;
+ storagePtr->units[0].isRemoveable = false;
+ storagePtr->units[0].isRemovable = false;
+ storagePtr->cnt = 1;
+ LoggerD("type : " << storagePtr->units[0].type);
+ if(vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sdcardState) == 0) {
if(sdcardState == VCONFKEY_SYSMAN_MMC_MOUNTED){
- storageCnt++;
if (statfs(STORAGE_SDCARD_PATH, &fs) < 0) {
return JSValueMakeNull(context);
}
- mmc->type = "MMC";
- mmc->capacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_blocks;
- mmc->availableCapacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_bavail;
- mmc->isRemoveable = true;
- mmc->isRemovable = true;
- storagelist.push_back(JSStorageInfo::createJSObject(context, mmc));
+ storagePtr->units[1].type = "MMC";
+ storagePtr->units[1].capacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_blocks;
+ storagePtr->units[1].availableCapacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_bavail;
+ storagePtr->units[1].isRemoveable = false;
+ storagePtr->units[1].isRemovable = false;
+ storagePtr->cnt = 2;
+ LoggerD("type : " << storagePtr->units[1].type);
}
}
+ return JSStorageInfo::createJSObject(context, storagePtr);
- if(vconf_get_int(VCONFKEY_SYSMAN_USB_HOST_STATUS, &usbhostState) == 0) {
- if(usbhostState == VCONFKEY_SYSMAN_USB_HOST_CONNECTED) {
- storageCnt++;
- if (statfs(STORAGE_USBHOST_PATH, &fs) < 0) {
- return JSValueMakeNull(context);
- }
- usbhost->type = "USB_HOST";
- usbhost->capacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_blocks;
- usbhost->availableCapacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_bavail;
- usbhost->isRemoveable = true;
- usbhost->isRemovable = true;
- storagelist.push_back(JSStorageInfo::createJSObject(context, usbhost));
- }
- }
-
- return JSObjectMakeArray(context, storageCnt, storagelist.data(), NULL);
}
PROPERTY_GET_SYSTEMINFO_DEFINITION(Display) {
Converter converter(context);
DisplayPropertiesPtr display(new DisplayProperties());
- int brightness=0, dotsPerInchX=0, dotsPerInchY=0, physicalW=0, physicalH=0, resolutionW=0, resolutionH=0;
+ int brightness=0, dotsPerInch=0, physicalW=0, physicalH=0;
+ bool screenSizeSmall = false, screenSizeBig = false;
if(vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &brightness) == 0) {
display->brightness = (double)(brightness)/DISPLAY_BRIGHTNESS_DIVIDE_VALUE;
- LoggerD("brightness : " << display->brightness);
}
- if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_WIDTH, &resolutionW) == SYSTEM_INFO_ERROR_NONE) {
- display->resolutionWidth = resolutionW;
- LoggerD("resolutionWidth : " << display->resolutionWidth);
- }
- if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_HEIGHT, &resolutionH) == SYSTEM_INFO_ERROR_NONE) {
- display->resolutionHeight = resolutionH;
- LoggerD("resolutionHeight : " << display->resolutionHeight);
+ if(system_info_get_platform_bool("tizen.org/feature/screen.size.normal.480.800", &screenSizeSmall) == SYSTEM_INFO_ERROR_NONE) {
+ if (screenSizeSmall) {
+ display->resolutionWidth = 480;
+ display->resolutionHeight = 800;
+ } else {
+ if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.720.1280", &screenSizeBig) == SYSTEM_INFO_ERROR_NONE) {
+ if (screenSizeBig) {
+ display->resolutionWidth = 720;
+ display->resolutionHeight = 1280;
+ }
+ }
+ }
}
- if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_DPI, &dotsPerInchX) == SYSTEM_INFO_ERROR_NONE) {
- display->dotsPerInchWidth = dotsPerInchX;
- LoggerD("dotsPerInchWidth : " << display->dotsPerInchWidth);
+
+ if(system_info_get_platform_int("tizen.org/feature/screen.dpi", &dotsPerInch) == SYSTEM_INFO_ERROR_NONE) {
+ display->dotsPerInchWidth = dotsPerInch;
+ display->dotsPerInchHeight = dotsPerInch;
}
- if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_DPI, &dotsPerInchY) == SYSTEM_INFO_ERROR_NONE) {
- display->dotsPerInchHeight = dotsPerInchY;
- LoggerD("dotsPerInchHeight : " << display->dotsPerInchHeight);
+
+ if(system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH, &physicalW) == SYSTEM_INFO_ERROR_NONE) {
+ display->physicalWidth = physicalW;
}
- if (system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, &physicalH) == SYSTEM_INFO_ERROR_NONE) {
+
+ if(system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, &physicalH) == SYSTEM_INFO_ERROR_NONE) {
display->physicalHeight = physicalH;
- LoggerD("physicalHeight : " << display->physicalHeight);
- }
- if (system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH, &physicalW) == SYSTEM_INFO_ERROR_NONE) {
- display->physicalWidth = physicalW;
- LoggerD("physicalWidth : " << display->physicalWidth);
}
return JSDisplayInfo::createJSObject(context, display);
char* apn = NULL;
char* imei = NULL;
int plmn = 0, cellId = 0, lac = 0, isRoaming = 0, isFlightMode = 0;
- TapiHandle *tapiHandle = NULL;
TIME_TRACER_ITEM_BEGIN("(cellular)mcc", 0);
if (vconf_get_int(VCONFKEY_TELEPHONY_PLMN, &plmn) == 0) {
connection_profile_destroy(profileHandle);
}
}
-
- tapiHandle = tel_init(0);
+
+ imei = tel_get_misc_me_imei_sync((TapiHandle*)tapiHandle);
- if (tapiHandle != NULL) {
- imei = tel_get_misc_me_imei_sync(tapiHandle);
-
- if (imei == NULL) {
- tel_deinit(tapiHandle);
- return JSCellularNetworkInfo::createJSObject(context, cellularNetwork);
- }
-
+ if (imei != NULL) {
+ LoggerD("imei : " << imei);
cellularNetwork->imei = imei;
free(imei);
- tel_deinit(tapiHandle);
+ } else {
+ LoggerD("get fail imei");
}
return JSCellularNetworkInfo::createJSObject(context, cellularNetwork);
Converter converter(context);
SIMPropertiesPtr SIM(new SIMProperties());
- sim_state_e state;
- char* fullName = NULL;
- char* shortName = NULL;
- char* msisdn = NULL;
- char* iccId = NULL;
- char* mcc = NULL;
- char* mnc = NULL;
- char* msin = NULL;
- char* spn = NULL;
- int ret = SIM_ERROR_NONE;
-
- ret = sim_get_state(&state);
- if (ret == SIM_ERROR_NONE) {
- if (state == SIM_STATE_UNAVAILABLE) {
- SIM->state = "ABSENT";
- } else if (state == SIM_STATE_LOCKED) {
- SIM->state = "PIN_REQUIRED";
- } else if (state == SIM_STATE_AVAILABLE) {
- SIM->state = "READY";
- } else if (state == SIM_STATE_UNKNOWN) {
- SIM->state = "INITIALIZING";
- }
- }
-
- ret = sim_get_cphs_operator_name(&fullName, &shortName);
- if (ret == SIM_ERROR_NONE) {
- if (fullName) {
- SIM->operatorName = fullName;
- LoggerD("operatorName : " << SIM->operatorName);
- free(fullName);
- } else if (shortName) {
- SIM->operatorName = shortName;
- LoggerD("operatorName : " << SIM->operatorName);
- free(shortName);
- }
- }
-
-
- ret = sim_get_subscriber_number(&msisdn);
- if (ret == SIM_ERROR_NONE) {
- if (msisdn) {
- SIM->msisdn = msisdn;
- LoggerD("msisdn : " << SIM->msisdn);
- free(msisdn);
- }
- }
-
- ret = sim_get_icc_id(&iccId);
- if (ret == SIM_ERROR_NONE) {
- if (iccId) {
- SIM->iccid = iccId;
- LoggerD("iccid : " << SIM->iccid);
- free(iccId);
- }
- }
-
- ret = sim_get_mcc(&mcc);
- if (ret == SIM_ERROR_NONE) {
- if (mcc) {
- SIM->mcc = atoi(mcc);
- LoggerD("mcc : " << SIM->mcc);
- free(mcc);
- }
- }
-
- ret = sim_get_mnc(&mnc);
- if (ret == SIM_ERROR_NONE) {
- if (mnc) {
- SIM->mnc = atoi(mnc);
- LoggerD("mnc : " << SIM->mnc);
- free(mnc);
- }
- }
-
- ret = sim_get_msin(&msin);
- if (ret == SIM_ERROR_NONE) {
- if (msin) {
- SIM->msin = msin;
- LoggerD("msin : " << SIM->msin);
- free(msin);
- }
- }
-
- ret = sim_get_spn(&spn);
- if (ret == SIM_ERROR_NONE) {
- if (spn) {
- SIM->spn = spn;
- LoggerD("spn : " << SIM->spn);
- free(spn);
- }
- }
-
return JSSIMInfo::createJSObject(context, SIM);
}
unsigned long rotation = 0;
int handleOrientaion = 0;
+ int isAutoRotation = 0;
+
+ if (vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &isAutoRotation) == 0) {
+ if (isAutoRotation) {
+ deviceOrientation->isAutoRotation = true;
+ } else {
+ deviceOrientation->isAutoRotation = false;
+ }
+ }
handleOrientaion = sf_connect(ACCELEROMETER_SENSOR);
LoggerD("handleOrientaion : " << handleOrientaion);
char* manufacturer = NULL;
char* buildVersion = NULL;
- if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &model) == SYSTEM_INFO_ERROR_NONE) {
+ if(system_info_get_platform_string("tizen.org/system/model_name", &model) == SYSTEM_INFO_ERROR_NONE) {
if (model != NULL) {
LoggerD("model : " << model);
Build->model = model;