diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-11-27 08:23:18 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-11-27 08:23:18 -0800 |
commit | 494e528d901a9979698fb72ee9100a900b6126d2 (patch) | |
tree | d3fad112b7a64c8322a56a70711a4207fd2bfb08 /src | |
parent | 229284db80f8bc4e1be7b4ae2caeb43541632d0b (diff) | |
download | dsub-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.java | 5 |
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; } |