Skip to content

Commit

Permalink
Remove a redundant TODO in Util
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 601820851
(cherry picked from commit eb3173a)
  • Loading branch information
oceanjules authored and SheenaChhabra committed Feb 8, 2024
1 parent 4560611 commit 826f20d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3338,11 +3338,10 @@ public static boolean tableExists(SQLiteDatabase database, String tableName) {
* <p>For example: android.media.MediaCodec.error_1 or android.media.MediaDrm.error_neg_2.
*
* @param diagnosticsInfo A string from which to parse the error code.
* @return The parser error code, or 0 if an error code could not be parsed.
* @return The parsed error code, or 0 if an error code could not be parsed.
*/
@UnstableApi
public static int getErrorCodeFromPlatformDiagnosticsInfo(@Nullable String diagnosticsInfo) {
// TODO (internal b/192337376): Change 0 for ERROR_UNKNOWN once available.
if (diagnosticsInfo == null) {
return 0;
}
Expand All @@ -3354,7 +3353,7 @@ public static int getErrorCodeFromPlatformDiagnosticsInfo(@Nullable String diagn
String digitsSection = strings[length - 1];
boolean isNegative = length >= 3 && "neg".equals(strings[length - 2]);
try {
int errorCode = Integer.parseInt(Assertions.checkNotNull(digitsSection));
int errorCode = Integer.parseInt(checkNotNull(digitsSection));
return isNegative ? -errorCode : errorCode;
} catch (NumberFormatException e) {
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,6 @@ public void getErrorCodeFromPlatformDiagnosticsInfo_withValidInput_returnsExpect

@Test
public void getErrorCodeFromPlatformDiagnosticsInfo_withInvalidInput_returnsZero() {
// TODO (internal b/192337376): Change 0 for ERROR_UNKNOWN once available.
assertThat(Util.getErrorCodeFromPlatformDiagnosticsInfo("")).isEqualTo(0);
assertThat(Util.getErrorCodeFromPlatformDiagnosticsInfo("android.media.MediaDrm.empty"))
.isEqualTo(0);
Expand Down

0 comments on commit 826f20d

Please sign in to comment.