-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Compiler Warnings as Errors - WordPress Module - Connectivity Manager & Network Info #17230
Copy link
Copy link
Closed
Closed
Copy link
Description
Parent #17173
This issue is about resolving the ConnectivityManager and NetworkInfo compile warning for the WordPress module.
PS: Some of those warnings are already deprecated (see here).
AppInitializerclass:- The
ConnectivityManager.CONNECTIVITY_ACTIONsolution seems to be used ononAppComesFromBackground(). This method, upon app coming from background, registers aConnectionChangeReceiverinstance with aConnectivityManager.CONNECTIVITY_ACTIONintent filter.
- The
ConnectionStatusLiveDataclass:- The
ConnectivityManager.CONNECTIVITY_ACTIONsolution seems to be used ononActive(). This method registers anetworkReceiver(an instance ofBroadcastReceiver) with aConnectivityManager.CONNECTIVITY_ACTIONintent filter.
- The
ZendeskHelperclass:- The
NetworkInfo.typesolution seems to be used ongetNetworkInformation(...). This method check the network type by querying theNetworkUtils.getActiveNetworkInfo(context)?.typeand adds this info as a Zendesk constant.
- The
As such, the above register receiver related functionality should be migrated to the requestNetwork(...) related functions for faster and more detailed updates about the network changes. Also, the network info related functionality should be migrated to the NetworkCapabilities as they offer this information with much better accuracy.
For more info see:
Reactions are currently unavailable