Update to mobile data limiting
- Moved non-key strings from string_keys.xml to strings.xml - Code style changes - Replaced a hard coded key string with resource constant
This commit is contained in:
parent
d1b0cd74be
commit
646fa877ba
3 changed files with 34 additions and 34 deletions
|
|
@ -71,15 +71,11 @@ public final class ListHelper {
|
|||
|
||||
// If the user has chosen to limit resolution to conserve mobile data
|
||||
// usage then we should also limit our audio usage.
|
||||
int result;
|
||||
if (isLimitingDataUsage(context)) {
|
||||
result = getMostCompactAudioIndex(defaultFormat, audioStreams);
|
||||
return getMostCompactAudioIndex(defaultFormat, audioStreams);
|
||||
} else {
|
||||
return getHighestQualityAudioIndex(defaultFormat, audioStreams);
|
||||
}
|
||||
else {
|
||||
result = getHighestQualityAudioIndex(defaultFormat, audioStreams);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -109,8 +105,9 @@ public final class ListHelper {
|
|||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
// Load the prefered resolution otherwise the best available
|
||||
String resolution = preferences != null ? preferences.getString(context.getString(key),
|
||||
context.getString(value)) : context.getString(R.string.best_resolution_key);
|
||||
String resolution = preferences != null
|
||||
? preferences.getString(context.getString(key), context.getString(value))
|
||||
: context.getString(R.string.best_resolution_key);
|
||||
|
||||
String maxResolution = getResolutionLimit(context);
|
||||
if (maxResolution != null && compareVideoStreamResolution(maxResolution, resolution) < 1){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue