Network
Energy Efficiency,User Conformity,User Experience
It is not checked if the user has disabled background data transmission before transmitting.
Energy Efficiency,User Conformity
ConnectivityManager mConnectivity;
TelephonyManager mTelephony;
// Skip if no connection, or background data disabled
NetworkInfo info = mConnectivity.getActiveNetworkInfo();
if (info == null || !mConnectivity.getBackgroundDataSetting()) {
return false;
}
From Developer Documentation:
This method was deprecated in API level 14. As of ICE_CREAM_SANDWICH, availability of background data depends on several combined factors, and this method will always return true. Instead, when background data is unavailable, getActiveNetworkInfo() will now appear disconnected.
ConnectivityManager.html