Fix LocalOnlyHotspotReservation double stop of local hotspot.
If user executed startLocalOnlyHotspot(), then reservation.close() garbage collector still keeps reservation object until drain. If user executed startLocalOnlyHotspot second time during application life cycle, garbage collector can delete previously allocated reservation object. In this case finalize() of old reservation object will be executed, then close(), then stopLocalOnlyHotspot(). As result, new started LocalOnlyHostpot can be immediatly stopped by old reservation object delete. Steps to reproduce: execute startLocalOnlyHostpot() and reservation.close() multiple times during application life cycle, check if hotspot up couple of seconds after start. This fix prevents stopping of local hotspot if reservation was previously closed. Test: manual Bug: 139074896 Change-Id: I86c10b577dbab8cad2d5f7e19805511a93bcb668
Loading
Please register or sign in to comment