Use BaseNetworkObserver in Tethering.

Tethering currently inherits from the AIDL interface
INetworkManagementEventObserver, so it has to provide no-op
implementations of all the interface's methods. Inherit from
BaseNetworkObserver and get rid of the no-ops.

[Cherry-pick of f4e90eac87]

Bug: 9180552
Change-Id: I74859b0d77951005651aaaa418185857e40eeedb
This commit is contained in:
Lorenzo Colitti
2013-10-31 23:30:47 +09:00
parent dbccd44a63
commit 132fe8d27d

View File

@@ -51,6 +51,7 @@ import com.android.internal.util.IState;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import com.android.server.IoThread;
import com.android.server.net.BaseNetworkObserver;
import com.google.android.collect.Lists;
import java.io.FileDescriptor;
@@ -70,7 +71,7 @@ import java.util.Set;
*
* TODO - look for parent classes and code sharing
*/
public class Tethering extends INetworkManagementEventObserver.Stub {
public class Tethering extends BaseNetworkObserver {
private Context mContext;
private final static String TAG = "Tethering";
@@ -315,14 +316,6 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
}
}
public void addressUpdated(String address, String iface, int flags, int scope) {}
public void addressRemoved(String address, String iface, int flags, int scope) {}
public void limitReached(String limitName, String iface) {}
public void interfaceClassDataActivityChanged(String label, boolean active) {}
public int tether(String iface) {
if (DBG) Log.d(TAG, "Tethering " + iface);
TetherInterfaceSM sm = null;