Commit 19501523 by olly Committed by Oliver Woodman

Tweak download notifications

1. Add string for STATE_CANCELED. Lint doesn't like that the
   switch statement on the state IntDef doesn't have a case
   for STATE_CANCELED. May as well add one, even if we're not
   planning on our demo app showing notifications for this
   state.
2. Replace non-human-readable error message with one provided
   by ErrorMessageProvider.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184120892
parent e8fb3078
......@@ -17,17 +17,15 @@ package com.google.android.exoplayer2.util;
import android.util.Pair;
/**
* Converts exceptions into error codes and user readable error messages.
*/
public interface ErrorMessageProvider<T extends Exception> {
/** Converts throwables into error codes and user readable error messages. */
public interface ErrorMessageProvider<T extends Throwable> {
/**
* Returns a pair consisting of an error code and a user readable error message for the given
* exception.
* throwable.
*
* @param exception The exception for which an error code and message should be generated.
* @param throwable The throwable for which an error code and message should be generated.
* @return A pair consisting of an error code and a user readable error message.
*/
Pair<Integer, String> getErrorMessage(T exception);
Pair<Integer, String> getErrorMessage(T throwable);
}
......@@ -24,9 +24,9 @@ android {
}
lintOptions {
// Truth depends on JUnit, which depends on java.lang.management, which is not part of
// Android. Remove this when JUnit 4.13 or later is used. See:
// https://github.com/junit-team/junit4/pull/1187.
// Truth depends on JUnit, which depends on java.lang.management, which
// is not part of Android. Remove this when JUnit 4.13 or later is used.
// See: https://github.com/junit-team/junit4/pull/1187.
disable 'InvalidPackage'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment