Why does get I get -2147483648 upon calling networkCapabilities.getSignalStrength() function?

63 Views Asked by At

So I have implemented a network callback of type ConnectivityManager.NetworkCallback, and in the overridden function override fun onCapabilitiesChanged(network:android.net.Network,networkCapabilities: NetworkCapabilities), I'm calling networkCapabilities.getSignalStrength(), but it always give me -2147483648 even when I change the network strength in the android emulator for poor to great. So why is this happening and how can I get signal strength using this instance of NetworkCapabilities class, I can't use other methods of TelephonyManager of ConnectivityManager because that requires extra permission which I don't want to give

I have tried to use the app on the physical phone in hope of some positive and different result from this value, but the problem still persists

0

There are 0 best solutions below