Delete unused/non-working code.
Change-Id: I2cba9ffdb4ed547cb922d0ac08abf81e49ffa66b
This commit is contained in:
@@ -1920,45 +1920,6 @@ public class ConnectivityManager {
|
|||||||
return null;
|
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
|
* Set sign in error notification to visible or in visible
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.net.LinkQualityInfo;
|
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
import android.net.Network;
|
import android.net.Network;
|
||||||
import android.net.NetworkCapabilities;
|
import android.net.NetworkCapabilities;
|
||||||
@@ -133,12 +132,6 @@ interface IConnectivityManager
|
|||||||
|
|
||||||
String getMobileRedirectedProvisioningUrl();
|
String getMobileRedirectedProvisioningUrl();
|
||||||
|
|
||||||
LinkQualityInfo getLinkQualityInfo(int networkType);
|
|
||||||
|
|
||||||
LinkQualityInfo getActiveLinkQualityInfo();
|
|
||||||
|
|
||||||
LinkQualityInfo[] getAllLinkQualityInfo();
|
|
||||||
|
|
||||||
void setProvisioningNotificationVisible(boolean visible, int networkType, in String action);
|
void setProvisioningNotificationVisible(boolean visible, int networkType, in String action);
|
||||||
|
|
||||||
void setAirplaneMode(boolean enable);
|
void setAirplaneMode(boolean enable);
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ import android.net.INetworkStatsService;
|
|||||||
import android.net.LinkAddress;
|
import android.net.LinkAddress;
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
import android.net.LinkProperties.CompareResult;
|
import android.net.LinkProperties.CompareResult;
|
||||||
import android.net.LinkQualityInfo;
|
|
||||||
import android.net.MobileDataStateTracker;
|
import android.net.MobileDataStateTracker;
|
||||||
import android.net.Network;
|
import android.net.Network;
|
||||||
import android.net.NetworkAgent;
|
import android.net.NetworkAgent;
|
||||||
@@ -256,7 +255,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private int mNetworkPreference;
|
private int mNetworkPreference;
|
||||||
private int mActiveDefaultNetwork = TYPE_NONE;
|
|
||||||
// 0 is full bad, 100 is full good
|
// 0 is full bad, 100 is full good
|
||||||
private int mDefaultInetConditionPublished = 0;
|
private int mDefaultInetConditionPublished = 0;
|
||||||
|
|
||||||
@@ -1760,16 +1758,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
pw.println();
|
pw.println();
|
||||||
pw.decreaseIndent();
|
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.println("mLegacyTypeTracker:");
|
||||||
pw.increaseIndent();
|
pw.increaseIndent();
|
||||||
mLegacyTypeTracker.dump(pw);
|
mLegacyTypeTracker.dump(pw);
|
||||||
@@ -2136,7 +2124,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
if (nai.networkRequests.get(mDefaultRequest.requestId) != null) {
|
if (nai.networkRequests.get(mDefaultRequest.requestId) != null) {
|
||||||
removeDataActivityTracking(nai);
|
removeDataActivityTracking(nai);
|
||||||
mActiveDefaultNetwork = ConnectivityManager.TYPE_NONE;
|
|
||||||
notifyLockdownVpn(nai);
|
notifyLockdownVpn(nai);
|
||||||
requestNetworkTransitionWakelock(nai.name());
|
requestNetworkTransitionWakelock(nai.name());
|
||||||
}
|
}
|
||||||
@@ -2758,42 +2745,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
Slog.e(TAG, s);
|
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) {
|
private static <T> T checkNotNull(T value, String message) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw new NullPointerException(message);
|
throw new NullPointerException(message);
|
||||||
@@ -3279,43 +3230,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 */
|
/* Infrastructure for network sampling */
|
||||||
|
|
||||||
private void handleNetworkSamplingTimeout() {
|
private void handleNetworkSamplingTimeout() {
|
||||||
@@ -3919,7 +3833,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
|
|
||||||
private void makeDefault(NetworkAgentInfo newNetwork) {
|
private void makeDefault(NetworkAgentInfo newNetwork) {
|
||||||
if (DBG) log("Switching to new default network: " + newNetwork);
|
if (DBG) log("Switching to new default network: " + newNetwork);
|
||||||
mActiveDefaultNetwork = newNetwork.networkInfo.getType();
|
|
||||||
setupDataActivityTracking(newNetwork);
|
setupDataActivityTracking(newNetwork);
|
||||||
try {
|
try {
|
||||||
mNetd.setDefaultNetId(newNetwork.network.netId);
|
mNetd.setDefaultNetId(newNetwork.network.netId);
|
||||||
@@ -4024,7 +3937,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
if (mDefaultRequest.requestId == nri.request.requestId) {
|
if (mDefaultRequest.requestId == nri.request.requestId) {
|
||||||
isNewDefault = true;
|
isNewDefault = true;
|
||||||
// TODO: Remove following line. It's redundant with makeDefault call.
|
// TODO: Remove following line. It's redundant with makeDefault call.
|
||||||
mActiveDefaultNetwork = newNetwork.networkInfo.getType();
|
|
||||||
if (newNetwork.linkProperties != null) {
|
if (newNetwork.linkProperties != null) {
|
||||||
updateTcpBufferSizes(newNetwork);
|
updateTcpBufferSizes(newNetwork);
|
||||||
setDefaultDnsSystemProperties(
|
setDefaultDnsSystemProperties(
|
||||||
|
|||||||
Reference in New Issue
Block a user