{"comment":{"url":"https://api.github.com/repos/kaaholst/android-squeezer/comments/9985407","html_url":"https://github.com/kaaholst/android-squeezer/commit/7d58b33b455bb2f84df94c7864506517c76176d8#commitcomment-9985407","id":9985407,"user":{"login":"nikclayton","id":773100,"avatar_url":"https://avatars.githubusercontent.com/u/773100?v=3","gravatar_id":"","url":"https://api.github.com/users/nikclayton","html_url":"https://github.com/nikclayton","followers_url":"https://api.github.com/users/nikclayton/followers","following_url":"https://api.github.com/users/nikclayton/following{/other_user}","gists_url":"https://api.github.com/users/nikclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/nikclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikclayton/subscriptions","organizations_url":"https://api.github.com/users/nikclayton/orgs","repos_url":"https://api.github.com/users/nikclayton/repos","events_url":"https://api.github.com/users/nikclayton/events{/privacy}","received_events_url":"https://api.github.com/users/nikclayton/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"7d58b33b455bb2f84df94c7864506517c76176d8","created_at":"2015-03-02T13:55:13Z","updated_at":"2015-03-02T13:55:13Z","body":"I agree that `startVisibleConnection()` can only run on the UI thread, so in theory this change is safe.\r\n\r\nBut... one of the places that calls `startVisibleConnection()` is the `onReceive()` method of `broadcastReceiver` in `NowPlayingFragment`.\r\n\r\nPer the docs for BroadcastReceiver.onReceive(), https://developer.android.com/reference/android/content/BroadcastReceiver.html#onReceive(android.content.Context,%20android.content.Intent)\r\n\r\n> This method is called when the BroadcastReceiver is receiving an\r\n> Intent broadcast. During this time you can use the other methods on\r\n> BroadcastReceiver to view/modify the current result values. This\r\n> method is always called within the main thread of its process, unless\r\n> you explicitly asked for it to be scheduled on a different thread\r\n> using registerReceiver(BroadcastReceiver, IntentFilter, String,\r\n> android.os.Handler). When it runs on the main thread you should never\r\n> perform long-running operations in it (there is a timeout of 10\r\n> seconds that the system allows before considering the receiver to be\r\n> blocked and a candidate to be killed). You cannot launch a popup\r\n> dialog in your implementation of onReceive().\r\n\r\nNote the warning about not running long running operations, including\r\nlaunching dialogs from the onReceive method.\r\n"}}