Merge branch 'readonly-p4-donut' into donut
This commit is contained in:
commit
ae1213c4c9
@ -112,13 +112,6 @@ public class Account implements Serializable {
|
|||||||
public void refresh(Preferences preferences) {
|
public void refresh(Preferences preferences) {
|
||||||
mPreferences = preferences;
|
mPreferences = preferences;
|
||||||
|
|
||||||
/**
|
|
||||||
* Note: Until we have resolved the potential for synchronization failures in
|
|
||||||
* SharedPreferences, we're going to do a global lock around the read and write
|
|
||||||
* functions.
|
|
||||||
*/
|
|
||||||
synchronized (Account.class) {
|
|
||||||
|
|
||||||
mStoreUri = Utility.base64Decode(preferences.mSharedPreferences.getString(mUuid
|
mStoreUri = Utility.base64Decode(preferences.mSharedPreferences.getString(mUuid
|
||||||
+ ".storeUri", null));
|
+ ".storeUri", null));
|
||||||
mLocalStoreUri = preferences.mSharedPreferences.getString(mUuid + ".localStoreUri", null);
|
mLocalStoreUri = preferences.mSharedPreferences.getString(mUuid + ".localStoreUri", null);
|
||||||
@ -165,7 +158,6 @@ public class Account implements Serializable {
|
|||||||
mSyncWindow = preferences.mSharedPreferences.getInt(mUuid + KEY_SYNC_WINDOW,
|
mSyncWindow = preferences.mSharedPreferences.getInt(mUuid + KEY_SYNC_WINDOW,
|
||||||
SYNC_WINDOW_USER);
|
SYNC_WINDOW_USER);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public String getUuid() {
|
public String getUuid() {
|
||||||
return mUuid;
|
return mUuid;
|
||||||
@ -228,12 +220,6 @@ public class Account implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void delete(Preferences preferences) {
|
public void delete(Preferences preferences) {
|
||||||
/**
|
|
||||||
* Note: Until we have resolved the potential for synchronization failures in
|
|
||||||
* SharedPreferences, we're going to do a global lock around the read and write
|
|
||||||
* functions.
|
|
||||||
*/
|
|
||||||
synchronized (Account.class) {
|
|
||||||
String[] uuids = preferences.mSharedPreferences.getString("accountUuids", "").split(",");
|
String[] uuids = preferences.mSharedPreferences.getString("accountUuids", "").split(",");
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
for (int i = 0, length = uuids.length; i < length; i++) {
|
for (int i = 0, length = uuids.length; i < length; i++) {
|
||||||
@ -272,17 +258,10 @@ public class Account implements Serializable {
|
|||||||
|
|
||||||
editor.commit();
|
editor.commit();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void save(Preferences preferences) {
|
public void save(Preferences preferences) {
|
||||||
mPreferences = preferences;
|
mPreferences = preferences;
|
||||||
|
|
||||||
/**
|
|
||||||
* Note: Until we have resolved the potential for synchronization failures in
|
|
||||||
* SharedPreferences, we're going to do a global lock around the read and write
|
|
||||||
* functions.
|
|
||||||
*/
|
|
||||||
synchronized (Account.class) {
|
|
||||||
if (!preferences.mSharedPreferences.getString("accountUuids", "").contains(mUuid)) {
|
if (!preferences.mSharedPreferences.getString("accountUuids", "").contains(mUuid)) {
|
||||||
/*
|
/*
|
||||||
* When the account is first created we assign it a unique account number. The
|
* When the account is first created we assign it a unique account number. The
|
||||||
@ -346,7 +325,6 @@ public class Account implements Serializable {
|
|||||||
|
|
||||||
editor.commit();
|
editor.commit();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
Loading…
Reference in New Issue
Block a user