Loading core/java/android/content/AbstractTableMerger.java +28 −20 Original line number Original line Diff line number Diff line Loading @@ -61,8 +61,10 @@ public abstract class AbstractTableMerger _SYNC_ID +"=? and " + _SYNC_ACCOUNT + "=?"; _SYNC_ID +"=? and " + _SYNC_ACCOUNT + "=?"; private static final String SELECT_BY_ID = BaseColumns._ID +"=?"; private static final String SELECT_BY_ID = BaseColumns._ID +"=?"; // The last clause rejects events with a null _SYNC_VERSION if they've already been synced private static final String SELECT_UNSYNCED = "" private static final String SELECT_UNSYNCED = "" + _SYNC_DIRTY + " > 0 and (" + _SYNC_ACCOUNT + "=? or " + _SYNC_ACCOUNT + " is null)"; + _SYNC_DIRTY + " > 0 and (" + _SYNC_ACCOUNT + "=? or " + _SYNC_ACCOUNT + " is null) " + "and (" + _SYNC_VERSION + " is not null or " + _SYNC_ACCOUNT + " is null)"; public AbstractTableMerger(SQLiteDatabase database, public AbstractTableMerger(SQLiteDatabase database, String table, Uri tableURL, String deletedTable, String table, Uri tableURL, String deletedTable, Loading Loading @@ -365,6 +367,11 @@ public abstract class AbstractTableMerger if (!TextUtils.isEmpty(localSyncID)) { if (!TextUtils.isEmpty(localSyncID)) { // An existing server item has changed // An existing server item has changed // If serverSyncVersion is null, there is no edit URL; // server won't let this change be written. // Just hold onto it, I guess, in case the server permissions // change later. if (serverSyncVersion != null) { boolean recordChanged = (localSyncVersion == null) || boolean recordChanged = (localSyncVersion == null) || !serverSyncVersion.equals(localSyncVersion); !serverSyncVersion.equals(localSyncVersion); if (recordChanged) { if (recordChanged) { Loading @@ -387,6 +394,7 @@ public abstract class AbstractTableMerger update = true; update = true; } } } } } } else { } else { // the local db doesn't know about this record so add it // the local db doesn't know about this record so add it if (Log.isLoggable(TAG, Log.VERBOSE)) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Loading Loading
core/java/android/content/AbstractTableMerger.java +28 −20 Original line number Original line Diff line number Diff line Loading @@ -61,8 +61,10 @@ public abstract class AbstractTableMerger _SYNC_ID +"=? and " + _SYNC_ACCOUNT + "=?"; _SYNC_ID +"=? and " + _SYNC_ACCOUNT + "=?"; private static final String SELECT_BY_ID = BaseColumns._ID +"=?"; private static final String SELECT_BY_ID = BaseColumns._ID +"=?"; // The last clause rejects events with a null _SYNC_VERSION if they've already been synced private static final String SELECT_UNSYNCED = "" private static final String SELECT_UNSYNCED = "" + _SYNC_DIRTY + " > 0 and (" + _SYNC_ACCOUNT + "=? or " + _SYNC_ACCOUNT + " is null)"; + _SYNC_DIRTY + " > 0 and (" + _SYNC_ACCOUNT + "=? or " + _SYNC_ACCOUNT + " is null) " + "and (" + _SYNC_VERSION + " is not null or " + _SYNC_ACCOUNT + " is null)"; public AbstractTableMerger(SQLiteDatabase database, public AbstractTableMerger(SQLiteDatabase database, String table, Uri tableURL, String deletedTable, String table, Uri tableURL, String deletedTable, Loading Loading @@ -365,6 +367,11 @@ public abstract class AbstractTableMerger if (!TextUtils.isEmpty(localSyncID)) { if (!TextUtils.isEmpty(localSyncID)) { // An existing server item has changed // An existing server item has changed // If serverSyncVersion is null, there is no edit URL; // server won't let this change be written. // Just hold onto it, I guess, in case the server permissions // change later. if (serverSyncVersion != null) { boolean recordChanged = (localSyncVersion == null) || boolean recordChanged = (localSyncVersion == null) || !serverSyncVersion.equals(localSyncVersion); !serverSyncVersion.equals(localSyncVersion); if (recordChanged) { if (recordChanged) { Loading @@ -387,6 +394,7 @@ public abstract class AbstractTableMerger update = true; update = true; } } } } } } else { } else { // the local db doesn't know about this record so add it // the local db doesn't know about this record so add it if (Log.isLoggable(TAG, Log.VERBOSE)) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Loading