[go: nahoru, domu]

Merge "Intercept TRANSACTION_TOO_LARGE as RemoteException." into androidx-main
diff --git a/health/health-connect-client/src/main/java/androidx/health/platform/client/error/ErrorCode.kt b/health/health-connect-client/src/main/java/androidx/health/platform/client/error/ErrorCode.kt
index f9636ca..380b90f 100644
--- a/health/health-connect-client/src/main/java/androidx/health/platform/client/error/ErrorCode.kt
+++ b/health/health-connect-client/src/main/java/androidx/health/platform/client/error/ErrorCode.kt
@@ -35,7 +35,8 @@
     ErrorCode.INVALID_UID,
     ErrorCode.DATABASE_ERROR,
     ErrorCode.INTERNAL_ERROR,
-    ErrorCode.CHANGES_TOKEN_OUTDATED
+    ErrorCode.CHANGES_TOKEN_OUTDATED,
+    ErrorCode.TRANSACTION_TOO_LARGE
 )
 annotation class ErrorCode {
     companion object {
@@ -89,5 +90,8 @@
          * after its last sync and before this call.
          */
         const val CHANGES_TOKEN_OUTDATED = 10008
+
+        /** Remote end failed to deliver response, likely due to parcel too large. */
+        const val TRANSACTION_TOO_LARGE = 10010
     }
 }
diff --git a/health/health-connect-client/src/main/java/androidx/health/platform/client/impl/error/ErrorStatusConverter.kt b/health/health-connect-client/src/main/java/androidx/health/platform/client/impl/error/ErrorStatusConverter.kt
index ac7055e..6e6af7c 100644
--- a/health/health-connect-client/src/main/java/androidx/health/platform/client/impl/error/ErrorStatusConverter.kt
+++ b/health/health-connect-client/src/main/java/androidx/health/platform/client/impl/error/ErrorStatusConverter.kt
@@ -36,7 +36,8 @@
         ErrorCode.INVALID_UID to RemoteException::class,
         ErrorCode.DATABASE_ERROR to IOException::class,
         ErrorCode.INTERNAL_ERROR to RemoteException::class,
-        ErrorCode.CHANGES_TOKEN_OUTDATED to RemoteException::class
+        ErrorCode.CHANGES_TOKEN_OUTDATED to RemoteException::class,
+        ErrorCode.TRANSACTION_TOO_LARGE to RemoteException::class
     )
 
 @Suppress("ObsoleteSdkInt") // We want to target lower down to 14 in the future.