aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-11-27 08:23:18 -0800
committerScott Jackson <daneren2005@gmail.com>2013-11-27 08:23:18 -0800
commit494e528d901a9979698fb72ee9100a900b6126d2 (patch)
treed3fad112b7a64c8322a56a70711a4207fd2bfb08 /src
parent229284db80f8bc4e1be7b4ae2caeb43541632d0b (diff)
downloaddsub-494e528d901a9979698fb72ee9100a900b6126d2.tar.gz
dsub-494e528d901a9979698fb72ee9100a900b6126d2.tar.bz2
dsub-494e528d901a9979698fb72ee9100a900b6126d2.zip
Fixed sync not running, updated beta
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
index 1de9712d..4dc3ae11 100644
--- a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
+++ b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
@@ -71,11 +71,12 @@ public class SubsonicSyncAdapter extends AbstractThreadedSyncAdapter {
// Make sure battery > x% or is charging
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = context.registerReceiver(null, intentFilter);
- if(batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1) != BatteryManager.BATTERY_STATUS_CHARGING) {
+ int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+ if(status != BatteryManager.BATTERY_STATUS_CHARGING && status != BatteryManager.BATTERY_STATUS_FULL) {
int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
- if((level / (float)scale) > 0.15) {
+ if((level / (float)scale) < 0.15) {
Log.w(TAG, "Not running sync, battery too low");
return;
}