Remove unreachable

This commit is contained in:
Andrew Rabert 2018-04-24 20:27:13 -04:00
parent d8ee4d012c
commit d84327db02
9 changed files with 4 additions and 68 deletions

View File

@ -23,7 +23,7 @@ import android.content.Context;
public class AudioEffectsController {
private final Context context;
private int audioSessionId = 0;
private int audioSessionId;
private EqualizerController equalizerController;

View File

@ -43,7 +43,7 @@ public class EqualizerController {
private boolean loudnessAvailable = false;
private LoudnessEnhancerController loudnessEnhancerController;
private boolean released = false;
private int audioSessionId = 0;
private int audioSessionId;
public EqualizerController(Context context, int audioSessionId) {
this.context = context;

View File

@ -39,17 +39,12 @@ public class User implements Serializable {
ROLES.add(COMMENT);
}
private final List<Setting> settings = new ArrayList<>();
private List<Setting> musicFolders;
public User() {
}
public void addSetting(String name, Boolean value) {
settings.add(new Setting(name, value));
}
public void addMusicFolder(MusicFolder musicFolder) {
if (musicFolders == null) {
musicFolders = new ArrayList<>();
@ -66,10 +61,6 @@ public class User implements Serializable {
private String name;
private Boolean value;
public Setting() {
}
public Setting(String name, Boolean value) {
this.name = name;
this.value = value;

View File

@ -176,13 +176,11 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Serializable> i
entries = indexes.getEntries();
items.addAll(entries);
} else {
List<Artist> artists = new ArrayList<>();
MusicDirectory dir = musicService.getMusicDirectory(groupId, groupName, refresh, context, listener);
for (Entry entry : dir.getChildren(true, false)) {
Artist artist = new Artist();
artist.setId(entry.getId());
artist.setName(entry.getTitle());
artists.add(artist);
}
Indexes indexes = new Indexes();

View File

@ -106,15 +106,6 @@ public class SelectPlaylistFragment extends SelectRecyclerFragment<Playlist> {
@Override
public SectionAdapter<Playlist> getAdapter(List<Playlist> playlists) {
List<Playlist> mine = new ArrayList<>();
String currentUsername = UserUtil.getCurrentUsername(context);
for (Playlist playlist : playlists) {
if (playlist.getOwner() == null || playlist.getOwner().equals(currentUsername)) {
mine.add(playlist);
}
}
return new PlaylistAdapter(context, playlists, getImageLoader(), largeAlbums, this);
}

View File

@ -232,8 +232,6 @@ public class DownloadService extends Service {
}
} else if (level >= ComponentCallbacks2.TRIM_MEMORY_MODERATE) {
imageLoader.onLowMemory(0.25f);
} else if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
imageLoader.onLowMemory(0.75f);
}
}
}
@ -336,7 +334,6 @@ public class DownloadService extends Service {
}
revision++;
onSongsChanged();
updateRemotePlaylist();
if (shuffle) {
shuffle();
@ -391,22 +388,6 @@ public class DownloadService extends Service {
lifecycleSupport.serializeDownloadQueue();
}
private synchronized void updateRemotePlaylist() {
List<DownloadFile> playlist = new ArrayList<>();
if (currentPlaying != null) {
int index = downloadList.indexOf(currentPlaying);
if (index == -1) {
index = 0;
}
int size = size();
int end = index + REMOTE_PLAYLIST_TOTAL;
for (int i = index; i < size && i < end; i++) {
playlist.add(downloadList.get(i));
}
}
}
public synchronized void restore(List<MusicDirectory.Entry> songs, List<MusicDirectory.Entry> toDelete, int currentPlayingIndex, int currentPlayingPosition) {
SharedPreferences prefs = Util.getPreferences(this);
if (prefs.getBoolean(Constants.PREFERENCES_KEY_REMOVE_PLAYED, false)) {
@ -481,7 +462,6 @@ public class DownloadService extends Service {
revision++;
onSongsChanged();
lifecycleSupport.serializeDownloadQueue();
updateRemotePlaylist();
setNextPlaying();
}
@ -551,7 +531,6 @@ public class DownloadService extends Service {
}
}
lifecycleSupport.serializeDownloadQueue();
updateRemotePlaylist();
onSongsChanged();
}
@ -589,7 +568,6 @@ public class DownloadService extends Service {
}
setCurrentPlaying(null);
lifecycleSupport.serializeDownloadQueue();
updateRemotePlaylist();
setNextPlaying();
if (proxy != null) {
proxy.stop();
@ -618,7 +596,6 @@ public class DownloadService extends Service {
revision++;
onSongsChanged();
lifecycleSupport.serializeDownloadQueue();
updateRemotePlaylist();
if (downloadFile == nextPlaying) {
setNextPlaying();
}
@ -873,7 +850,6 @@ public class DownloadService extends Service {
proxy = null;
}
checkDownloads();
updateRemotePlaylist();
}
/**
@ -1329,8 +1305,6 @@ public class DownloadService extends Service {
setPlayerState(PAUSED);
onSongProgress();
}
updateRemotePlaylist();
}
// Only call when starting, setPlayerState(PAUSED) already calls this
@ -1650,7 +1624,6 @@ public class DownloadService extends Service {
if (revisionBefore != revision) {
onSongsChanged();
updateRemotePlaylist();
}
if (wasEmpty && !downloadList.isEmpty()) {

View File

@ -49,11 +49,6 @@ public class UserParser extends AbstractParser {
tagName = getElementName();
if ("user".equals(tagName)) {
user = new User();
for (String role : User.ROLES) {
parseSetting(user, role);
}
result.add(user);
} else if ("error".equals(tagName)) {
handleError();
@ -92,11 +87,4 @@ public class UserParser extends AbstractParser {
MusicService musicService = MusicServiceFactory.getMusicService(context);
return musicService.getMusicFolders(false, context, null);
}
private void parseSetting(User user, String name) {
String value = get(name);
if (value != null) {
user.addSetting(name, "true".equals(value));
}
}
}

View File

@ -60,7 +60,7 @@ public final class MenuUtil {
}
// Apply similar logic to album views
else if (updateView instanceof AlbumView || updateView instanceof ArtistView || updateView instanceof ArtistEntryView) {
File folder = null;
File folder;
if (updateView instanceof AlbumView) {
folder = ((AlbumView) updateView).getFile();
} else if (updateView instanceof ArtistView) {

View File

@ -77,14 +77,9 @@ public class CacheLocationPreference extends EditTextPreference {
for (File dir : dirs) {
try {
if (dir != null) {
if (Environment.isExternalStorageRemovable(dir)) {
} else {
if (!Environment.isExternalStorageRemovable(dir)) {
internalDir = dir;
}
if (internalDir != null && null != null) {
break;
}
}
} catch (Exception e) {
Log.e(TAG, "Failed to check if is external", e);