Skip to content

Compiler Warnings as Errors - WordPress Module - Connectivity Manager & Network Info #17230

@ParaskP7

Description

@ParaskP7

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).


  • AppInitializer class:
    • The ConnectivityManager.CONNECTIVITY_ACTION solution seems to be used on onAppComesFromBackground(). This method, upon app coming from background, registers a ConnectionChangeReceiver instance with a ConnectivityManager.CONNECTIVITY_ACTION intent filter.
  • ConnectionStatusLiveData class:
    • The ConnectivityManager.CONNECTIVITY_ACTION solution seems to be used on onActive(). This method registers a networkReceiver (an instance of BroadcastReceiver) with a ConnectivityManager.CONNECTIVITY_ACTION intent filter.
  • ZendeskHelper class:
    • The NetworkInfo.type solution seems to be used on getNetworkInformation(...). This method check the network type by querying the NetworkUtils.getActiveNetworkInfo(context)?.type and adds this info as a Zendesk constant.

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:

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions