Merge pull request #571 from avuton/next

Maintenance & Bug Fixes update.
Update gradle scripts
AS files
MPDConnectionHandler: Warning cleanup.

This patch also moves the receiver registration to the MainMenuActivity, to
onPause()/onResume() (per the documentation), under a DEBUG boolean to keep
it from spamming the logs.
MPDControl: Make singleton use contingent on singleton MPD object use.
ServiceBinder: Add a class to assist with service binding.

This class assists with the complexity of maintaining a Binder connection with
the service.
StreamingService: Rename to StreamHandler.
StreamHandler: Don't extend Service, don't implement ServiceConnection.

Rationale:
* This is necessary, as Android expects the MediaPlayer to be attached to a
notification in order to take advantage of startForeground() to prevent
unexpected Service shutdown.

* This is also to allows access to the same AudioManager object; Android's
AudioManager crashed often when the services would take audio focus from each
other.

Implementation:
There are several things that had to happen at the same time to make this
patch work successfully which is why this patch is the size it is. Several
rewrites were attempted to make this happen gradually while keeping things
stable and working, after the sixth attempt this patch was created.

* This patch makes the service spawn it's own process. This significantly
reduces memory requirements of the service itself, allows more forgiving
instability, takes the service completely off the UI thread, and allows
MPDroid process killing without affecting the service (or visa versa).

* This patch adds helper functions to MPDApplication for start/stop and
server querying.

* This patch adds a Message handler class inside the MPDroid service to receive
and act on messages. Also adds debugging functions to help decode 'what'
messages.

* The MPDroidService now has a minimal startup. On startup very little will
load and is controlled by the new ServiceBinder class, currently implemented
in MPDApplication and started by the main activity to prevent a ServiceBinder
instance in the Service process. Service handlers will start dynamically as
necessary. One rationale for this change is the service must start at MPDroid
startup, minimally, to query server status. This is due to the Android
framework not having a way (prior to API 21) to know if a Service is even
running (even one owned by the main process), so deep Binder integration is
necessary for a concrete server implementation.

* The MPDroidService will also shut itself down when it's not being used.

* The MPDroid service does not use the Application instance now, instead it
uses the service instance, and only when it's absolutely necessary.

* This patch slightly changes Notification behaviour, it should not start on
Notification activation, it should only be active during play or the wind
down period.

* This patch adds stream stop/start to the ActionFire activity.

* In this patch, StreamHandler no longer extends Service, removes all binding
code, and relies on the main service for functionality.
AlbumCoverHandler: Implement album cover downloader.
AlbumCoverHandler: Don't recycle, just nullify and let GC do it's job.

I'm not sure exactly why but there are some times that Android can get out of
state and will try to parcel the albumCover after recycling. With Android 3.x+
it's really not worth the risk of crashing the service over it, so null it
and let GC do it's job.
ConnectionInfo: Add a class to track the current connection configuration.

This replaces MPDConnectionInfo from MPDAsyncHelper and adds a callback
triggered by connection configuration change. This object also stores
whether where the connection changed since last connection configuration.
service: Setup service for ConnectionInfo use.

Since the service is in a separate process, when the connection information is
updated it won't be received as the AsyncHelper and Monitor are running in a
separate process, so we need to send this information over our service binder.
MPDAsyncHelper: Don't allow adding listener multiple times.
AndroidManifest: Format and warning cleanup.
AndroidManifest: WRITE_EXTERNAL_STORAGE permission not required for API 19+.
service: Add a debug boolean for the service module.