Crash-Test-Buddies / WiFi-Buddy

Wi-Fi Buddy - Library to handle Android Wi-Fi Direct
https://groups.google.com/forum/#!forum/wi-fi-direct
MIT License
48 stars 12 forks source link

App crashes after service discovery timeout when paused #163

Closed brendankirby closed 8 years ago

brendankirby commented 8 years ago
  1. Run the app
  2. Discover services
  3. Pause the app (open the multitasking view)
  4. Leave it there for a few minutes
  5. The app crashes

06-28 21:33:18.141 17012-17012/edu.rit.se.crashavoidance I/wfd_MainActivity: Pausing MainActivity 06-28 21:33:18.141 17012-17012/edu.rit.se.crashavoidance I/wfd_MainActivity: WifiDirectHandler service unbound 06-28 21:33:18.157 17012-17012/edu.rit.se.crashavoidance I/wfdMainActivity: MainActivity paused 06-28 21:33:18.163 17012-17012/edu.rit.se.crashavoidance I/wfd: Persistent groups removed 06-28 21:33:18.171 17012-17012/edu.rit.se.crashavoidance I/wfd: No local service to remove 06-28 21:33:18.174 17012-17012/edu.rit.se.crashavoidance I/wfd: P2P BroadcastReceiver unregistered 06-28 21:33:18.175 17012-17012/edu.rit.se.crashavoidance I/wfd: Unregistered with Wi-Fi P2P framework 06-28 21:33:18.177 17012-17012/edu.rit.se.crashavoidance I/wfd: Wi-Fi BroadcastReceiver unregistered 06-28 21:33:18.177 17012-17012/edu.rit.se.crashavoidance I/wfd_: Wifi Handler service destroyed 06-28 21:33:18.226 17012-17012/edu.rit.se.crashavoidance I/wfd_MainActivity: Stopping MainActivity 06-28 21:33:18.226 17012-17012/edu.rit.se.crashavoidance I/wfdMainActivity: MainActivity stopped 06-28 21:33:18.230 17012-17012/edu.rit.se.crashavoidance I/wfd: Service discovery request removed 06-28 21:33:18.295 17012-17037/edu.rit.se.crashavoidance W/libutils.threads: Thread (this=0xaf826a00): getTid() is undefined before run() 06-28 21:33:18.295 17012-17037/edu.rit.se.crashavoidance W/libutils.threads: Thread (this=0xaf826a60): getTid() is undefined before run() 06-28 21:33:25.978 17012-17023/edu.rit.se.crashavoidance W/art: Suspending all threads took: 61.412ms 06-28 21:35:16.623 17012-17057/edu.rit.se.crashavoidance E/AndroidRuntime: FATAL EXCEPTION: Timer-0 Process: edu.rit.se.crashavoidance, PID: 17012 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.net.wifi.p2p.WifiP2pManager.discoverServices(android.net.wifi.p2p.WifiP2pManager$Channel, android.net.wifi.p2p.WifiP2pManager$ActionListener)' on a null object reference at edu.rit.se.wifibuddy.WifiDirectHandler.discoverServices(WifiDirectHandler.java:389) at edu.rit.se.wifibuddy.WifiDirectHandler$ServiceDiscoveryTask.run(WifiDirectHandler.java:451) at java.util.Timer$TimerImpl.run(Timer.java:284) 06-28 21:35:16.642 17012-17012/edu.rit.se.crashavoidance I/wfd_MainActivity: Destroying MainActivity

brendankirby commented 8 years ago

Fixed in #164 , closing...