renamed checkedonSize
This commit is contained in:
parent
36626bbdb9
commit
0dbdbdd1ed
|
@ -35,7 +35,7 @@ public class FeedMedia extends FeedFile implements Playable {
|
||||||
* 2) By default all FeedMedia have a size of 0 if we don't know it,
|
* 2) By default all FeedMedia have a size of 0 if we don't know it,
|
||||||
* so this won't conflict with existing practice.
|
* so this won't conflict with existing practice.
|
||||||
*/
|
*/
|
||||||
private static final int CHECKED_ON_SIZE = Integer.MIN_VALUE;
|
private static final int CHECKED_ON_SIZE_BUT_UNKNOWN = Integer.MIN_VALUE;
|
||||||
|
|
||||||
private int duration;
|
private int duration;
|
||||||
private int position; // Current position in file
|
private int position; // Current position in file
|
||||||
|
@ -212,12 +212,12 @@ public class FeedMedia extends FeedFile implements Playable {
|
||||||
* Indicates we asked the service what the size was, but didn't
|
* Indicates we asked the service what the size was, but didn't
|
||||||
* get a valid answer and we shoudln't check using the network again.
|
* get a valid answer and we shoudln't check using the network again.
|
||||||
*/
|
*/
|
||||||
public void setCheckedOnSize() {
|
public void setCheckedOnSizeButUnknown() {
|
||||||
this.size = CHECKED_ON_SIZE;
|
this.size = CHECKED_ON_SIZE_BUT_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkedOnSize() {
|
public boolean checkedOnSizeButUnknown() {
|
||||||
return (CHECKED_ON_SIZE == this.size);
|
return (CHECKED_ON_SIZE_BUT_UNKNOWN == this.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMime_type() {
|
public String getMime_type() {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class FeedMediaSizeService extends IntentService {
|
||||||
if(mediaFile.exists()) {
|
if(mediaFile.exists()) {
|
||||||
size = mediaFile.length();
|
size = mediaFile.length();
|
||||||
}
|
}
|
||||||
} else if (false == media.checkedOnSize()) {
|
} else if (false == media.checkedOnSizeButUnknown()) {
|
||||||
// only query the network if we haven't already checked
|
// only query the network if we haven't already checked
|
||||||
HttpURLConnection conn = null;
|
HttpURLConnection conn = null;
|
||||||
try {
|
try {
|
||||||
|
@ -63,7 +63,7 @@ public class FeedMediaSizeService extends IntentService {
|
||||||
}
|
}
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
// they didn't tell us the size, but we don't want to keep querying on it
|
// they didn't tell us the size, but we don't want to keep querying on it
|
||||||
media.setCheckedOnSize();
|
media.setCheckedOnSizeButUnknown();
|
||||||
} else {
|
} else {
|
||||||
media.setSize(size);
|
media.setSize(size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue