From e10f7f44efde73fa0bc75c6b26a954ccd4be62a2 Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Thu, 25 Oct 2018 15:14:05 +0900 Subject: [PATCH] Fix profile check logic to distinguish ivi and iot Change-Id: I64f811bfe5211d4bdd22c724e3c4768d874ad426 --- include/bluetooth_private.h | 3 ++- src/bluetooth-common.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/bluetooth_private.h b/include/bluetooth_private.h index 10ea7a6..6969dd9 100644 --- a/include/bluetooth_private.h +++ b/include/bluetooth_private.h @@ -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; diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 3e1b139..941b5ef 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -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; -- 2.7.4