Kore/app/src/main/java/org/xbmc/kore/ui
Synced Synapse 7dfd982643 Tweak connection threads
This PR fixes some issues with connections and threading. Specifically, the  change in #618 introduced threading in `HostConnection`, which had some issues. To fix them, the following changes were made:
- A specific TCP listener thread is used and manually started, instead of using one of the threads in the pool. The TCP listener thread is a long lived thread that should always be running (as long as the connection is through TCP), blocked listening on the TCP socket, so it shouldn't be managed in a pool, where, theoretically, it can be paused and reused. 
- Changed the number of threads to 5. We shouldn't need more than this, otherwise we can overwhelm some Kodi hardware.
- Had to sprinkle some `synchronized` to avoid race conditions. For instance, through a TCP connection, as soon as Kore is opened (on the remote screen) it will call at least `GetActivePlayers`, `GetProperties`, `Ping`. If the TCP socket isn't set up yet, each of these calls would create a socket (and a TCP listener thread), so we would open 3 or more sockets when we should just open 1. A `synchronized` in `executeThroughTcp` prevents this. The others prevent similar issues.

Aditionally:
- Tweaked the playlist fetching code, so that it happens exclusively in `HostConnectionObserver` and when PlaylistFragment is notified of changes, it already gets the playlist data. This somewhat simplifies the code, and makes it more consistent with the Player Observer code;
- Change `EventServerConnection` to accept a Handler on which to post the result of the connection, so that the caller can control on which thread the result is called;
- Calls to the various `RegisterObserver` loose the reply immediately parameter, as it was always true.
2019-09-28 22:10:04 +02:00
..
animators Redesigned playing movies on device running Kore 2018-02-09 11:23:52 +00:00
behaviors Redesigned playing movies on device running Kore 2018-02-09 11:23:52 +00:00
generic Tweak connection threads 2019-09-28 22:10:04 +02:00
sections Tweak connection threads 2019-09-28 22:10:04 +02:00
viewgroups Improved performance in SquareGridLayout (#631) 2019-04-07 13:28:32 +01:00
views Added movie ratings to movie listview items (#613) 2019-02-26 20:08:46 +00:00
widgets Tweak Themes 2019-05-21 20:51:21 +02:00
AbstractAdditionalInfoFragment.java Refactored AbstractDetailsFragment 2017-03-02 11:55:19 +01:00
AbstractCursorListFragment.java Fixed clearing focus on search view 2018-09-09 14:09:59 +01:00
AbstractFragment.java Refactored AbstractFragment to not depend on AbstractInfoFragment (#487) 2017-12-05 09:58:55 +00:00
AbstractInfoFragment.java Fix invisible media details in info fragment (#656) 2019-07-03 18:41:21 +01:00
AbstractListFragment.java Refactored ListView into RecycleView 2018-09-01 16:44:10 +02:00
AbstractTabsFragment.java Fixed issue with running many instrumentation tests (#536) 2018-05-03 11:04:04 +01:00
BaseActivity.java Use hardware volume keys from anywhere inside Kore (#453) 2017-10-08 19:48:00 +01:00
BaseMediaActivity.java Tweak connection threads 2019-09-28 22:10:04 +02:00
OnBackPressedListener.java Switch PVR fragments to using tabs instead of a menu for navigation 2015-11-28 18:19:44 +00:00
RecyclerViewCursorAdapter.java Add sort by year section thumb text (#659) 2019-07-10 18:57:14 +01:00