merge with master
[framework/osp/net.git] / src / wifi / FNetWifiWifiManager.cpp
index 81305cc..e5ee7a8 100644 (file)
@@ -6,7 +6,7 @@
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-// http://www.apache.org/licenses/LICENSE-2.0
+//     http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 #include <FNetWifiWifiBssInfo.h>
 #include <FNetWifiWifiManager.h>
 #include <FSec_AccessController.h>
+#include "FSys_SystemInfoImpl.h"
 #include "FNetWifi_WifiManagerImpl.h"
 
+static const wchar_t* _WIFI_FEATURE_INFO_KEY = L"http://tizen.org/feature/network.wifi";
+
 using namespace std;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Runtime;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Security;
+using namespace Tizen::System;
 
 namespace Tizen { namespace Net { namespace Wifi {
 
@@ -53,6 +57,11 @@ WifiManager::Construct(IWifiManagerEventListener& listener)
 {
        result r = E_SUCCESS;
 
+       bool isWifiSupported = false;
+       r = _SystemInfoImpl::GetSysInfo(_WIFI_FEATURE_INFO_KEY, isWifiSupported);
+
+       SysTryReturnResult(NID_NET_WIFI, r == E_SUCCESS && isWifiSupported == true, E_UNSUPPORTED_OPERATION, "Wi-Fi is not supported.");
+
        SysAssertf(__pWifiManagerImpl == null,
                                "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");