Add logging.
Bug: 9661767
Change-Id: I7abf47536d923b36f81ccb99acce409d8fdf4bbd
diff --git a/src/com/android/exchange/eas/EasOperation.java b/src/com/android/exchange/eas/EasOperation.java
index 6f78134..6d615d7 100644
--- a/src/com/android/exchange/eas/EasOperation.java
+++ b/src/com/android/exchange/eas/EasOperation.java
@@ -272,7 +272,8 @@
// Note that unlike other errors, we do NOT return here; we just keep looping.
} else {
// All other errors.
- LogUtils.e(LOG_TAG, "Generic error: " + response.getStatus());
+ LogUtils.e(LOG_TAG, "Generic error for operation %s: status %d, result %d",
+ getCommand(), response.getStatus(), result);
if (syncResult != null) {
// TODO: Is this the best stat to increment?
++syncResult.stats.numIoExceptions;
@@ -339,9 +340,10 @@
/**
* Get the name of the operation, used as the "Cmd=XXX" query param in the request URI. Note
- * that if you override {@link #getRequestUri}, then this function may be unused, but it's
- * abstract in order to make it impossible to omit for the subclasses that do need it.
- * @return The name of the command for this operation as defined by the EAS protocol.
+ * that if you override {@link #getRequestUri}, then this function may be unused for normal
+ * operation, but all subclasses should return something non-null for use with logging.
+ * @return The name of the command for this operation as defined by the EAS protocol, or for
+ * commands that don't need it, a suitable descriptive name for logging.
*/
protected abstract String getCommand();
diff --git a/src/com/android/exchange/eas/EasOptions.java b/src/com/android/exchange/eas/EasOptions.java
index 3ef1070..c6c4d03 100644
--- a/src/com/android/exchange/eas/EasOptions.java
+++ b/src/com/android/exchange/eas/EasOptions.java
@@ -67,9 +67,13 @@
return mProtocolVersion;
}
+ /**
+ * Note that this operation does not actually use this name when forming the request.
+ * @return A useful name for logging this operation.
+ */
@Override
protected String getCommand() {
- return null;
+ return "OPTIONS";
}
@Override