2 // Tizen Web Device API
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #include <PlatformException.h>
21 #include <system_info.h>
22 #include <system_info_internal.h>
24 #include "SystemInfoDeviceCapability.h"
25 #include "SystemInfoUtil.h"
28 namespace SystemInfo {
33 const char* DEVICE_PROFILE = "MOBILE";
34 #elif PROFILE_MOBILE_FULL
35 const char* DEVICE_PROFILE = "MOBILE_FULL"; //TODO to be removed
36 #elif PROFILE_MOBILE_WEB
37 const char* DEVICE_PROFILE = "MOBILE_WEB"; //TODO to be removed
38 #elif PROFILE_WEARABLE
39 const char* DEVICE_PROFILE = "WEARABLE";
41 const char* DEVICE_PROFILE = "TV";
43 const char* DEVICE_PROFILE = "";
46 const char* OPENGLES_TEXTURE_DELIMITER = "/";
47 const char* OPENGLES_TEXTURE_UTC = "utc";
48 const char* OPENGLES_TEXTURE_PTC = "ptc";
49 const char* OPENGLES_TEXTURE_ETC = "etc";
50 const char* OPENGLES_TEXTURE_3DC = "3dc";
51 const char* OPENGLES_TEXTURE_ATC = "atc";
52 const char* OPENGLES_TEXTURE_PVRTC = "pvrtc";
55 SystemInfoDeviceCapability::SystemInfoDeviceCapability()
60 SystemInfoDeviceCapability::~SystemInfoDeviceCapability()
65 bool SystemInfoDeviceCapability::isAccount()
68 return getValueBool("tizen.org/feature/account");
71 bool SystemInfoDeviceCapability::isArchive()
74 return getValueBool("tizen.org/feature/archive");
77 bool SystemInfoDeviceCapability::isBadge()
80 return getValueBool("tizen.org/feature/badge");
83 bool SystemInfoDeviceCapability::isBookmark()
86 return getValueBool("tizen.org/feature/bookmark");
89 bool SystemInfoDeviceCapability::isCalendar()
92 return getValueBool("tizen.org/feature/calendar");
95 bool SystemInfoDeviceCapability::isContact()
98 return getValueBool("tizen.org/feature/contact");
101 bool SystemInfoDeviceCapability::isDataControl()
104 return getValueBool("tizen.org/feature/datacontrol");
107 bool SystemInfoDeviceCapability::isDataSync()
110 return getValueBool("tizen.org/feature/datasync");
113 bool SystemInfoDeviceCapability::isDownload()
116 return getValueBool("tizen.org/feature/download");
119 bool SystemInfoDeviceCapability::isExif()
122 return getValueBool("tizen.org/feature/exif");
125 bool SystemInfoDeviceCapability::isMessagingEmail()
128 return getValueBool("tizen.org/feature/email");
131 bool SystemInfoDeviceCapability::isBluetooth()
134 return getValueBool("tizen.org/feature/network.bluetooth");
137 bool SystemInfoDeviceCapability::isBluetoothAudioCall()
140 return getValueBool("tizen.org/feature/network.bluetooth.audio.call");
143 bool SystemInfoDeviceCapability::isBluetoothAudioMedia()
146 return getValueBool("tizen.org/feature/network.bluetooth.audio.media");
149 bool SystemInfoDeviceCapability::isBluetootHealth()
152 return getValueBool("tizen.org/feature/network.bluetooth.health");
155 bool SystemInfoDeviceCapability::isBluetootHID()
158 return getValueBool("tizen.org/feature/network.bluetooth.hid");
161 bool SystemInfoDeviceCapability::isBluetootLE()
164 return getValueBool("tizen.org/feature/network.bluetooth.le");
167 bool SystemInfoDeviceCapability::isBluetootOPP()
170 return getValueBool("tizen.org/feature/network.bluetooth.opp");
173 bool SystemInfoDeviceCapability::isBluetoothAlwaysOn()
176 #ifdef FEATURE_OPTIONAL_BT_ALWAYS_ON
183 std::string SystemInfoDeviceCapability::isCoreAPIVersion()
189 bool SystemInfoDeviceCapability::isNfc()
192 return getValueBool("tizen.org/feature/network.nfc");
195 bool SystemInfoDeviceCapability::isNfcEmulation()
198 return getValueBool("tizen.org/feature/network.nfc.card_emulation");
201 bool SystemInfoDeviceCapability::isPush()
204 return getValueBool("tizen.org/feature/network.push");
207 bool SystemInfoDeviceCapability::isSecureElement()
210 return getValueBool("tizen.org/feature/network.secure_element");
213 bool SystemInfoDeviceCapability::isTelephony()
216 return getValueBool("tizen.org/feature/network.telephony");
219 bool SystemInfoDeviceCapability::isTelephonyMMS()
222 return getValueBool("tizen.org/feature/network.telephony.mms");
225 bool SystemInfoDeviceCapability::isNotification()
228 return getValueBool("tizen.org/feature/notification");
231 bool SystemInfoDeviceCapability::isWebSetting()
234 return getValueBool("tizen.org/feature/websetting");
237 bool SystemInfoDeviceCapability::isSystemSetting()
240 return getValueBool("tizen.org/feature/systemsetting");
243 bool SystemInfoDeviceCapability::isSystemSettingHomeScreen()
246 return getValueBool("tizen.org/feature/systemsetting.home_screen");
249 bool SystemInfoDeviceCapability::isSystemSettingLockScreen()
252 return getValueBool("tizen.org/feature/systemsetting.lock_screen");
255 bool SystemInfoDeviceCapability::isSystemSettingIncomingCall()
258 return getValueBool("tizen.org/feature/systemsetting.incoming_call");
261 bool SystemInfoDeviceCapability::isSystemSettingNotificationEmail()
264 return getValueBool("tizen.org/feature/systemsetting.notification_email");
267 bool SystemInfoDeviceCapability::isBattery()
270 return getValueBool("tizen.org/feature/battery");
273 bool SystemInfoDeviceCapability::isAccelerometer()
276 return getValueBool("tizen.org/feature/sensor.accelerometer");
279 bool SystemInfoDeviceCapability::isAccelerometerWakeup()
282 return getValueBool("tizen.org/feature/sensor.accelerometer.wakeup");
285 bool SystemInfoDeviceCapability::isActivityRecognition()
288 return getValueBool("tizen.org/feature/sensor.activity_recognition");
291 bool SystemInfoDeviceCapability::isBarometer()
294 return getValueBool("tizen.org/feature/sensor.barometer");
297 bool SystemInfoDeviceCapability::isBarometerWakeup()
300 return getValueBool("tizen.org/feature/sensor.barometer.wakeup");
303 bool SystemInfoDeviceCapability::isGestureRecognition()
306 return getValueBool("tizen.org/feature/sensor.gesture_recognition");
309 bool SystemInfoDeviceCapability::isGravity()
312 return getValueBool("tizen.org/feature/sensor.gravity");
315 bool SystemInfoDeviceCapability::isGyroscope()
318 return getValueBool("tizen.org/feature/sensor.gyroscope");
321 bool SystemInfoDeviceCapability::isGyroscopeWakeup()
324 return getValueBool("tizen.org/feature/sensor.gyroscope.wakeup");
327 bool SystemInfoDeviceCapability::isHumidity()
330 return getValueBool("tizen.org/feature/sensor.humidity");
333 bool SystemInfoDeviceCapability::isLinearAcceleration()
336 return getValueBool("tizen.org/feature/sensor.linear_acceleration");
339 bool SystemInfoDeviceCapability::isMagnetometer()
342 return getValueBool("tizen.org/feature/sensor.magnetometer");
345 bool SystemInfoDeviceCapability::isMagnetometerWakeup()
348 return getValueBool("tizen.org/feature/sensor.magnetometer.wakeup");
351 bool SystemInfoDeviceCapability::isPhotometer()
354 return getValueBool("tizen.org/feature/sensor.photometer");
357 bool SystemInfoDeviceCapability::isPhotometerWakeup()
360 return getValueBool("tizen.org/feature/sensor.photometer.wakeup");
363 bool SystemInfoDeviceCapability::isProximity()
366 return getValueBool("tizen.org/feature/sensor.proximity");
369 bool SystemInfoDeviceCapability::isProximityWakeup()
372 return getValueBool("tizen.org/feature/sensor.proximity.wakeup");
375 bool SystemInfoDeviceCapability::isTiltmeter()
378 return getValueBool("tizen.org/feature/sensor.tiltmeter");
381 bool SystemInfoDeviceCapability::isTiltmeterWakeup()
384 return getValueBool("tizen.org/feature/sensor.tiltmeter.wakeup");
387 bool SystemInfoDeviceCapability::isRotationVector()
390 return getValueBool("tizen.org/feature/sensor.rotation_vector");
393 bool SystemInfoDeviceCapability::isTemperature()
396 return getValueBool("tizen.org/feature/sensor.temperature");
399 bool SystemInfoDeviceCapability::isUltraviolet()
402 return getValueBool("tizen.org/feature/sensor.ultraviolet");
405 bool SystemInfoDeviceCapability::isPedometer()
408 return getValueBool("tizen.org/feature/sensor.pedometer");
411 bool SystemInfoDeviceCapability::isWristUp()
414 return getValueBool("tizen.org/feature/sensor.wrist_up");
417 bool SystemInfoDeviceCapability::isHumanActivityMonitor()
420 return getValueBool("tizen.org/feature/humanactivitymonitor");
423 bool SystemInfoDeviceCapability::isHrm()
426 return getValueBool("tizen.org/feature/sensor.heart_rate_monitor");
429 bool SystemInfoDeviceCapability::isCamera()
432 return getValueBool("tizen.org/feature/camera");
435 bool SystemInfoDeviceCapability::isCameraFront()
438 return getValueBool("tizen.org/feature/camera.front");
441 bool SystemInfoDeviceCapability::isCameraFrontFlash()
444 return getValueBool("tizen.org/feature/camera.front.flash");
447 bool SystemInfoDeviceCapability::isCameraBack()
450 return getValueBool("tizen.org/feature/camera.back");
453 bool SystemInfoDeviceCapability::isCameraBackFlash()
456 return getValueBool("tizen.org/feature/camera.back.flash");
459 bool SystemInfoDeviceCapability::isFmRadio()
462 return getValueBool("tizen.org/feature/fmradio");
465 bool SystemInfoDeviceCapability::isGraphicsAcceleration()
468 return getValueBool("tizen.org/feature/graphics.acceleration");
471 bool SystemInfoDeviceCapability::isLed()
474 return getValueBool("tizen.org/feature/led");
477 bool SystemInfoDeviceCapability::isInputKeyboard()
480 return getValueBool("tizen.org/feature/input.keyboard");
483 bool SystemInfoDeviceCapability::isInputKeyboardLayout()
486 std::string input_keyboard_layout = getValueString("tizen.org/feature/input.keyboard.layout");
488 bool input_keyboard = getValueBool("tizen.org/feature/input.keyboard");
490 // according to SystemInfo-DeviceCapabilities-dependency-table
491 // inputKeyboard inputKeyboardLayout
497 return input_keyboard ? !(input_keyboard_layout.empty()) : false;
500 std::string SystemInfoDeviceCapability::getInputKeyboardLayout()
503 return getValueString("tizen.org/feature/input.keyboard.layout");
506 bool SystemInfoDeviceCapability::isLocation()
509 return getValueBool("tizen.org/feature/location");
512 bool SystemInfoDeviceCapability::isLocationGps()
515 return getValueBool("tizen.org/feature/location.gps");
518 bool SystemInfoDeviceCapability::isLocationWps()
521 return getValueBool("tizen.org/feature/location.wps");
524 bool SystemInfoDeviceCapability::isLocationBatch()
527 return getValueBool("tizen.org/feature/location.batch");
530 bool SystemInfoDeviceCapability::isMultimediaTranscoder()
533 return getValueBool("tizen.org/feature/multimedia.transcoder");
536 bool SystemInfoDeviceCapability::isMicrophone()
539 return getValueBool("tizen.org/feature/microphone");
542 bool SystemInfoDeviceCapability::isMultiTouchPinchZoon()
545 return getValueBool("tizen.org/feature/multi_point_touch.pinch_zoom");
548 unsigned short SystemInfoDeviceCapability::getMultiTouchCount()
551 return getValueInt("tizen.org/feature/multi_point_touch.point_count");
554 bool SystemInfoDeviceCapability::isNfcReservedPush()
557 return getValueBool("tizen.org/feature/network.nfc.reserved_push");
560 bool SystemInfoDeviceCapability::isTelephonySMS()
563 return getValueBool("tizen.org/feature/network.telephony.sms");
566 bool SystemInfoDeviceCapability::isWifi()
569 return getValueBool("tizen.org/feature/network.wifi");
572 bool SystemInfoDeviceCapability::isWifiDirect()
575 return getValueBool("tizen.org/feature/network.wifi.direct");
578 bool SystemInfoDeviceCapability::isAutoRotation()
581 return getValueBool("tizen.org/feature/screen.auto_rotation");
583 unsigned short SystemInfoDeviceCapability::getScreenBpp()
586 return getValueInt("tizen.org/feature/screen.bpp");
589 bool SystemInfoDeviceCapability::isScreen()
592 return getValueBool("tizen.org/feature/screen.size.all");
595 bool SystemInfoDeviceCapability::isScreenCoordinateSystemSizeLarge()
598 return getValueBool("tizen.org/feature/screen.coordinate_system.size.large");
601 bool SystemInfoDeviceCapability::isScreenCoordinateSystemSizeNormal()
604 return getValueBool("tizen.org/feature/screen.coordinate_system.size.normal");
607 unsigned short SystemInfoDeviceCapability::getScreenDpi()
610 return getValueInt("tizen.org/feature/screen.dpi");
613 bool SystemInfoDeviceCapability::isScreenOutputHdmi()
616 return getValueBool("tizen.org/feature/screen.output.hdmi");
619 bool SystemInfoDeviceCapability::isScreenOutputRca()
622 return getValueBool("tizen.org/feature/screen.output.rca");
625 bool SystemInfoDeviceCapability::isUsbAccessory()
628 return getValueBool("tizen.org/feature/usb.accessory");
631 bool SystemInfoDeviceCapability::isUsbHost()
634 return getValueBool("tizen.org/feature/usb.host");
637 bool SystemInfoDeviceCapability::isWebService()
640 return getValueBool("tizen.org/feature/web.service");
643 unsigned short SystemInfoDeviceCapability::getScreenHeight()
646 int height = getValueInt("tizen.org/feature/screen.height");
650 bool SystemInfoDeviceCapability::isScreenSizeAll()
653 return getValueBool("tizen.org/feature/screen.size.all");
656 bool SystemInfoDeviceCapability::isScreenSizeLarge()
659 return getValueBool("tizen.org/feature/screen.size.large");
662 bool SystemInfoDeviceCapability::isScreenSizeNormal()
665 return getValueBool("tizen.org/feature/screen.size.normal");
668 bool SystemInfoDeviceCapability::isScreenSize320_320()
671 return getValueBool("tizen.org/feature/screen.size.normal.320.320");
674 bool SystemInfoDeviceCapability::isScreenSize240_400()
677 return getValueBool("tizen.org/feature/screen.size.normal.240.400");
680 bool SystemInfoDeviceCapability::isScreenSize320_480()
683 return getValueBool("tizen.org/feature/screen.size.normal.320.480");
686 bool SystemInfoDeviceCapability::isScreenSize360_480()
689 return getValueBool("tizen.org/feature/screen.size.normal.360.480");
692 bool SystemInfoDeviceCapability::isScreenSize540_960()
695 return getValueBool("tizen.org/feature/screen.size.normal.540.960");
698 bool SystemInfoDeviceCapability::isScreenSize600_1024()
701 return getValueBool("tizen.org/feature/screen.size.normal.600.1024");
704 bool SystemInfoDeviceCapability::isScreenSize480_800()
707 return getValueBool("tizen.org/feature/screen.size.normal.480.800");
710 bool SystemInfoDeviceCapability::isScreenSize720_1280()
713 return getValueBool("tizen.org/feature/screen.size.normal.720.1280");
716 bool SystemInfoDeviceCapability::isScreenSize1080_1920()
719 return getValueBool("tizen.org/feature/screen.size.normal.1080.1920");
722 unsigned short SystemInfoDeviceCapability::getScreenWidth()
725 int width = getValueInt("tizen.org/feature/screen.width");
729 bool SystemInfoDeviceCapability::isDataEncryption()
732 return getValueBool("tizen.org/feature/database.encryption");
735 bool SystemInfoDeviceCapability::isNativeOspCompatible()
738 #ifdef PROFILE_WEARABLE
741 return getValueBool("tizen.org/feature/platform.native.osp_compatible");
745 std::string SystemInfoDeviceCapability::getOpenglesTextureFormat()
748 if (!getValueBool("tizen.org/feature/opengles")) {
749 // this exception is converted to "Undefined" value in JS layer
750 std::string log_msg = "OpenGL-ES is not supported";
751 LOGE("%s", log_msg.c_str());
753 std::string texture_format = "";
754 if (getValueBool("tizen.org/feature/opengles.texture_format.utc")) {
755 texture_format += OPENGLES_TEXTURE_UTC;
757 if (getValueBool("tizen.org/feature/opengles.texture_format.ptc")) {
758 if (!texture_format.empty()) {
759 texture_format += OPENGLES_TEXTURE_DELIMITER;
761 texture_format += OPENGLES_TEXTURE_PTC;
763 if (getValueBool("tizen.org/feature/opengles.texture_format.etc")) {
764 if (!texture_format.empty()) {
765 texture_format += OPENGLES_TEXTURE_DELIMITER;
767 texture_format += OPENGLES_TEXTURE_ETC;
769 if (getValueBool("tizen.org/feature/opengles.texture_format.3dc")) {
770 if (!texture_format.empty()) {
771 texture_format += OPENGLES_TEXTURE_DELIMITER;
773 texture_format += OPENGLES_TEXTURE_3DC;
775 if (getValueBool("tizen.org/feature/opengles.texture_format.atc")) {
776 if (!texture_format.empty()) {
777 texture_format += OPENGLES_TEXTURE_DELIMITER;
779 texture_format += OPENGLES_TEXTURE_ATC;
781 if (getValueBool("tizen.org/feature/opengles.texture_format.pvrtc")) {
782 if (!texture_format.empty()) {
783 texture_format += OPENGLES_TEXTURE_DELIMITER;
785 texture_format += OPENGLES_TEXTURE_PVRTC;
787 if (texture_format.empty()) {
788 // this exception is converted to "Undefined" value in JS layer
789 std::string log_msg = "Platform error while getting OpenGL-ES texture format";
790 LOGE("%s", log_msg.c_str());
792 return texture_format;
795 bool SystemInfoDeviceCapability::isOpenglesTextureFormat3DC()
798 return getValueBool("tizen.org/feature/opengles.texture_format.3dc");
801 bool SystemInfoDeviceCapability::isOpenglesTextureFormatATC()
804 return getValueBool("tizen.org/feature/opengles.texture_format.atc");
807 bool SystemInfoDeviceCapability::isOpenglesTextureFormatETC()
810 return getValueBool("tizen.org/feature/opengles.texture_format.etc");
813 bool SystemInfoDeviceCapability::isOpenglesTextureFormatPTC()
816 return getValueBool("tizen.org/feature/opengles.texture_format.ptc");
819 bool SystemInfoDeviceCapability::isOpenglesTextureFormatPVRTC()
822 return getValueBool("tizen.org/feature/opengles.texture_format.pvrtc");
825 bool SystemInfoDeviceCapability::isOpenglesTextureFormatUTC()
828 return getValueBool("tizen.org/feature/opengles.texture_format.utc");
831 bool SystemInfoDeviceCapability::isOpengles()
834 return getValueBool("tizen.org/feature/opengles");
837 bool SystemInfoDeviceCapability::isOpenglesVersion11()
840 return getValueBool("tizen.org/feature/opengles.version.1_1");
843 bool SystemInfoDeviceCapability::isOpenglesVersion20()
846 return getValueBool("tizen.org/feature/opengles.version.2_0");
849 bool SystemInfoDeviceCapability::isShellAppWidget()
852 return getValueBool("tizen.org/feature/shell.appwidget");
855 bool SystemInfoDeviceCapability::isSipVoip()
858 return getValueBool("tizen.org/feature/sip.voip");
861 bool SystemInfoDeviceCapability::isSpeechRecognition()
864 return getValueBool("tizen.org/feature/speech.recognition");
867 bool SystemInfoDeviceCapability::isSpeechSynthesis()
870 return getValueBool("tizen.org/feature/speech.synthesis");
873 bool SystemInfoDeviceCapability::isVisionFaceRecognition()
876 return getValueBool("tizen.org/feature/vision.face_recognition");
879 bool SystemInfoDeviceCapability::isVisionImageRecognition()
882 return getValueBool("tizen.org/feature/vision.image_recognition");
885 bool SystemInfoDeviceCapability::isVisionQrcodeGeneration()
888 return getValueBool("tizen.org/feature/vision.qrcode_generation");
891 bool SystemInfoDeviceCapability::isVisionQrcodeRecognition()
894 return getValueBool("tizen.org/feature/vision.qrcode_recognition");
897 std::string SystemInfoDeviceCapability::getPlatfomCoreCpuArch()
900 std::string result = "";
901 if (getValueBool("tizen.org/feature/platform.core.cpu.arch.armv6")) {
904 if (getValueBool("tizen.org/feature/platform.core.cpu.arch.armv7")) {
905 if (!result.empty()) {
906 result += " | armv7";
911 if (getValueBool("tizen.org/feature/platform.core.cpu.arch.x86")) {
912 if (!result.empty()) {
918 if (result.empty()) {
919 LOGE("Platform error while retrieving platformCoreCpuArch: result is empty");
924 bool SystemInfoDeviceCapability::getPlatfomCoreCpuArchArmv7()
927 return getValueBool("tizen.org/feature/platform.core.cpu.arch.armv7");
930 bool SystemInfoDeviceCapability::getPlatfomCoreCpuArchArmv6()
933 return getValueBool("tizen.org/feature/platform.core.cpu.arch.armv6");
936 bool SystemInfoDeviceCapability::getPlatfomCoreCpuArchX86()
939 return getValueBool("tizen.org/feature/platform.core.cpu.arch.x86");
942 long SystemInfoDeviceCapability::getPlatformCoreCpuFrequency()
948 ret = system_info_get_value_double(SYSTEM_INFO_KEY_CORE_CPU_FREQ, &freq);
949 if (ret != SYSTEM_INFO_ERROR_NONE) {
950 LOGE("Failed to get cpu frequency, %d, %s", ret, SystemInfoUtil::getSystemInfoErrorMessage(ret).c_str());
952 LOGD("cpu frequency : %d", freq);
955 return static_cast<long>(freq);
958 std::string SystemInfoDeviceCapability::getPlatfomCoreFpuArch()
961 std::string result = "";
962 if (getValueBool("tizen.org/feature/platform.core.fpu.arch.sse2")) {
965 if (getValueBool("tizen.org/feature/platform.core.fpu.arch.sse3")) {
966 if (!result.empty()) {
972 if (getValueBool("tizen.org/feature/platform.core.fpu.arch.ssse3")) {
973 if (!result.empty()) {
974 result += " | ssse3";
979 if (getValueBool("tizen.org/feature/platform.core.fpu.arch.vfpv2")) {
980 if (!result.empty()) {
981 result += " | vfpv2";
986 if (getValueBool("tizen.org/feature/platform.core.fpu.arch.vfpv3")) {
987 if (!result.empty()) {
988 result += " | vfpv3";
993 if (result.empty()) {
994 LOGE("Platform error while retrieving platformCoreFpuArch: result is empty");
999 bool SystemInfoDeviceCapability::getPlatfomCoreFpuArchSSE2()
1002 return getValueBool("tizen.org/feature/platform.core.fpu.arch.sse2");
1005 bool SystemInfoDeviceCapability::getPlatfomCoreFpuArchSSE3()
1008 return getValueBool("tizen.org/feature/platform.core.fpu.arch.sse3");
1011 bool SystemInfoDeviceCapability::getPlatfomCoreFpuArchSSSE3()
1014 return getValueBool("tizen.org/feature/platform.core.fpu.arch.ssse3");
1017 bool SystemInfoDeviceCapability::getPlatfomCoreFpuArchVFPV2()
1020 return getValueBool("tizen.org/feature/platform.core.fpu.arch.vfpv2");
1023 bool SystemInfoDeviceCapability::getPlatfomCoreFpuArchVFPV3()
1026 return getValueBool("tizen.org/feature/platform.core.fpu.arch.vfpv3");
1029 std::string SystemInfoDeviceCapability::getWebApiVersion()
1032 return getValueString("tizen.org/feature/platform.web.api.version");
1035 std::string SystemInfoDeviceCapability::getPlatformVersionName()
1041 std::string SystemInfoDeviceCapability::getPlatformName()
1044 return getValueString("tizen.org/system/platform.name");
1047 std::string SystemInfoDeviceCapability::getProfile()
1050 return DEVICE_PROFILE;
1053 std::string SystemInfoDeviceCapability::getDuid()
1056 return getValueString("tizen.org/system/tizenid");
1059 std::string SystemInfoDeviceCapability::getPlatformVersion()
1062 return getValueString("tizen.org/feature/platform.version");
1065 std::string SystemInfoDeviceCapability::getNativeApiVersion()
1068 #ifdef PROFILE_WEARABLE
1071 return getValueString("tizen.org/feature/platform.native.api.version");
1075 std::string SystemInfoDeviceCapability::getBuildDate()
1078 return getValueString("tizen.org/system/build.date");
1081 std::string SystemInfoDeviceCapability::getBuildString()
1084 return getValueString("tizen.org/system/build.string");
1087 std::string SystemInfoDeviceCapability::getBuildTime()
1090 return getValueString("tizen.org/system/build.time");
1093 std::string SystemInfoDeviceCapability::getBuildManafacture()
1096 return getValueString("tizen.org/system/manufacturer");
1099 std::string SystemInfoDeviceCapability::getModelName()
1102 return getValueString("tizen.org/system/model_name");
1105 std::string SystemInfoDeviceCapability::getPlatformCommunicationProcessor()
1108 return getValueString("tizen.org/system/platform.communication_processor");
1111 std::string SystemInfoDeviceCapability::getPlatformProcessor()
1114 return getValueString("tizen.org/system/platform.processor");
1117 bool SystemInfoDeviceCapability::getValueBool(const char *key)
1121 int ret = system_info_get_platform_bool(key, &value);
1122 if (ret != SYSTEM_INFO_ERROR_NONE) {
1123 std::string log_msg = "Platform error while getting bool value: ";
1124 log_msg += std::string(key);
1125 LOGE("%s, %d, %s", log_msg.c_str(), ret,
1126 SystemInfoUtil::getSystemInfoErrorMessage(ret).c_str());
1127 SystemInfoUtil::throwSystemInfoException(ret, log_msg);
1130 LOGD("value[%s]: %s", key, value ? "true" : "false");
1134 int SystemInfoDeviceCapability::getValueInt(const char *key)
1138 int ret = system_info_get_platform_int(key, &value);
1139 if (ret != SYSTEM_INFO_ERROR_NONE) {
1140 std::string log_msg = "Platform error while getting int value: ";
1141 log_msg += std::string(key);
1142 LOGE("%s, %d, %s", log_msg.c_str(), ret,
1143 SystemInfoUtil::getSystemInfoErrorMessage(ret).c_str());
1144 SystemInfoUtil::throwSystemInfoException(ret, log_msg);
1147 LOGD("value[%s]: %d", key, value);
1151 std::string SystemInfoDeviceCapability::getValueString(const char *key)
1154 std::string str_value = "";
1156 int ret = system_info_get_platform_string(key, &value);
1157 if (ret == SYSTEM_INFO_ERROR_NONE) {
1158 if (value != NULL) {
1164 std::string log_msg = "Platform error while getting string value: ";
1165 log_msg += std::string(key);
1166 LOGE("%s, %d, %s", log_msg.c_str(), ret,
1167 SystemInfoUtil::getSystemInfoErrorMessage(ret).c_str());
1168 SystemInfoUtil::throwSystemInfoException(ret, log_msg);
1171 LOGD("value[%s]: %s", key, value);