Unable to connect to the Wi-Fi when App is running under Work profile on Samsung device having Android 10

677 views Asked by At

We have one internal Android application that we are deploying through intune on the Work Profile side. When the App is running on Samsung Device with Android 10 then in that case we are not able to connect to the intended Wi-Fi however when the same app is installed on a Personal Profile, we are able to connect to the Wi-Fi. Strange this is that when we tested this on a Samsung device running on Android 9 and in that it worked on both personal and work profile side without any issue.

As Samsung has not officially rolled out Android 11 we were not able to test it but we did test this on Pixel device with Android 11 and in that also it's working fine on the Work profile side.

Below is the code that we are using for Wi-Fi connectivity:

public bool EnableWifi(string ssid, string password)
        {
            WifiConfiguration wifiConfig = new WifiConfiguration
            {
                Ssid = string.Format("\"{0}\"", ssid),
            };


            wifiConfig.PreSharedKey = string.Format("\"{0}\"", password);

            WifiManager wifiManager = (WifiManager)Application.Context.GetSystemService(Context.WifiService);

            wifiManager.SetWifiEnabled(true);

            netId = wifiManager.AddNetwork(wifiConfig);

            wifiManager.DisableNetwork(netId);

            var result = wifiManager.EnableNetwork(netId, true);

            wifiManager.Reconnect();

            return result;
        }
0

There are 0 answers