2 * Copyright (c) 2016 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.ComponentModel;
21 namespace Tizen.System
23 [EditorBrowsable(EditorBrowsableState.Never)]
24 internal static class TvProductHelper
26 private static int is_TV_product = -1;
28 private static readonly Dictionary<RuntimeInfoKey, int> s_keyTVkeyMapping = new Dictionary<RuntimeInfoKey, int>
30 [RuntimeInfoKey.Bluetooth] = 5,
31 [RuntimeInfoKey.WifiHotspot] = 6,
32 [RuntimeInfoKey.BluetoothTethering] = 7,
33 [RuntimeInfoKey.UsbTethering] = 8,
34 [RuntimeInfoKey.PacketData] = 13,
35 [RuntimeInfoKey.DataRoaming] = 14,
36 [RuntimeInfoKey.Vibration] = 16,
37 [RuntimeInfoKey.AudioJack] = 20,
38 [RuntimeInfoKey.BatteryIsCharging] = 22,
39 [RuntimeInfoKey.TvOut] = 18,
40 [RuntimeInfoKey.Charger] = 26,
41 [RuntimeInfoKey.AutoRotation] = 28,
42 [RuntimeInfoKey.Gps] = 21,
43 [RuntimeInfoKey.AudioJackConnector] = 20
46 /// This function is for a TV product. It will be removed.
47 internal static RuntimeInfoKey ConvertKeyIfTvProduct(RuntimeInfoKey key)
49 bool is_key_existed = false;
53 if (is_TV_product == -1)
55 is_key_existed = SystemInfo.TryGetValue<string>("http://com.samsung/build_config/product_type", out profile);
56 if (is_key_existed && String.Compare(profile, "TV") == 0)
66 if (is_TV_product == 0)
72 if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV))
74 InformationErrorFactory.ThrowException(InformationError.InvalidParameter);
76 return (RuntimeInfoKey)key_TV;