Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59911589 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Simplfy getActive* calls in ConnectivityService

One had been simplified on GB, but somehow it didn't make it here.
bug: 4463770

Change-Id: Ica51e836b1a7a489526a223168910b8e06c99c2b
parent dbfd055d
Loading
Loading
Loading
Loading
+2 −27
Original line number Diff line number Diff line
@@ -540,21 +540,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
     * active
     */
    public NetworkInfo getActiveNetworkInfo() {
        enforceAccessPermission();
        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()) {
                if (DBG && type != mActiveDefaultNetwork) {
                    loge("connected default network is not mActiveDefaultNetwork!");
                }
                return info;
            }
        }
        return null;
        return getNetworkInfo(mActiveDefaultNetwork);
    }

    public NetworkInfo getNetworkInfo(int networkType) {
@@ -586,18 +572,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
     * none is active
     */
    public LinkProperties getActiveLinkProperties() {
        enforceAccessPermission();
        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;
        return getLinkProperties(mActiveDefaultNetwork);
    }

    public LinkProperties getLinkProperties(int networkType) {