frameworks/base
Revision | 1f776b4099e560c9de207f90352e237e9763a773 (tree) |
---|---|
Zeit | 2015-12-22 13:13:53 |
Autor | Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tiet...> |
Commiter | Chih-Wei Huang |
Fix Bluetooth tethering
Ignore linkstate down events for bt-pan interface which cause its
remove. Interface should only be removed when we receive the interface
remove event.
At connect init to bluetooth PAN service, bridge pan device adds
tetherable bt-pan interface as set in bluetooth regexs. Before bt-pan
interface gets tethered, multiple linkstate events are received by
linkstate change notifier.
Receiving multiple time of linkstate down may cause remove of tetherable
interface (bt-pan), before we call tether method. Finally when tethering
method is called and bt-pan tether interface is removed, error is
returned because of not available tetherable interfaces.
Bug found during bluetooth PTS PAN testing. It affects multiple test
cases.
Change-Id: Ifb0d16657ca238aa62064fee0fc4ee974a2518ad
@@ -240,6 +240,10 @@ public class Tethering extends BaseNetworkObserver { | ||
240 | 240 | // ignore usb0 down after enabling RNDIS |
241 | 241 | // we will handle disconnect in interfaceRemoved instead |
242 | 242 | if (VDBG) Log.d(TAG, "ignore interface down for " + iface); |
243 | + } else if (isBluetooth(iface)) { | |
244 | + // ignore interface down for bt liskstate change | |
245 | + // disconnect will only be handled in interfaceRemoved | |
246 | + if (VDBG) Log.d(TAG, "ignore interface down for " + iface); | |
243 | 247 | } else if (sm != null) { |
244 | 248 | sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN); |
245 | 249 | mIfaces.remove(iface); |