I found this SO post apparently there are numerous bugs about that on the Android Bug Tracker which might occurs even with Locks and permissions.
In my case, I manage to make the Lock work with all the device I can test on. Not sure how you tried to implement it, so here is a version I found over internet (Sorry if I cannot find back the author).
Note: my version may slightly differs with the Java version since I am using Xamarin Android in C#, but the logic should remain the same.
First you have to add the permission for locking the Wifi
<uses-permission android:name="android.permission.WAKE_LOCK" />
Second you have to get the wifiManager
wifiManager = (WifiManager) GetSystemService(WifiService);
Then you must write code to aquire and release the lock at the proper time.
private void AquireWifiLock()
{
if (wifiLock == null)
{
wifiLock = wifiManager.CreateWifiLock(WifiMode.Full, "aTagForYourLock");
wifiLock .Acquire();
}
}
private void ReleaseWifiLock()
{
if (wifiLock == null)
{
return;
}
wifiLock .Release();
wifiLock = null;
}