From 494e528d901a9979698fb72ee9100a900b6126d2 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 27 Nov 2013 08:23:18 -0800 Subject: Fixed sync not running, updated beta --- AndroidManifest.xml | 4 ++-- src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 9c018084..cd897f13 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="73" + android:versionName="4.3.0Beta"> 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; } -- cgit v1.2.3