projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosdroid: Add configurable frequency set
[fw/altos]
/
altosdroid
/
src
/
org
/
altusmetrum
/
AltosDroid
/
AltosDroidPreferencesBackend.java
diff --git
a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
index 75676e284909d4e72038ccb0e827d75cb0f4d1fc..c2db3774bed213172ee1c0003344ea8e5eebd196 100644
(file)
--- a/
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
+++ b/
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
@@
-24,7
+24,7
@@
import android.content.SharedPreferences;
import android.os.Environment;
import android.util.*;
import android.os.Environment;
import android.util.*;
-import org.altusmetrum.altoslib_
7
.*;
+import org.altusmetrum.altoslib_
10
.*;
public class AltosDroidPreferencesBackend implements AltosPreferencesBackend {
public final static String NAME = "org.altusmetrum.AltosDroid";
public class AltosDroidPreferencesBackend implements AltosPreferencesBackend {
public final static String NAME = "org.altusmetrum.AltosDroid";
@@
-44,10
+44,17
@@
public class AltosDroidPreferencesBackend implements AltosPreferencesBackend {
public String[] keys() {
Map<String, ?> all = prefs.getAll();
public String[] keys() {
Map<String, ?> all = prefs.getAll();
- return (String[])all.keySet().toArray();
+ Object[] ao = all.keySet().toArray();
+
+ String[] as = new String[ao.length];
+ for (int i = 0; i < ao.length; i++)
+ as[i] = (String) ao[i];
+ return as;
}
public AltosPreferencesBackend node(String key) {
}
public AltosPreferencesBackend node(String key) {
+ if (!nodeExists(key))
+ putBoolean(key, true);
return new AltosDroidPreferencesBackend(context, key);
}
return new AltosDroidPreferencesBackend(context, key);
}
@@
-104,6
+111,7
@@
public class AltosDroidPreferencesBackend implements AltosPreferencesBackend {
}
public void remove(String key) {
}
public void remove(String key) {
+ AltosDebug.debug("remove preference %s\n", key);
editor.remove(key);
}
editor.remove(key);
}
@@
-114,4
+122,8
@@
public class AltosDroidPreferencesBackend implements AltosPreferencesBackend {
public File homeDirectory() {
return Environment.getExternalStorageDirectory();
}
public File homeDirectory() {
return Environment.getExternalStorageDirectory();
}
+
+ public void debug(String format, Object ... arguments) {
+ AltosDebug.debug(format, arguments);
+ }
}
}