@@ -50,12 +50,23 @@ class DeviceInfoPlusTizenPlugin : public flutter::Plugin {
5050
5151 for (const auto &[key, tizen_key] : tizen_keys_) {
5252 auto response = flutter::EncodableValue ();
53- char *value = nullptr ;
54- int ret = system_info_get_platform_string (tizen_key.c_str (), &value);
55- if (ret == SYSTEM_INFO_ERROR_NONE ) {
56- response = std::string (value);
57- free (value);
53+ int ret = SYSTEM_INFO_ERROR_NONE ;
54+ if (key.compare (0 , 6 , " screen" ) == 0 ) {
55+ int value = 0 ;
56+ ret = system_info_get_platform_int (tizen_key.c_str (), &value);
57+ if (ret == SYSTEM_INFO_ERROR_NONE ) {
58+ response = value;
59+ }
5860 } else {
61+ char *value = nullptr ;
62+ ret = system_info_get_platform_string (tizen_key.c_str (), &value);
63+ if (ret == SYSTEM_INFO_ERROR_NONE ) {
64+ response = std::string (value);
65+ free (value);
66+ }
67+ }
68+
69+ if (ret != SYSTEM_INFO_ERROR_NONE ) {
5970 LOG_ERROR (" Failed to get %s from the system: %s" , tizen_key.c_str (),
6071 get_error_message (ret));
6172 }
@@ -88,6 +99,8 @@ class DeviceInfoPlusTizenPlugin : public flutter::Plugin {
8899 {" platformName" , " http://tizen.org/system/platform.name" },
89100 {" platformProcessor" , " http://tizen.org/system/platform.processor" },
90101 {" tizenId" , " http://tizen.org/system/tizenid" },
102+ {" screenWidth" , " http://tizen.org/feature/screen.width" },
103+ {" screenHeight" , " http://tizen.org/feature/screen.height" },
91104 };
92105};
93106
0 commit comments