{"action":"created","comment":{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments/37907901","id":37907901,"diff_hunk":"@@ -16,16 +16,12 @@\n  */\n public class BTConnector_Discovery implements WifiServiceSearcher.DiscoveryInternalCallBack {\n \n-    BTConnector_Discovery that = this;\n-\n-    static String JSON_ID_PEERID   = \"pi\";\n-    static String JSON_ID_PEERNAME = \"pn\";\n-    static String JSON_ID_BTADRRES = \"ra\";\n+    private final BTConnector_Discovery that = this;\n \n     public interface  DiscoveryCallback{","path":"BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java","position":11,"original_position":11,"commit_id":"49681d9ca7d4ba915f938b76a8fbf416776b0f29","original_commit_id":"cefd0f75adca39f730be0b1934654725f9808736","user":{"login":"yaronyg","id":1480964,"avatar_url":"https://avatars.githubusercontent.com/u/1480964?v=3","gravatar_id":"","url":"https://api.github.com/users/yaronyg","html_url":"https://github.com/yaronyg","followers_url":"https://api.github.com/users/yaronyg/followers","following_url":"https://api.github.com/users/yaronyg/following{/other_user}","gists_url":"https://api.github.com/users/yaronyg/gists{/gist_id}","starred_url":"https://api.github.com/users/yaronyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaronyg/subscriptions","organizations_url":"https://api.github.com/users/yaronyg/orgs","repos_url":"https://api.github.com/users/yaronyg/repos","events_url":"https://api.github.com/users/yaronyg/events{/privacy}","received_events_url":"https://api.github.com/users/yaronyg/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-08-25T19:26:45Z","updated_at":"2015-08-25T19:26:45Z","html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37907901","pull_request_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments/37907901"},"html":{"href":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37907901"},"pull_request":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6","id":42822624,"html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6","diff_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6.diff","patch_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6.patch","issue_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6","number":6,"state":"open","locked":false,"title":"Story 0 juksilve","user":{"login":"DrJukka","id":5235141,"avatar_url":"https://avatars.githubusercontent.com/u/5235141?v=3","gravatar_id":"","url":"https://api.github.com/users/DrJukka","html_url":"https://github.com/DrJukka","followers_url":"https://api.github.com/users/DrJukka/followers","following_url":"https://api.github.com/users/DrJukka/following{/other_user}","gists_url":"https://api.github.com/users/DrJukka/gists{/gist_id}","starred_url":"https://api.github.com/users/DrJukka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrJukka/subscriptions","organizations_url":"https://api.github.com/users/DrJukka/orgs","repos_url":"https://api.github.com/users/DrJukka/repos","events_url":"https://api.github.com/users/DrJukka/events{/privacy}","received_events_url":"https://api.github.com/users/DrJukka/received_events","type":"User","site_admin":false},"body":"latest changes to be merged with library\n<a href='#crh-start'></a><a href='#crh-data-%7B%22processed%22%3A%20%5B%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134403551%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134403946%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134404138%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814628%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814752%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814918%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815070%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815253%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815335%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815876%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816037%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816150%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816305%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816440%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816616%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816721%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816761%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816869%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816909%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817105%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817238%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817544%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817676%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817743%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817878%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37818074%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37818307%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134416165%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134416618%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37818780%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134417965%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134418774%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819157%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134419365%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819522%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819846%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819976%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37852597%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37852631%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37852838%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37852922%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853007%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853019%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853082%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853136%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853263%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853354%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853436%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853461%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853507%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853519%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853623%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853639%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853663%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853719%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853825%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853945%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37853985%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37854144%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37854320%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37854380%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37906652%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37907200%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37907390%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37907484%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37907824%22%5D%2C%20%22comments%22%3A%20%7B%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java%2015%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819522%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Why%20do%20we%20have%20GetLastError%20and%20lastError%3F%20Nobody%20seems%20to%20ever%20use%20them%20including%20the%20Thali_CordovaPlugin%20library%3F%22%2C%20%22created_at%22%3A%20%222015-08-25T00%3A00%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22they%20were%20used%20earlier%20in%20testing%20to%20see%20what%20went%20wrong.%20I%27ll%20remove%20it%20now.%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A15%3A31Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java%3AL11-23%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%20147%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815876%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22/BtBrowdCastReceiver/BtBroadCastReceiver/%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A05%3A31Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22changed%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A53%3A31Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL92-111%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2024%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816037%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22It%20is%20much%20cleaner%20and%20safe%20to%20make%20all%20the%20member%20variables%20final%20and%20require%20their%20settings%20to%20be%20passed%20into%20the%20constructor.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A07%3A26Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20did%20do%20a%20check%20for%20all%20constructor%20initialized%20variables%20and%20marked%20them%20final%20now.%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A55%3A30Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL5-24%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java%2045%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817743%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Usual%20whining%20on%20lines%2059-64%20about%20values%20that%20can%20be%20final.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A32%3A40Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20did%20check%20this%20already%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A08%3A23Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java%3AL32-48%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2029%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816150%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22The%20name%20%5C%22Callback%5C%22%20is%20more%20than%20a%20little%20generic%20and%20makes%20it%20had%20to%20follow%20the%20code%20when%20it%20is%20used%20outside%20of%20this%20class%2C%20such%20as%20in%20BtConnectorHelper.%20How%20about%20a%20more%20descriptive%20name%20like%20BTConnectorCallback%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A08%3A59Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%20%22%2C%20%22created_at%22%3A%20%222015-08-25T19%3A22%3A58Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL43-81%22%7D%2C%20%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134403551%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20remove%20all%20.iml%20files%20they%20should%20not%20be%20checked%20in.%20In%20order%20to%20support%20properly%20keeping%20all%20critical%20state%20in%20build.gradle%20so%20we%20have%20repeatable%20and%20consistent%20builds%20we%20should%20only%20be%20checking%20in%20the%20build.gradle%20and%20not%20the%20.iml%20files.%20Please%20also%20edit%20.gitignore%20so%20it%20ignores%20all%20.iml%20files.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A46%3A50Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Why%20is%20the%20app%20sub-project%20part%20of%20BtConnectorLib%3F%20It%20doesn%27t%20have%20any%20code.%20Can%20we%20please%20just%20delete%20it%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A48%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20can%20see%20code%20that%20catches%20Exception.%20Per%20my%20previous%20PR%20please%20remove%20all%20attempts%20to%20catch%20the%20Exception%20object%20and%20replace%20it%20with%20a%20more%20targeted%20catch.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A49%3A11Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Please%20check%20all%20of%20your%20files%2C%20especially%20the%20constructors%2C%20to%20see%20what%20values%20you%20can%20make%20final.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A45%3A43Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Please%20make%20sure%20that%20you%20properly%20re-throw%20exceptions.%20I%20have%20several%20examples%20in%20the%20comments%20where%20you%20get%20an%20error%20and%20rather%20than%20returning%20it%20%28sometimes%20via%20a%20callback%29%20you%20will%20silently%20let%20the%20method%20continue%20even%20though%20it%27s%20actually%20in%20a%20failure%20state.%20Another%20example%20I%20just%20saw%20is%20in%20BTHandShakeSocketThread%20where%20it%27s%20possible%20to%20not%20get%20the%20temp%20in%20and%20out%20stream%20in%20the%20constructor%20but%20the%20system%20will%20just%20log%20and%20walk%20away.%20We%20should%20have%20gotten%20an%20error%2C%20somewhere.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A47%3A08Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Also%20please%20revisit%20your%20logging.%20There%20are%20print_line%2C%20printe_line%20and%20log%20all%20used%20in%20various%20places.%20We%20really%20need%20to%20be%20consistent.%20I%20believe%20the%20right%20choice%20for%20now%20is%20to%20just%20use%20Android%20logging.%20Please%20do%20so%20everywhere%20and%20please%20pay%20attention%20to%20the%20logging%20level.%20We%20generally%20just%20use%20three%20levels%3A%5Cr%5Cn%5Cr%5Cninfo%20-%20Useful%20for%20understanding%20what%27s%20going%20on%5Cr%5CnWarning%20-%20Something%20that%20really%20shouldn%27t%20have%20happened%20but%20isn%27t%20the%20end%20of%20the%20world%20happened%2C%20also%20things%20are%20insanely%20useful%20for%20debugging%5Cr%5CnError%20-%20Something%20bad%20happened%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A50%3A45Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Please%20update%20all%20switch%20statement%20so%20they%20always%20have%20a%20default%20that%20can%20throw%20some%20kind%20of%20error.%20In%20both%20BTListenerThread%20and%20BTConnectToThread%20there%20are%20switches%20without%20defaults.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A53%3A40Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Please%20make%20all%20the%20fields%20in%20ServiceItem%20final.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A56%3A28Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20246%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816909%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22And%20shouldn%27t%20there%20be%20a%20check%20that%20startServices%20was%20called%20before%20stopServices%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A20%3A37Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL182-207%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java%2011%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817676%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Shouldn%27t%20this%20inherit%20from%20ConnectSelector%20in%20BTConnector%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A31%3A40Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java%3AL16-28%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20203%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816721%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22I%20believe%20you%20are%20saying%20that%20someone%20called%20tryConnect%20without%20a%20successful%20call%20to%20start.%20In%20that%20case%20shouldn%27t%20we%20throw%20an%20exception%3F%20Otherwise%20how%20can%20the%20dev%20tell%20the%20difference%20between%20having%20screwed%20up%20and%20called%20TryConnect%20without%20start%20and%20having%20called%20for%20the%20wrong%20peerAddress%20%28the%20next%20usage%20of%20this%20same%20response%20code%29%3F%20This%20really%20should%20be%2C%20I%20believe%2C%20an%20exception.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A17%3A45Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22sure%2C%20changed%20now.%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A03%3A16Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20221%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816869%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Shouldn%27t%20there%20be%20a%20check%20that%20start%20was%20called%20first%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A19%3A59Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2078%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816305%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Every%20single%20variable%20set%20in%20this%20constructor%20can%20be%20safely%20set%20to%20final.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A11%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22done%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A56%3A58Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL43-81%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java%2063%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37818307%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Don%27t%20we%20need%20to%20call%20the%20callback%20and%20let%20them%20know%20that%20no%20connection%20is%20going%20to%20happen%3F%20Ever%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A41%3A41Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Yep%2C%20changed%20that%20now.%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A12%3A43Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java%3AL54-100%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java%20168%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819846%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20change%20to%20for-each%22%2C%20%22created_at%22%3A%20%222015-08-25T00%3A03%3A23Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22done%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A17%3A59Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java%3AL145-178%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%2030%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817544%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Why%20is%20this%20defined%20at%20all%3F%20Shouldn%27t%20it%20just%20be%20the%20Callback%20interface%20from%20BTConnector%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A29%3A50Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Basically%20wanted%20the%20plug-in%20to%20be%20called%20only%20from%20the%20BtConnector%20class%20instance%2C%20thus%20other%20parts%20are%20reporting%20to%20it.%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A07%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%2C%20%7B%22body%22%3A%20%22Basically%20wanted%20the%20plug-in%20to%20be%20called%20only%20from%20the%20BtConnector%20class%20instance%2C%20thus%20other%20parts%20are%20reporting%20to%20it.%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A07%3A39Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%20%22%2C%20%22created_at%22%3A%20%222015-08-25T19%3A26%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%3AL5-151%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java%20115%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817878%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22/printe_line/print_line%5Cr%5Cn%5Cr%5CnBut%20the%20more%20important%20point%20than%20the%20spelling%20error%20is%20that%20we%20should%20just%20use%20Android%20logging%20as-is.%20There%20is%20no%20need%20for%20this%20redirection.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A35%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20changed%20the%20logging%20with%20the%20first%20comment.%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A21%3A56Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java%3AL54-100%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTListenerThread.java%2043%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37818780%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22As%20IntelliJ%27s%20own%20code%20validation%20calls%20out%2C%20this%20variable%20is%20assigned%20but%20never%20read.%20So%20what%20is%20its%20purpose%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A48%3A51Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTListenerThread.java%3AL8-117%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2069%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815335%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Other%20than%20the%20usual%20comment%20about%20never%20catching%20Exception%2C%20isn%27t%20it%20bad%20that%20we%20are%20just%20swallowing%20this%20exception%3F%20This%20seems%20like%20the%20kind%20of%20thing%20that%20should%20cause%20a%20throw%20from%20Start%28%29%20so%20the%20caller%20knows%20they%20are%20in%20a%20really%20bad%20place.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A58%3A27Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20changed%20that%20to%20return%20false%20to%20indicate%20that%20we%20did%20not%20start%20bluetooth%2C%20thus%20bluetooth%20is%20considered%20not%20Ok.%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A52%3A50Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2042%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814752%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20remove%20blueAddress%20and%20instead%20please%20make%20getAddress%20into%20an%20accessor%20that%20calls%20bluetooth.getAddress%28%29%20directly.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A51%3A10Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22done%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A47%3A04Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java%20241%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819976%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22On%20line%20295%20please%20use%20switch%20and%20please%20make%20sure%20to%20have%20a%20default.%22%2C%20%22created_at%22%3A%20%222015-08-25T00%3A05%3A34Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20suppose%20the%20way%20I%27m%20using%20it%20is%20recommended%3A%20http%3A//stackoverflow.com/questions/20660628/android-how-to-use-switch-case-with-intents-received-from-broadcasts%5Cr%5Cn%5Cr%5CnAlso%20I%27m%20not%20interested%20for%20any%20other%20action%2C%20thus%20having%20handling%20for%20it%20would%20not%20make%20sense%20to%20me.%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A21%3A03Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java%3AL275-288%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2041%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814918%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22If%20bluetooth%20is%20null%20then%20the%20class%20instance%20is%20useless.%20Please%20test%20and%20throw.%20This%20will%2C%20btw%2C%20let%20you%20remove%20all%20the%20tests%20for%20bluetooth%20%3D%3D%20null%20everywhere%20else%20in%20this%20class%20since%20you%20know%20if%20the%20object%20exists%20then%20then%20bluetooth%20isn%27t%20null.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A53%3A12Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22BTW%2C%20just%20to%20be%20fair%2C%20there%20is%20a%20pretty%20strong%20school%20of%20thought%20that%20argues%20that%20constructors%20shouldn%27t%20throw.%20It%20makes%20declaring%20variables%20tricky%20and%20can%20be%20a%20bit%20surprising%20since%20typically%20constructors%20shouldn%27t%20do%20anything.%20Instead%20someone%20should%20have%20to%20call%20a%20method%20on%20the%20object%20before%20anything%20interesting%20happens.%20I%20have%20a%20lot%20of%20sympathy%20for%20this%20later%20view.%20But%20in%20that%20case%20Start%20should%20definitely%20throw%20if%20bluetooth%20is%20null.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A55%3A10Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Basically%20the%20start%20will%20tell%20the%20caller%20that%20we%20are%20not%20Ok%2C%20thus%20I%20would%20not%20see%20what%20additional%20benefits%20throwing%20an%20exception%20would%20give%20us%20here.%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A49%3A47Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A-1%3A%20%22%2C%20%22created_at%22%3A%20%222015-08-25T19%3A15%3A06Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%20%22%2C%20%22created_at%22%3A%20%222015-08-25T19%3A22%3A11Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2047%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815253%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Shouldn%27t%20we%20throw%20if%20Start%28%29%20is%20called%20multiple%20times%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A57%3A30Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22only%20bad%20thing%20that%20can%20happen%20there%20would%20be%20the%20registerReceiver%20throwing%20an%20error%2C%20and%20currently%20I%27m%20catching%20that%20there%20and%20reporting%20that%20we%20are%20not%20started%20with%20returning%20false%20to%20the%20caller.%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A51%3A20Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%20%22%2C%20%22created_at%22%3A%20%222015-08-25T19%3A20%3A24Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%2061%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817238%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Usual%20whining%20about%20these%20values%20being%20setable%20in%20most%20cases%20to%20final.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A25%3A31Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22done%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A04%3A56Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%3AL5-151%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2035%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814628%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Context%20and%20callBack%20can%20both%20be%20final.%20Please%20make%20them%20so.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A49%3A55Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22done%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A46%3A45Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL3-30%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20139%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816440%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22/untill/until/%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A13%3A14Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22changed%22%2C%20%22created_at%22%3A%20%222015-08-25T10%3A59%3A10Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20251%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817105%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22We%20need%20to%20get%20consistent%20on%20how%20we%20log.%20Some%20places%20there%20is%20print_debug%20and%20other%20places%20are%20print_line.%20What%20we%20really%20need%20to%20do%20is%20to%20just%20use%20the%20Android%20logging%20API.%20Then%20we%20can%20set%20the%20log%20levels%20anyway%20we%20want.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A23%3A22Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20changed%20all%20places%20using%20print_debug%2C%20in%20which%20I%20use%20d-option%20to%20do%20debug%20logging%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A04%3A42Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL182-207%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTHandShakeSocketTread.java%208%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37819157%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22/SOCKET_DISCONNEDTED/SOCKET_DISCONNECTED/%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A54%3A47Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22fixed%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A14%3A50Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTHandShakeSocketTread.java%3AL13-20%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2084%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816616%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Both%20the%20start%20and%20stop%20methods%20seem%20like%20the%20kind%20of%20methods%20that%20should%20be%20called%20exactly%20once%20apiece.%20Once%20stop%20is%20called%20shouldn%27t%20the%20BTConnector%20object%20be%20garbage%20collected%20and%20a%20new%20one%20created%3F%20This%20would%20make%20the%20logic%20much%20simpler.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A16%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22that%27s%20actually%20what%20is%20done%20inside%20the%20plugin%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A00%3A54Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL43-81%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20211%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816761%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20see%20my%20comment%20on%20line%20162.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A18%3A13Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22this%20is%20changed%20now%20also%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A03%3A58Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java%2056%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37818074%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22If%20this%20fails%20aren%27t%20we%20in%20a%20really%20bad%20place%3F%20This%20means%20that%20mSocket%20is%20going%20to%20be%20null%20forever%20so%20this%20object%20is%20essentially%20useless.%20In%20that%20case%20wouldn%27t%20it%20make%20more%20sense%20to%20just%20throw%3F%20Now%2C%20per%20the%20previous%20conversation%2C%20it%20doesn%27t%20always%20make%20sense%20to%20throw%20from%20a%20constructor.%20So%20I%20figure%20we%20could%20move%20the%20call%20to%20createInsecureRfcommSocketToServiceRecord%20to%20run%28%29%20and%20then%20we%20can%20certainly%20throw%20from%20there.%20But%20one%20way%20or%20another%20if%20this%20function%20fails%20we%20need%20an%20exception%20somewhere.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A38%3A18Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22did%20change%20to%20throw%20exception%22%2C%20%22created_at%22%3A%20%222015-08-25T11%3A10%3A02Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/5235141%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/DrJukka%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java%3AL4-50%22%7D%7D%7D'></a>\n<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>\n- [x] <a href='#crh-comment-General Comment'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#issuecomment-134403551'>General Comment</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please remove all .iml files they should not be checked in. In order to support properly keeping all critical state in build.gradle so we have repeatable and consistent builds we should only be checking in the build.gradle and not the .iml files. Please also edit .gitignore so it ignores all .iml files.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Why is the app sub-project part of BtConnectorLib? It doesn't have any code. Can we please just delete it?\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> I can see code that catches Exception. Per my previous PR please remove all attempts to catch the Exception object and replace it with a more targeted catch.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please check all of your files, especially the constructors, to see what values you can make final.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please make sure that you properly re-throw exceptions. I have several examples in the comments where you get an error and rather than returning it (sometimes via a callback) you will silently let the method continue even though it's actually in a failure state. Another example I just saw is in BTHandShakeSocketThread where it's possible to not get the temp in and out stream in the constructor but the system will just log and walk away. We should have gotten an error, somewhere.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Also please revisit your logging. There are print_line, printe_line and log all used in various places. We really need to be consistent. I believe the right choice for now is to just use Android logging. Please do so everywhere and please pay attention to the logging level. We generally just use three levels:\ninfo - Useful for understanding what's going on\nWarning - Something that really shouldn't have happened but isn't the end of the world happened, also things are insanely useful for debugging\nError - Something bad happened\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please update all switch statement so they always have a default that can throw some kind of error. In both BTListenerThread and BTConnectToThread there are switches without defaults.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please make all the fields in ServiceItem final.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 35'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37814628'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L3-30</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Context and callBack can both be final. Please make them so.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> done\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 42'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37814752'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please remove blueAddress and instead please make getAddress into an accessor that calls bluetooth.getAddress() directly.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> done\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 69'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37815335'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Other than the usual comment about never catching Exception, isn't it bad that we are just swallowing this exception? This seems like the kind of thing that should cause a throw from Start() so the caller knows they are in a really bad place.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> I changed that to return false to indicate that we did not start bluetooth, thus bluetooth is considered not Ok.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 147'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37815876'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L92-111</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> /BtBrowdCastReceiver/BtBroadCastReceiver/\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> changed\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 24'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816037'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L5-24</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> It is much cleaner and safe to make all the member variables final and require their settings to be passed into the constructor.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> I did do a check for all constructor initialized variables and marked them final now.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 78'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816305'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L43-81</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Every single variable set in this constructor can be safely set to final.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> done\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 139'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816440'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> /untill/until/\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> changed\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 84'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816616'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L43-81</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Both the start and stop methods seem like the kind of methods that should be called exactly once apiece. Once stop is called shouldn't the BTConnector object be garbage collected and a new one created? This would make the logic much simpler.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> that's actually what is done inside the plugin\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 203'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816721'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> I believe you are saying that someone called tryConnect without a successful call to start. In that case shouldn't we throw an exception? Otherwise how can the dev tell the difference between having screwed up and called TryConnect without start and having called for the wrong peerAddress (the next usage of this same response code)? This really should be, I believe, an exception.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> sure, changed now.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 211'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816761'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please see my comment on line 162.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> this is changed now also\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 221'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816869'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Shouldn't there be a check that start was called first?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 246'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816909'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L182-207</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> And shouldn't there be a check that startServices was called before stopServices?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 251'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817105'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L182-207</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> We need to get consistent on how we log. Some places there is print_debug and other places are print_line. What we really need to do is to just use the Android logging API. Then we can set the log levels anyway we want.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> I changed all places using print_debug, in which I use d-option to do debug logging\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java 61'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817238'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java:L5-151</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Usual whining about these values being setable in most cases to final.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> done\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java 11'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817676'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java:L16-28</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Shouldn't this inherit from ConnectSelector in BTConnector?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java 45'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817743'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java:L32-48</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Usual whining on lines 59-64 about values that can be final.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> I did check this already\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java 115'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817878'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java:L54-100</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> /printe_line/print_line\nBut the more important point than the spelling error is that we should just use Android logging as-is. There is no need for this redirection.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> I changed the logging with the first comment.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java 56'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37818074'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java:L4-50</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> If this fails aren't we in a really bad place? This means that mSocket is going to be null forever so this object is essentially useless. In that case wouldn't it make more sense to just throw? Now, per the previous conversation, it doesn't always make sense to throw from a constructor. So I figure we could move the call to createInsecureRfcommSocketToServiceRecord to run() and then we can certainly throw from there. But one way or another if this function fails we need an exception somewhere.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> did change to throw exception\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java 63'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37818307'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnectToThread.java:L54-100</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Don't we need to call the callback and let them know that no connection is going to happen? Ever?\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> Yep, changed that now.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTListenerThread.java 43'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37818780'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTListenerThread.java:L8-117</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> As IntelliJ's own code validation calls out, this variable is assigned but never read. So what is its purpose?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTHandShakeSocketTread.java 8'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37819157'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTHandShakeSocketTread.java:L13-20</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> /SOCKET_DISCONNEDTED/SOCKET_DISCONNECTED/\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> fixed\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java 15'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37819522'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java:L11-23</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Why do we have GetLastError and lastError? Nobody seems to ever use them including the Thali_CordovaPlugin library?\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> they were used earlier in testing to see what went wrong. I'll remove it now.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java 168'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37819846'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java:L145-178</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please change to for-each\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> done\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java 241'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37819976'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/WifiServiceSearcher.java:L275-288</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> On line 295 please use switch and please make sure to have a default.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> I suppose the way I'm using it is recommended: http://stackoverflow.com/questions/20660628/android-how-to-use-switch-case-with-intents-received-from-broadcasts\nAlso I'm not interested for any other action, thus having handling for it would not make sense to me.\n- [x] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 41'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37814918'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> If bluetooth is null then the class instance is useless. Please test and throw. This will, btw, let you remove all the tests for bluetooth == null everywhere else in this class since you know if the object exists then then bluetooth isn't null.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> BTW, just to be fair, there is a pretty strong school of thought that argues that constructors shouldn't throw. It makes declaring variables tricky and can be a bit surprising since typically constructors shouldn't do anything. Instead someone should have to call a method on the object before anything interesting happens. I have a lot of sympathy for this later view. But in that case Start should definitely throw if bluetooth is null.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> Basically the start will tell the caller that we are not Ok, thus I would not see what additional benefits throwing an exception would give us here.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> :-1:\n- [x] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 47'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37815253'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Shouldn't we throw if Start() is called multiple times?\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> only bad thing that can happen there would be the registerReceiver throwing an error, and currently I'm catching that there and reporting that we are not started with returning false to the caller.\n- [x] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 29'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816150'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L43-81</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> The name \"Callback\" is more than a little generic and makes it had to follow the code when it is used outside of this class, such as in BtConnectorHelper. How about a more descriptive name like BTConnectorCallback?\n- [x] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java 30'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817544'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java:L5-151</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Why is this defined at all? Shouldn't it just be the Callback interface from BTConnector?\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> Basically wanted the plug-in to be called only from the BtConnector class instance, thus other parts are reporting to it.\n- <a href='https://github.com/DrJukka'><img border=0 src='https://avatars.githubusercontent.com/u/5235141?v=3' height=16 width=16'></a> Basically wanted the plug-in to be called only from the BtConnector class instance, thus other parts are reporting to it.\n\n\n<a href='https://www.codereviewhub.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>\n<a href='#crh-end'></a>","created_at":"2015-08-19T14:43:01Z","updated_at":"2015-08-25T19:26:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39e75885e44ae9b60c054c7d20ca5a3aa05c3e13","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/commits","review_comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/comments","review_comment_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6/comments","statuses_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/49681d9ca7d4ba915f938b76a8fbf416776b0f29","head":{"label":"thaliproject:story_0_juksilve","ref":"story_0_juksilve","sha":"49681d9ca7d4ba915f938b76a8fbf416776b0f29","user":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"repo":{"id":37128954,"name":"Thali_CordovaPlugin_BtLibrary","full_name":"thaliproject/Thali_CordovaPlugin_BtLibrary","owner":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","description":"the plug-in needed for the Thali CordovaPlugin's android implementation","fork":false,"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary","forks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/forks","keys_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/teams","hooks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/hooks","issue_events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/events{/number}","events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/events","assignees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/assignees{/user}","branches_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/branches{/branch}","tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/tags","blobs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/refs{/sha}","trees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/{sha}","languages_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/languages","stargazers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/stargazers","contributors_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contributors","subscribers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscribers","subscription_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscription","commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/commits{/sha}","git_commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/commits{/sha}","comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/comments{/number}","issue_comment_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/comments{/number}","contents_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contents/{+path}","compare_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/merges","archive_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/downloads","issues_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues{/number}","pulls_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls{/number}","milestones_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/milestones{/number}","notifications_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/labels{/name}","releases_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/releases{/id}","created_at":"2015-06-09T11:51:53Z","updated_at":"2015-06-09T11:57:41Z","pushed_at":"2015-08-25T15:51:02Z","git_url":"git://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","ssh_url":"git@github.com:thaliproject/Thali_CordovaPlugin_BtLibrary.git","clone_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","svn_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","homepage":null,"size":560,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"thaliproject:master","ref":"master","sha":"8e8849cb7e1783661cebe06b15a2e8f826b04066","user":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"repo":{"id":37128954,"name":"Thali_CordovaPlugin_BtLibrary","full_name":"thaliproject/Thali_CordovaPlugin_BtLibrary","owner":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","description":"the plug-in needed for the Thali CordovaPlugin's android implementation","fork":false,"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary","forks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/forks","keys_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/teams","hooks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/hooks","issue_events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/events{/number}","events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/events","assignees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/assignees{/user}","branches_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/branches{/branch}","tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/tags","blobs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/refs{/sha}","trees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/{sha}","languages_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/languages","stargazers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/stargazers","contributors_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contributors","subscribers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscribers","subscription_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscription","commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/commits{/sha}","git_commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/commits{/sha}","comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/comments{/number}","issue_comment_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/comments{/number}","contents_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contents/{+path}","compare_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/merges","archive_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/downloads","issues_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues{/number}","pulls_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls{/number}","milestones_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/milestones{/number}","notifications_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/labels{/name}","releases_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/releases{/id}","created_at":"2015-06-09T11:51:53Z","updated_at":"2015-06-09T11:57:41Z","pushed_at":"2015-08-25T15:51:02Z","git_url":"git://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","ssh_url":"git@github.com:thaliproject/Thali_CordovaPlugin_BtLibrary.git","clone_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","svn_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","homepage":null,"size":560,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6"},"html":{"href":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6"},"issue":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6"},"comments":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/49681d9ca7d4ba915f938b76a8fbf416776b0f29"}}}}