Fixed a bug regarding the MEDIA_BUTTON action and improved bluetooth detection