ThanosFisherman/WifiUtils

Constant disconnect on OnePlus devices

gadget-man opened this issue · 17 comments

I'm using the latest WifiUtils and it works OK on most devices, but whenever we try it on OnePlus on Android 10 the connection to the new WiFi network drops and gets stuck in a loop.

I've attached a video showing the behaviour on OnePlus8:
https://drive.google.com/open?id=1-vP8LR-rMQcaWBRugKhmPMZ8R2C-OabD

All I get in the logs when the 'Device to use with iParcelBox' pops up is the following:
D/WifiUtils: WifiUtils: AndroidQ+ connected to wifi V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 152 V/FA: Activity paused, time: 83058133 D/ViewRootImpl[MainActivity]: windowFocusChanged hasFocus=false inTouchMode=true D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@527918c[MainActivity]

me too

I'm wondering whether this is somehow linked to the below, which I can't see implemented in WifiUtils anywhere (if it's even relevant)
https://developer.android.com/guide/topics/connectivity/wifi-suggest

I will have to look into it. The annoying thing is that Wifi behavior differs across different devices and since I do not own an OnePlus to test it I will have to guess and generally code in blind.

I think it may be an issue with OxygenOS on OnePlus Devices:
https://issuetracker.google.com/issues/143549613

I am having the same issue and also looking into it.

I'm wondering whether this is somehow linked to the below, which I can't see implemented in WifiUtils anywhere (if it's even relevant)
https://developer.android.com/guide/topics/connectivity/wifi-suggest

At the moment this api is not used. For android 10 there are 2 approaches. A new api to temporary connect to a wifi access point (setup of IoT devices) and this suggestion api.

My use case it temporary connection to an IoT device for provisioning purposes. It works on most devices, just not OnePlus. I did manage to do something on one device and it started working fine (no idea what!), but after a factory reset, the device reverted to the error state originally described above. I've submitted a bug report to OnePlus and google as it seems to be on their side rather than @ThanosFisherman

If you can link your bug reports pls do. I am also using this library for IoT provisioning. Do notice there is an issue with 1.5.1 & android 10. Better use 1.5.0 or the next release (#66).

Sure:
https://issuetracker.google.com/issues/143549613
https://forums.oneplus.com/threads/wifinetworkspecifier-immediately-drops-connection.1219734/

I'm using 1.6.0
Note your comment about bindProcess being required - I'd prefer that this wasn't in the library - it's useful when you connect to the iOT device, but after provisioning is complete and you want to reconnect to the original wifi network, you don't want to necessarily bind to that network. I therefore call a seperate bind process function outside the lib and only bind if and when I'm connecting to the IoT AP. Perhaps it could be included with an optional flag?

How do you disconnect from the IoT device? Or does it terminate by itself?

For IoT device I understand that it's required, but it also isn't possible to do api calls if the AP does have internet connectivity. By disconnecting via the library it should remove the bind.

My IoT device does a reboot, so the connection get terminated.

@gadget-man did you solve the problem?. I am facing with same problem in your video. I am using OnePlus7 Pro device.

No, it appears that it is a bug in either OxygenOS or Android 10. It affects all OnePlus devices, and possibly also Samsung S7 edge (we're trying to verify). I've raised a bug report on both Android and OnePlus and have provided logs etc, but still waiting for resolution.

I'm hoping 10.3.3 Oxygen OS silently fixes this, but I won't hold my breath. Has anyone tried this issue against the latest stable release?

I'm on 10.5.6.IN21BA and it's still an issue.

Good to know, thanks.

This is fixed on OxygenOS starting 10.5.7.IN21BA (Oneplus 8).