Merge "Delete unused/non-working code." into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
04f46a029e
@@ -1920,45 +1920,6 @@ public class ConnectivityManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the information about a specific network link
|
||||
* @hide
|
||||
*/
|
||||
public LinkQualityInfo getLinkQualityInfo(int networkType) {
|
||||
try {
|
||||
LinkQualityInfo li = mService.getLinkQualityInfo(networkType);
|
||||
return li;
|
||||
} catch (RemoteException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the information of currently active network link
|
||||
* @hide
|
||||
*/
|
||||
public LinkQualityInfo getActiveLinkQualityInfo() {
|
||||
try {
|
||||
LinkQualityInfo li = mService.getActiveLinkQualityInfo();
|
||||
return li;
|
||||
} catch (RemoteException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the information of all network links
|
||||
* @hide
|
||||
*/
|
||||
public LinkQualityInfo[] getAllLinkQualityInfo() {
|
||||
try {
|
||||
LinkQualityInfo[] li = mService.getAllLinkQualityInfo();
|
||||
return li;
|
||||
} catch (RemoteException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set sign in error notification to visible or in visible
|
||||
*
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package android.net;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.net.LinkQualityInfo;
|
||||
import android.net.LinkProperties;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkCapabilities;
|
||||
@@ -133,12 +132,6 @@ interface IConnectivityManager
|
||||
|
||||
String getMobileRedirectedProvisioningUrl();
|
||||
|
||||
LinkQualityInfo getLinkQualityInfo(int networkType);
|
||||
|
||||
LinkQualityInfo getActiveLinkQualityInfo();
|
||||
|
||||
LinkQualityInfo[] getAllLinkQualityInfo();
|
||||
|
||||
void setProvisioningNotificationVisible(boolean visible, int networkType, in String action);
|
||||
|
||||
void setAirplaneMode(boolean enable);
|
||||
|
||||
@@ -65,7 +65,6 @@ import android.net.INetworkStatsService;
|
||||
import android.net.LinkAddress;
|
||||
import android.net.LinkProperties;
|
||||
import android.net.LinkProperties.CompareResult;
|
||||
import android.net.LinkQualityInfo;
|
||||
import android.net.MobileDataStateTracker;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkAgent;
|
||||
@@ -256,7 +255,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
|
||||
private Context mContext;
|
||||
private int mNetworkPreference;
|
||||
private int mActiveDefaultNetwork = TYPE_NONE;
|
||||
// 0 is full bad, 100 is full good
|
||||
private int mDefaultInetConditionPublished = 0;
|
||||
|
||||
@@ -1783,16 +1781,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
pw.println();
|
||||
pw.decreaseIndent();
|
||||
|
||||
pw.print("mActiveDefaultNetwork: " + mActiveDefaultNetwork);
|
||||
if (mActiveDefaultNetwork != TYPE_NONE) {
|
||||
NetworkInfo activeNetworkInfo = getActiveNetworkInfo();
|
||||
if (activeNetworkInfo != null) {
|
||||
pw.print(" " + activeNetworkInfo.getState() +
|
||||
"/" + activeNetworkInfo.getDetailedState());
|
||||
}
|
||||
}
|
||||
pw.println();
|
||||
|
||||
pw.println("mLegacyTypeTracker:");
|
||||
pw.increaseIndent();
|
||||
mLegacyTypeTracker.dump(pw);
|
||||
@@ -2159,7 +2147,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
if (nai.networkRequests.get(mDefaultRequest.requestId) != null) {
|
||||
removeDataActivityTracking(nai);
|
||||
mActiveDefaultNetwork = ConnectivityManager.TYPE_NONE;
|
||||
notifyLockdownVpn(nai);
|
||||
requestNetworkTransitionWakelock(nai.name());
|
||||
}
|
||||
@@ -2781,42 +2768,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
Slog.e(TAG, s);
|
||||
}
|
||||
|
||||
int convertFeatureToNetworkType(int networkType, String feature) {
|
||||
int usedNetworkType = networkType;
|
||||
|
||||
if(networkType == ConnectivityManager.TYPE_MOBILE) {
|
||||
if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_MMS)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_MMS;
|
||||
} else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_SUPL)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_SUPL;
|
||||
} else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_DUN) ||
|
||||
TextUtils.equals(feature, Phone.FEATURE_ENABLE_DUN_ALWAYS)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_DUN;
|
||||
} else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_HIPRI)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_HIPRI;
|
||||
} else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_FOTA)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_FOTA;
|
||||
} else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_IMS)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_IMS;
|
||||
} else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_CBS)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_CBS;
|
||||
} else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_EMERGENCY)) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_MOBILE_EMERGENCY;
|
||||
} else {
|
||||
Slog.e(TAG, "Can't match any mobile netTracker!");
|
||||
}
|
||||
} else if (networkType == ConnectivityManager.TYPE_WIFI) {
|
||||
if (TextUtils.equals(feature, "p2p")) {
|
||||
usedNetworkType = ConnectivityManager.TYPE_WIFI_P2P;
|
||||
} else {
|
||||
Slog.e(TAG, "Can't match any wifi netTracker!");
|
||||
}
|
||||
} else {
|
||||
Slog.e(TAG, "Unexpected network type");
|
||||
}
|
||||
return usedNetworkType;
|
||||
}
|
||||
|
||||
private static <T> T checkNotNull(T value, String message) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException(message);
|
||||
@@ -3302,43 +3253,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public LinkQualityInfo getLinkQualityInfo(int networkType) {
|
||||
enforceAccessPermission();
|
||||
if (isNetworkTypeValid(networkType) && mNetTrackers[networkType] != null) {
|
||||
return mNetTrackers[networkType].getLinkQualityInfo();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkQualityInfo getActiveLinkQualityInfo() {
|
||||
enforceAccessPermission();
|
||||
if (isNetworkTypeValid(mActiveDefaultNetwork) &&
|
||||
mNetTrackers[mActiveDefaultNetwork] != null) {
|
||||
return mNetTrackers[mActiveDefaultNetwork].getLinkQualityInfo();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkQualityInfo[] getAllLinkQualityInfo() {
|
||||
enforceAccessPermission();
|
||||
final ArrayList<LinkQualityInfo> result = Lists.newArrayList();
|
||||
for (NetworkStateTracker tracker : mNetTrackers) {
|
||||
if (tracker != null) {
|
||||
LinkQualityInfo li = tracker.getLinkQualityInfo();
|
||||
if (li != null) {
|
||||
result.add(li);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result.toArray(new LinkQualityInfo[result.size()]);
|
||||
}
|
||||
|
||||
/* Infrastructure for network sampling */
|
||||
|
||||
private void handleNetworkSamplingTimeout() {
|
||||
@@ -3942,7 +3856,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
|
||||
private void makeDefault(NetworkAgentInfo newNetwork) {
|
||||
if (DBG) log("Switching to new default network: " + newNetwork);
|
||||
mActiveDefaultNetwork = newNetwork.networkInfo.getType();
|
||||
setupDataActivityTracking(newNetwork);
|
||||
try {
|
||||
mNetd.setDefaultNetId(newNetwork.network.netId);
|
||||
@@ -4047,7 +3960,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
if (mDefaultRequest.requestId == nri.request.requestId) {
|
||||
isNewDefault = true;
|
||||
// TODO: Remove following line. It's redundant with makeDefault call.
|
||||
mActiveDefaultNetwork = newNetwork.networkInfo.getType();
|
||||
if (newNetwork.linkProperties != null) {
|
||||
updateTcpBufferSizes(newNetwork);
|
||||
setDefaultDnsSystemProperties(
|
||||
|
||||
Reference in New Issue
Block a user