--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "common/utils/profile_util.h"
+
+#include <system_info.h>
+
+#include <cstdlib>
+#include <string>
+
+namespace common_installer {
+
+TizenProfile GetTizenProfile() {
+ static TizenProfile profile = TizenProfile::UNKNOWN;
+ char* profileName;
+
+ if (__builtin_expect(profile != TizenProfile::UNKNOWN, 1))
+ return profile;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile",
+ &profileName);
+ switch (*profileName) {
+ case 'm':
+ case 'M':
+ profile = TizenProfile::MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = TizenProfile::WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = TizenProfile::TV;
+ break;
+ case 'i':
+ case 'I':
+ profile = TizenProfile::IVI;
+ break;
+ default:
+ profile = TizenProfile::COMMON;
+ break;
+ }
+ free(profileName);
+
+ return profile;
+}
+
+} // namespace common_installer
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_UTILS_PROFILE_UTIL_H_
+#define COMMON_UTILS_PROFILE_UTIL_H_
+
+namespace common_installer {
+
+enum class TizenProfile {
+ UNKNOWN = 0,
+ MOBILE = 0x1,
+ WEARABLE = 0x2,
+ TV = 0x4,
+ IVI = 0x8,
+ COMMON = 0x10,
+};
+
+TizenProfile GetTizenProfile();
+
+} // namespace common_installer
+
+#endif // COMMON_UTILS_PROFILE_UTIL_H_