From 5ad421a3d00c92c155d57af9d1a05d81cc2fa88f Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Sun, 17 Nov 2013 15:05:02 +0900 Subject: 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 --- wifi/java/android/net/wifi/WifiStateMachine.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'wifi') diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index 4bc3dda..60c7f03 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -240,24 +240,24 @@ public class WifiStateMachine extends StateMachine { } @Override - public void addressUpdated(String address, String iface, int flags, int scope) { + public void addressUpdated(LinkAddress address, String iface, int flags, int scope) { if (mWifiStateMachine.mInterfaceName.equals(iface)) { if (DBG) { log("addressUpdated: " + address + " on " + iface + " flags " + flags + " scope " + scope); } - mWifiStateMachine.sendMessage(CMD_IP_ADDRESS_UPDATED, new LinkAddress(address)); + mWifiStateMachine.sendMessage(CMD_IP_ADDRESS_UPDATED, address); } } @Override - public void addressRemoved(String address, String iface, int flags, int scope) { + public void addressRemoved(LinkAddress address, String iface, int flags, int scope) { if (mWifiStateMachine.mInterfaceName.equals(iface)) { if (DBG) { log("addressRemoved: " + address + " on " + iface + " flags " + flags + " scope " + scope); } - mWifiStateMachine.sendMessage(CMD_IP_ADDRESS_REMOVED, new LinkAddress(address)); + mWifiStateMachine.sendMessage(CMD_IP_ADDRESS_REMOVED, address); } } } -- cgit v1.1