am e0f7bc0b: resolved conflicts for merge of dec3dda8 to honeycomb-plus-aosp
* commit 'e0f7bc0b841c0b6a09fb7d5b259a6772b3a53df3': Simplfy getActive* calls in ConnectivityService
This commit is contained in:
@@ -543,11 +543,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
* active
|
* active
|
||||||
*/
|
*/
|
||||||
public NetworkInfo getActiveNetworkInfo() {
|
public NetworkInfo getActiveNetworkInfo() {
|
||||||
enforceAccessPermission();
|
return getNetworkInfo(mActiveDefaultNetwork);
|
||||||
if (mActiveDefaultNetwork != -1) {
|
|
||||||
return mNetTrackers[mActiveDefaultNetwork].getNetworkInfo();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkInfo getNetworkInfo(int networkType) {
|
public NetworkInfo getNetworkInfo(int networkType) {
|
||||||
@@ -579,18 +575,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
* none is active
|
* none is active
|
||||||
*/
|
*/
|
||||||
public LinkProperties getActiveLinkProperties() {
|
public LinkProperties getActiveLinkProperties() {
|
||||||
enforceAccessPermission();
|
return getLinkProperties(mActiveDefaultNetwork);
|
||||||
for (int type=0; type <= ConnectivityManager.MAX_NETWORK_TYPE; type++) {
|
|
||||||
if (mNetConfigs[type] == null || !mNetConfigs[type].isDefault()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
NetworkStateTracker t = mNetTrackers[type];
|
|
||||||
NetworkInfo info = t.getNetworkInfo();
|
|
||||||
if (info.isConnected()) {
|
|
||||||
return t.getLinkProperties();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LinkProperties getLinkProperties(int networkType) {
|
public LinkProperties getLinkProperties(int networkType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user