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

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

Replace LinkCapabilities with NetworkCapabilities

Also remove unused LinkSocket and LinkSocketNotifier.
bug:13885501

Change-Id: Id426e31b201fa4f29109b5fea485d8efb34519d3
parent 6681e32f
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.net.BaseNetworkStateTracker;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.DhcpResults;
import android.net.LinkCapabilities;
import android.net.NetworkCapabilities;
import android.net.LinkProperties;
import android.net.NetworkInfo;
import android.net.NetworkInfo.DetailedState;
@@ -75,7 +75,7 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker {
    private BluetoothTetheringDataTracker() {
        mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_BLUETOOTH, 0, NETWORKTYPE, "");
        mLinkProperties = new LinkProperties();
        mLinkCapabilities = new LinkCapabilities();
        mNetworkCapabilities = new NetworkCapabilities();

        mNetworkInfo.setIsAvailable(false);
        setTeardownRequested(false);
@@ -242,16 +242,6 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker {
        }
    }

   /**
     * A capability is an Integer/String pair, the capabilities
     * are defined in the class LinkSocket#Key.
     *
     * @return a copy of this connections capabilities, may be empty but never null.
     */
    public LinkCapabilities getLinkCapabilities() {
        return new LinkCapabilities(mLinkCapabilities);
    }

    /**
     * Fetch default gateway address for the network
     */
+4 −4
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public abstract class BaseNetworkStateTracker implements NetworkStateTracker {

    protected NetworkInfo mNetworkInfo;
    protected LinkProperties mLinkProperties;
    protected LinkCapabilities mLinkCapabilities;
    protected NetworkCapabilities mNetworkCapabilities;
    protected Network mNetwork = new Network(ConnectivityManager.INVALID_NET_ID);

    private AtomicBoolean mTeardownRequested = new AtomicBoolean(false);
@@ -55,7 +55,7 @@ public abstract class BaseNetworkStateTracker implements NetworkStateTracker {
        mNetworkInfo = new NetworkInfo(
                networkType, -1, ConnectivityManager.getNetworkTypeName(networkType), null);
        mLinkProperties = new LinkProperties();
        mLinkCapabilities = new LinkCapabilities();
        mNetworkCapabilities = new NetworkCapabilities();
    }

    protected BaseNetworkStateTracker() {
@@ -99,8 +99,8 @@ public abstract class BaseNetworkStateTracker implements NetworkStateTracker {
    }

    @Override
    public LinkCapabilities getLinkCapabilities() {
        return new LinkCapabilities(mLinkCapabilities);
    public NetworkCapabilities getNetworkCapabilities() {
        return new NetworkCapabilities(mNetworkCapabilities);
    }

    @Override
+0 −7
Original line number Diff line number Diff line
@@ -190,13 +190,6 @@ public class DummyDataStateTracker extends BaseNetworkStateTracker {
        return new LinkProperties(mLinkProperties);
    }

    /**
     * @see android.net.NetworkStateTracker#getLinkCapabilities()
     */
    public LinkCapabilities getLinkCapabilities() {
        return new LinkCapabilities(mLinkCapabilities);
    }

    public void setDependencyMet(boolean met) {
        // not supported on this network
    }
+1 −11
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ public class EthernetDataTracker extends BaseNetworkStateTracker {
    private EthernetDataTracker() {
        mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_ETHERNET, 0, NETWORKTYPE, "");
        mLinkProperties = new LinkProperties();
        mLinkCapabilities = new LinkCapabilities();
        mNetworkCapabilities = new NetworkCapabilities();
    }

    private void interfaceUpdated() {
@@ -372,16 +372,6 @@ public class EthernetDataTracker extends BaseNetworkStateTracker {
        return new LinkProperties(mLinkProperties);
    }

   /**
     * A capability is an Integer/String pair, the capabilities
     * are defined in the class LinkSocket#Key.
     *
     * @return a copy of this connections capabilities, may be empty but never null.
     */
    public LinkCapabilities getLinkCapabilities() {
        return new LinkCapabilities(mLinkCapabilities);
    }

    /**
     * Fetch default gateway address for the network
     */
+0 −21
Original line number Diff line number Diff line
/*
**
** Copyright (C) 2010 The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

package android.net;

parcelable LinkCapabilities;
Loading