diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-10-04 16:02:10 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-10-04 16:02:10 -0700 |
commit | 15a2868be3f4b64dca2856c17055a52798f86c18 (patch) | |
tree | 18340714ae1b288d33a77848d2350a7b5c23e7aa /src/github/daneren2005 | |
parent | 2421212b8339c5712ce85f55ab2137bda2483d04 (diff) | |
download | dsub-15a2868be3f4b64dca2856c17055a52798f86c18.tar.gz dsub-15a2868be3f4b64dca2856c17055a52798f86c18.tar.bz2 dsub-15a2868be3f4b64dca2856c17055a52798f86c18.zip |
#90 Add option to not pause on bluetooth disconnect
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/receiver/BluetoothIntentReceiver.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/receiver/BluetoothIntentReceiver.java b/src/github/daneren2005/dsub/receiver/BluetoothIntentReceiver.java index 567cf8f4..8af0b462 100644 --- a/src/github/daneren2005/dsub/receiver/BluetoothIntentReceiver.java +++ b/src/github/daneren2005/dsub/receiver/BluetoothIntentReceiver.java @@ -44,7 +44,11 @@ public class BluetoothIntentReceiver extends BroadcastReceiver { Util.registerMediaButtonEventReceiver(context); } else if (isDisconnected(intent)) { Log.i(TAG, "Disconnected from Bluetooth A2DP, requesting pause."); - context.sendBroadcast(new Intent(DownloadServiceImpl.CMD_PAUSE)); + SharedPreferences prefs = Util.getPreferences(context); + int pausePref = Integer.parseInt(prefs.getString(PREFERENCES_KEY_PAUSE_DISCONNECT, "0")); + if(pausePref == 0 || pausePref == 2) { + context.sendBroadcast(new Intent(DownloadServiceImpl.CMD_PAUSE)); + } } } private boolean isConnected(Intent intent) { @@ -75,4 +79,4 @@ public class BluetoothIntentReceiver extends BroadcastReceiver { } return false; } -}
\ No newline at end of file +} |