diff --git a/app/src/main/java/net/nullsum/audinaut/audiofx/AudioEffectsController.java b/app/src/main/java/net/nullsum/audinaut/audiofx/AudioEffectsController.java index d9505f2..9b07364 100644 --- a/app/src/main/java/net/nullsum/audinaut/audiofx/AudioEffectsController.java +++ b/app/src/main/java/net/nullsum/audinaut/audiofx/AudioEffectsController.java @@ -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; diff --git a/app/src/main/java/net/nullsum/audinaut/audiofx/EqualizerController.java b/app/src/main/java/net/nullsum/audinaut/audiofx/EqualizerController.java index 1801647..662b2ef 100644 --- a/app/src/main/java/net/nullsum/audinaut/audiofx/EqualizerController.java +++ b/app/src/main/java/net/nullsum/audinaut/audiofx/EqualizerController.java @@ -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; diff --git a/app/src/main/java/net/nullsum/audinaut/domain/User.java b/app/src/main/java/net/nullsum/audinaut/domain/User.java index cabbf95..36e67d7 100644 --- a/app/src/main/java/net/nullsum/audinaut/domain/User.java +++ b/app/src/main/java/net/nullsum/audinaut/domain/User.java @@ -39,17 +39,12 @@ public class User implements Serializable { ROLES.add(COMMENT); } - private final List settings = new ArrayList<>(); private List 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; diff --git a/app/src/main/java/net/nullsum/audinaut/fragments/SelectArtistFragment.java b/app/src/main/java/net/nullsum/audinaut/fragments/SelectArtistFragment.java index c60090a..ffbd86d 100644 --- a/app/src/main/java/net/nullsum/audinaut/fragments/SelectArtistFragment.java +++ b/app/src/main/java/net/nullsum/audinaut/fragments/SelectArtistFragment.java @@ -176,13 +176,11 @@ public class SelectArtistFragment extends SelectRecyclerFragment i entries = indexes.getEntries(); items.addAll(entries); } else { - List 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(); diff --git a/app/src/main/java/net/nullsum/audinaut/fragments/SelectPlaylistFragment.java b/app/src/main/java/net/nullsum/audinaut/fragments/SelectPlaylistFragment.java index cca30f6..00d3e4e 100644 --- a/app/src/main/java/net/nullsum/audinaut/fragments/SelectPlaylistFragment.java +++ b/app/src/main/java/net/nullsum/audinaut/fragments/SelectPlaylistFragment.java @@ -106,15 +106,6 @@ public class SelectPlaylistFragment extends SelectRecyclerFragment { @Override public SectionAdapter getAdapter(List playlists) { - List 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); } diff --git a/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java b/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java index fd0fbb7..53456a4 100644 --- a/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java +++ b/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java @@ -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 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 songs, List 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()) { diff --git a/app/src/main/java/net/nullsum/audinaut/service/parser/UserParser.java b/app/src/main/java/net/nullsum/audinaut/service/parser/UserParser.java index da4952e..7beb368 100644 --- a/app/src/main/java/net/nullsum/audinaut/service/parser/UserParser.java +++ b/app/src/main/java/net/nullsum/audinaut/service/parser/UserParser.java @@ -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)); - } - } } diff --git a/app/src/main/java/net/nullsum/audinaut/util/MenuUtil.java b/app/src/main/java/net/nullsum/audinaut/util/MenuUtil.java index a6c3078..7b3fb8e 100644 --- a/app/src/main/java/net/nullsum/audinaut/util/MenuUtil.java +++ b/app/src/main/java/net/nullsum/audinaut/util/MenuUtil.java @@ -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) { diff --git a/app/src/main/java/net/nullsum/audinaut/view/CacheLocationPreference.java b/app/src/main/java/net/nullsum/audinaut/view/CacheLocationPreference.java index b617e6c..23ae861 100644 --- a/app/src/main/java/net/nullsum/audinaut/view/CacheLocationPreference.java +++ b/app/src/main/java/net/nullsum/audinaut/view/CacheLocationPreference.java @@ -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);