Merge "Rename LinkInfo to LinkQualityInfo" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
77dc937242
@@ -1426,9 +1426,9 @@ public class ConnectivityManager {
|
|||||||
* get the information about a specific network link
|
* get the information about a specific network link
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public LinkInfo getLinkInfo(int networkType) {
|
public LinkQualityInfo getLinkQualityInfo(int networkType) {
|
||||||
try {
|
try {
|
||||||
LinkInfo li = mService.getLinkInfo(networkType);
|
LinkQualityInfo li = mService.getLinkQualityInfo(networkType);
|
||||||
return li;
|
return li;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1439,9 +1439,9 @@ public class ConnectivityManager {
|
|||||||
* get the information of currently active network link
|
* get the information of currently active network link
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public LinkInfo getActiveLinkInfo() {
|
public LinkQualityInfo getActiveLinkQualityInfo() {
|
||||||
try {
|
try {
|
||||||
LinkInfo li = mService.getActiveLinkInfo();
|
LinkQualityInfo li = mService.getActiveLinkQualityInfo();
|
||||||
return li;
|
return li;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1452,9 +1452,9 @@ public class ConnectivityManager {
|
|||||||
* get the information of all network links
|
* get the information of all network links
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public LinkInfo[] getAllLinkInfo() {
|
public LinkQualityInfo[] getAllLinkQualityInfo() {
|
||||||
try {
|
try {
|
||||||
LinkInfo[] li = mService.getAllLinkInfo();
|
LinkQualityInfo[] li = mService.getAllLinkQualityInfo();
|
||||||
return li;
|
return li;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import android.net.LinkInfo;
|
import android.net.LinkQualityInfo;
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.NetworkQuotaInfo;
|
import android.net.NetworkQuotaInfo;
|
||||||
@@ -149,11 +149,11 @@ interface IConnectivityManager
|
|||||||
|
|
||||||
String getMobileRedirectedProvisioningUrl();
|
String getMobileRedirectedProvisioningUrl();
|
||||||
|
|
||||||
LinkInfo getLinkInfo(int networkType);
|
LinkQualityInfo getLinkQualityInfo(int networkType);
|
||||||
|
|
||||||
LinkInfo getActiveLinkInfo();
|
LinkQualityInfo getActiveLinkQualityInfo();
|
||||||
|
|
||||||
LinkInfo[] getAllLinkInfo();
|
LinkQualityInfo[] getAllLinkQualityInfo();
|
||||||
|
|
||||||
void setProvisioningNotificationVisible(boolean visible, int networkType, in String extraInfo, in String url);
|
void setProvisioningNotificationVisible(boolean visible, int networkType, in String extraInfo, in String url);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import android.net.INetworkPolicyManager;
|
|||||||
import android.net.INetworkStatsService;
|
import android.net.INetworkStatsService;
|
||||||
import android.net.LinkAddress;
|
import android.net.LinkAddress;
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
import android.net.LinkInfo;
|
import android.net.LinkQualityInfo;
|
||||||
import android.net.LinkProperties.CompareResult;
|
import android.net.LinkProperties.CompareResult;
|
||||||
import android.net.MobileDataStateTracker;
|
import android.net.MobileDataStateTracker;
|
||||||
import android.net.NetworkConfig;
|
import android.net.NetworkConfig;
|
||||||
@@ -4689,39 +4689,39 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LinkInfo getLinkInfo(int networkType) {
|
public LinkQualityInfo getLinkQualityInfo(int networkType) {
|
||||||
enforceAccessPermission();
|
enforceAccessPermission();
|
||||||
if (isNetworkTypeValid(networkType)) {
|
if (isNetworkTypeValid(networkType)) {
|
||||||
return mNetTrackers[networkType].getLinkInfo();
|
return mNetTrackers[networkType].getLinkQualityInfo();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LinkInfo getActiveLinkInfo() {
|
public LinkQualityInfo getActiveLinkQualityInfo() {
|
||||||
enforceAccessPermission();
|
enforceAccessPermission();
|
||||||
if (isNetworkTypeValid(mActiveDefaultNetwork)) {
|
if (isNetworkTypeValid(mActiveDefaultNetwork)) {
|
||||||
return mNetTrackers[mActiveDefaultNetwork].getLinkInfo();
|
return mNetTrackers[mActiveDefaultNetwork].getLinkQualityInfo();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LinkInfo[] getAllLinkInfo() {
|
public LinkQualityInfo[] getAllLinkQualityInfo() {
|
||||||
enforceAccessPermission();
|
enforceAccessPermission();
|
||||||
final ArrayList<LinkInfo> result = Lists.newArrayList();
|
final ArrayList<LinkQualityInfo> result = Lists.newArrayList();
|
||||||
for (NetworkStateTracker tracker : mNetTrackers) {
|
for (NetworkStateTracker tracker : mNetTrackers) {
|
||||||
if (tracker != null) {
|
if (tracker != null) {
|
||||||
LinkInfo li = tracker.getLinkInfo();
|
LinkQualityInfo li = tracker.getLinkQualityInfo();
|
||||||
if (li != null) {
|
if (li != null) {
|
||||||
result.add(li);
|
result.add(li);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.toArray(new LinkInfo[result.size()]);
|
return result.toArray(new LinkQualityInfo[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Infrastructure for network sampling */
|
/* Infrastructure for network sampling */
|
||||||
|
|||||||
Reference in New Issue
Block a user