Fix profile check logic to distinguish ivi and iot 00/191900/3 accepted/tizen/unified/20181107.081853 accepted/tizen/unified/20181108.074601 submit/tizen/20181105.232950 submit/tizen/20181106.081159 submit/tizen/20181108.005451
authorWootak Jung <wootak.jung@samsung.com>
Thu, 25 Oct 2018 06:14:05 +0000 (15:14 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Fri, 26 Oct 2018 00:57:25 +0000 (09:57 +0900)
Change-Id: I64f811bfe5211d4bdd22c724e3c4768d874ad426

include/bluetooth_private.h
src/bluetooth-common.c

index 10ea7a6..6969dd9 100644 (file)
@@ -1019,7 +1019,8 @@ typedef enum {
        _PROFILE_WEARABLE = 0x2,
        _PROFILE_TV = 0x4,
        _PROFILE_IVI = 0x8,
-       _PROFILE_COMMON = 0x10,
+       _PROFILE_IOT = 0x10,
+       _PROFILE_COMMON = 0x20,
 } tizen_profile_t;
 extern tizen_profile_t _get_tizen_profile();
 extern tizen_profile_t profile;
index 3e1b139..941b5ef 100644 (file)
@@ -3583,12 +3583,15 @@ static void __bt_convert_lower_to_upper(char *origin)
 tizen_profile_t profile = _PROFILE_UNKNOWN;
 tizen_profile_t _get_tizen_profile()
 {
-       char *profileName;
+       char *profileName = NULL;
 
        if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
                return profile;
 
        system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+       if (!profileName)
+               return _PROFILE_UNKNOWN;
+
        switch (*profileName) {
        case 'm':
        case 'M':
@@ -3604,7 +3607,12 @@ tizen_profile_t _get_tizen_profile()
                break;
        case 'i':
        case 'I':
-               profile = _PROFILE_IVI;
+               if (!strncasecmp(profileName, "ivi", 3))
+                       profile = _PROFILE_IVI;
+               else if (!strncasecmp(profileName, "iot", 3))
+                       profile = _PROFILE_IOT;
+               else
+                       profile = _PROFILE_COMMON;
                break;
        default: // common or unknown ==> ALL ARE COMMON.
                profile = _PROFILE_COMMON;