diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2013-11-17 15:05:02 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2013-11-26 21:55:15 +0900 |
commit | 5ad421a3d00c92c155d57af9d1a05d81cc2fa88f (patch) | |
tree | 68626927245cd2e5bbe42cddeff69b3199465e6a /wifi | |
parent | 9d4ac9703657142b190d3c256de7c3329e5a4b29 (diff) | |
download | frameworks_base-5ad421a3d00c92c155d57af9d1a05d81cc2fa88f.zip frameworks_base-5ad421a3d00c92c155d57af9d1a05d81cc2fa88f.tar.gz frameworks_base-5ad421a3d00c92c155d57af9d1a05d81cc2fa88f.tar.bz2 |
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
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 8 |
1 files changed, 4 insertions, 4 deletions
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); } } } |