Use LinkAddress in address notifications.
Currently address{Updated,Removed} pass in the address as a string such as "fe80::1/64". Use LinkAddresses instead, since that's what it is. This makes the code more robust in the unlikely case that netd passes in an invalid string. In the future we can move flags and scope into the LinkAddress itself and simplify the code further. Bug: 9180552 Change-Id: I66599f9529cf421caa7676fdd0141bb110b8589e
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
package com.android.server.net;
|
||||
|
||||
import android.net.INetworkManagementEventObserver;
|
||||
import android.net.LinkAddress;
|
||||
|
||||
/**
|
||||
* Base {@link INetworkManagementEventObserver} that provides no-op
|
||||
@ -36,12 +37,12 @@ public class BaseNetworkObserver extends INetworkManagementEventObserver.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addressUpdated(String address, String iface, int flags, int scope) {
|
||||
public void addressUpdated(LinkAddress address, String iface, int flags, int scope) {
|
||||
// default no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addressRemoved(String address, String iface, int flags, int scope) {
|
||||
public void addressRemoved(LinkAddress address, String iface, int flags, int scope) {
|
||||
// default no-op
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user