The problem is as follows. I have a working SyncAdapter and ContentResolver setup. The problem that SyncAdapters onPerformSync is not triggered happens when I have wifi turned on but the wifi does not have an internet connection (it is connected to an IOT device). I have a sim card and cellular data is available. In the app I have NetworkManager set so I request cellular data like so:

val req = NetworkRequest.Builder()
req.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
req.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)

And if I create an API request instead of triggering ContentResolver.requestSync it works normally.

This code also works normally on a Huawei tablet but not on Samsung.

So basically. I have cellular internet but SyncAdapter does not realise this(on Samsung device) and does not trigger onPerformSync. Anyway to make SyncAdapter realise this?

0

There are 0 best solutions below