mirror of
https://github.com/androidx/media.git
synced 2025-05-11 17:49:52 +08:00
seenCacheError should be set for all errors
PiperOrigin-RevId: 265662686
This commit is contained in:
parent
c3d6be3afd
commit
ad699b8ff6
@ -283,7 +283,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
}
|
}
|
||||||
openNextSource(false);
|
openNextSource(false);
|
||||||
return bytesRemaining;
|
return bytesRemaining;
|
||||||
} catch (IOException e) {
|
} catch (Throwable e) {
|
||||||
handleBeforeThrow(e);
|
handleBeforeThrow(e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
@ -325,6 +325,9 @@ public final class CacheDataSource implements DataSource {
|
|||||||
}
|
}
|
||||||
handleBeforeThrow(e);
|
handleBeforeThrow(e);
|
||||||
throw e;
|
throw e;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
handleBeforeThrow(e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +352,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
notifyBytesRead();
|
notifyBytesRead();
|
||||||
try {
|
try {
|
||||||
closeCurrentSource();
|
closeCurrentSource();
|
||||||
} catch (IOException e) {
|
} catch (Throwable e) {
|
||||||
handleBeforeThrow(e);
|
handleBeforeThrow(e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
@ -516,7 +519,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleBeforeThrow(IOException exception) {
|
private void handleBeforeThrow(Throwable exception) {
|
||||||
if (isReadingFromCache() || exception instanceof CacheException) {
|
if (isReadingFromCache() || exception instanceof CacheException) {
|
||||||
seenCacheError = true;
|
seenCacheError = true;
|
||||||
}
|
}
|
||||||
|
@ -359,7 +359,7 @@ public final class CacheUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ static boolean isCausedByPositionOutOfRange(IOException e) {
|
/* package */ static boolean isCausedByPositionOutOfRange(IOException e) {
|
||||||
Throwable cause = e;
|
Throwable cause = e;
|
||||||
while (cause != null) {
|
while (cause != null) {
|
||||||
if (cause instanceof DataSourceException) {
|
if (cause instanceof DataSourceException) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user