Skip to content

Commit

Permalink
Use POST for requesting user device synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreroman committed Sep 29, 2011
1 parent 985deb6 commit 28172e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/com/pixmob/droidlink/sync/SyncAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ private void doPerformSync(NetworkClient client, SharedPreferences prefs,

// Sync user devices.
try {
client.get("/devices/" + client.getDeviceId() + "/sync?token=" + syncToken);
final JSONObject data = new JSONObject();
data.put("token", syncToken);
client.post("/devices/" + client.getDeviceId() + "/sync", data);
} catch (IOException e) {
Log.e(TAG, "Device sync error: cannot sync", e);
syncResult.stats.numIoExceptions++;
Expand All @@ -478,6 +480,10 @@ private void doPerformSync(NetworkClient client, SharedPreferences prefs,
Log.e(TAG, "Authentication error: cannot sync", e);
syncResult.stats.numAuthExceptions++;
return;
} catch (JSONException e) {
Log.w(TAG, "Invalid sync token " + syncToken + ": cannot sync", e);
syncResult.stats.numIoExceptions++;
return;
}
}

Expand Down

0 comments on commit 28172e8

Please sign in to comment.