aboutsummaryrefslogtreecommitdiff
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
parent229284db80f8bc4e1be7b4ae2caeb43541632d0b (diff)
downloaddsub-494e528d901a9979698fb72ee9100a900b6126d2.tar.gz
dsub-494e528d901a9979698fb72ee9100a900b6126d2.tar.bz2
dsub-494e528d901a9979698fb72ee9100a900b6126d2.zip
Fixed sync not running, updated beta
-rw-r--r--AndroidManifest.xml4
-rw-r--r--src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java5
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 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="github.daneren2005.dsub"
android:installLocation="internalOnly"
- android:versionCode="72"
- android:versionName="4.3.0">
+ android:versionCode="73"
+ android:versionName="4.3.0Beta">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
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;
}