fix ANDROID-36: issues with ResultCode

This commit is contained in:
Brenton Bostick 2023-01-31 12:48:49 -05:00
parent 34ff813e2a
commit acd8b95114

View File

@ -44,6 +44,11 @@ public enum ResultCode {
*/ */
RESULT_OK(0), RESULT_OK(0),
/**
* Call produced no error but no action was taken
*/
RESULT_OK_IGNORED(1),
// Fatal errors (>=100, <1000) // Fatal errors (>=100, <1000)
/** /**
* Ran out of memory * Ran out of memory
@ -81,6 +86,8 @@ public enum ResultCode {
switch (id) { switch (id) {
case 0: case 0:
return RESULT_OK; return RESULT_OK;
case 1:
return RESULT_OK_IGNORED;
case 100: case 100:
return RESULT_FATAL_ERROR_OUT_OF_MEMORY; return RESULT_FATAL_ERROR_OUT_OF_MEMORY;
case 101: case 101:
@ -98,7 +105,7 @@ public enum ResultCode {
} }
} }
public boolean isFatal(int id) { public boolean isFatal() {
return (id > 100 && id < 1000); return (id >= 100 && id < 1000);
} }
} }