From: chleun.moon Date: Wed, 1 Nov 2017 06:37:59 +0000 (+0900) Subject: [Connection] ConnectionProfileManager.GetCurrentProfile() returns null if there is... X-Git-Tag: 5.0.0-preview1-00358~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F60%2F158460%2F1;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Connection] ConnectionProfileManager.GetCurrentProfile() returns null if there is no connection Change-Id: I419dac066d97c634d2184b677e9845f8266b794a Signed-off-by: Cheoleun Moon --- diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs index 2725077..56f6290 100755 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs +++ b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs @@ -766,11 +766,19 @@ namespace Tizen.Network.Connection int ret = Interop.Connection.GetCurrentProfile(GetHandle(), out ProfileHandle); if ((ConnectionError)ret != ConnectionError.None) { - Log.Error(Globals.LogTag, "It failed to get current profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); + if ((ConnectionError)ret == ConnectionError.NoConnection) + { + Log.Error(Globals.LogTag, "No connection " + (ConnectionError)ret); + return null; + } + else + { + Log.Error(Globals.LogTag, "It failed to get current profile, " + (ConnectionError)ret); + ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); + ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); + ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); + ConnectionErrorFactory.ThrowConnectionException(ret); + } } ConnectionProfile Profile = new ConnectionProfile(ProfileHandle);