am f728411b: Merge "Fix bug #3395355 ("adb shell dumpsys content" should present human readable failure messages instead of error codes)" into honeycomb
* commit 'f728411ba40d71a40a0cb0dbfcaa44764af17692': Fix bug #3395355 ("adb shell dumpsys content" should present human readable failure messages instead of error codes)
This commit is contained in:
@@ -1128,12 +1128,45 @@ public class SyncManager implements OnAccountsUpdateListener {
|
||||
pw.print(formatTime(status.initialFailureTime));
|
||||
pw.print(" lastTime=");
|
||||
pw.println(formatTime(status.lastFailureTime));
|
||||
pw.print(" message: "); pw.println(status.lastFailureMesg);
|
||||
int errCode = status.getLastFailureMesgAsInt(0);
|
||||
pw.print(" message: "); pw.println(
|
||||
getLastFailureMessage(errCode) + " (" + errCode + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getLastFailureMessage(int code) {
|
||||
switch (code) {
|
||||
case ContentResolver.SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS:
|
||||
return "sync already in progress";
|
||||
|
||||
case ContentResolver.SYNC_ERROR_AUTHENTICATION:
|
||||
return "authentication error";
|
||||
|
||||
case ContentResolver.SYNC_ERROR_IO:
|
||||
return "I/O error";
|
||||
|
||||
case ContentResolver.SYNC_ERROR_PARSE:
|
||||
return "parse error";
|
||||
|
||||
case ContentResolver.SYNC_ERROR_CONFLICT:
|
||||
return "conflict error";
|
||||
|
||||
case ContentResolver.SYNC_ERROR_TOO_MANY_DELETIONS:
|
||||
return "too many deletions error";
|
||||
|
||||
case ContentResolver.SYNC_ERROR_TOO_MANY_RETRIES:
|
||||
return "too many retries error";
|
||||
|
||||
case ContentResolver.SYNC_ERROR_INTERNAL:
|
||||
return "internal error";
|
||||
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
private void dumpTimeSec(PrintWriter pw, long time) {
|
||||
pw.print(time/1000); pw.print('.'); pw.print((time/100)%10);
|
||||
pw.print('s');
|
||||
|
||||
Reference in New Issue
Block a user