aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-04-02 18:12:43 -0700
committerScott Jackson <daneren2005@gmail.com>2013-04-02 18:12:43 -0700
commit223a63bfbe02f93f4e2272e4a6918e9d0651bdc3 (patch)
treee017632a16d0b9358c2cf947fd90f8a3798bed41 /subsonic-android
parentecdb65172e07745ea702f62e0e400239dce34138 (diff)
downloaddsub-223a63bfbe02f93f4e2272e4a6918e9d0651bdc3.tar.gz
dsub-223a63bfbe02f93f4e2272e4a6918e9d0651bdc3.tar.bz2
dsub-223a63bfbe02f93f4e2272e4a6918e9d0651bdc3.zip
Get rid of handlers that aren't being used
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java15
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/util/Util.java4
2 files changed, 8 insertions, 11 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 8890a5c7..da34ddaf 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -87,14 +87,12 @@ public class DownloadServiceImpl extends Service implements DownloadService {
private final IBinder binder = new SimpleServiceBinder<DownloadService>(this);
private Looper mediaPlayerLooper;
- private Handler mediaPlayerHandler;
private MediaPlayer mediaPlayer;
private MediaPlayer nextMediaPlayer;
private boolean nextSetup = false;
private boolean isPartial = true;
private final List<DownloadFile> downloadList = new ArrayList<DownloadFile>();
private final List<DownloadFile> backgroundDownloadList = new ArrayList<DownloadFile>();
- private final Handler handler = new Handler();
private final DownloadServiceLifecycleSupport lifecycleSupport = new DownloadServiceLifecycleSupport(this);
private final ShufflePlayBuffer shufflePlayBuffer = new ShufflePlayBuffer(this);
@@ -167,7 +165,6 @@ public class DownloadServiceImpl extends Service implements DownloadService {
});
mediaPlayerLooper = Looper.myLooper();
- mediaPlayerHandler = new Handler(mediaPlayerLooper);
Looper.loop();
}
}).start();
@@ -242,7 +239,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
if(nextPlayingTask != null) {
nextPlayingTask.cancel();
}
- Util.hidePlayingNotification(this, this, handler);
+ Util.hidePlayingNotification(this, this);
instance = null;
}
@@ -517,7 +514,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
mRemoteControl.updateMetadata(this, currentPlaying.getSong());
} else {
Util.broadcastNewTrackInfo(this, null);
- Util.hidePlayingNotification(this, this, handler);
+ Util.hidePlayingNotification(this, this);
}
}
@@ -836,16 +833,16 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
if (show) {
- Util.showPlayingNotification(this, this, handler, currentPlaying.getSong());
+ Util.showPlayingNotification(this, this, currentPlaying.getSong());
} else if (pause) {
SharedPreferences prefs = Util.getPreferences(this);
if(prefs.getBoolean(Constants.PREFERENCES_KEY_PERSISTENT_NOTIFICATION, false)) {
- Util.showPlayingNotification(this, this, handler, currentPlaying.getSong());
+ Util.showPlayingNotification(this, this, currentPlaying.getSong());
} else {
- Util.hidePlayingNotification(this, this, handler);
+ Util.hidePlayingNotification(this, this);
}
} else if(hide) {
- Util.hidePlayingNotification(this, this, handler);
+ Util.hidePlayingNotification(this, this);
}
mRemoteControl.setPlaybackState(playerState.getRemoteControlClientPlayState());
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Util.java b/subsonic-android/src/github/daneren2005/dsub/util/Util.java
index 034ab1d7..6e5d31a9 100644
--- a/subsonic-android/src/github/daneren2005/dsub/util/Util.java
+++ b/subsonic-android/src/github/daneren2005/dsub/util/Util.java
@@ -644,7 +644,7 @@ public final class Util {
.show();
}
- public static void showPlayingNotification(final Context context, final DownloadServiceImpl downloadService, Handler handler, MusicDirectory.Entry song) {
+ public static void showPlayingNotification(final Context context, final DownloadServiceImpl downloadService, MusicDirectory.Entry song) {
// Set the icon, scrolling text and timestamp
final Notification notification = new Notification(R.drawable.stat_notify_playing, song.getTitle(), System.currentTimeMillis());
notification.flags |= Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT;
@@ -738,7 +738,7 @@ public final class Util {
rv.setOnClickPendingIntent(R.id.control_next, pendingIntent);
}
- public static void hidePlayingNotification(final Context context, final DownloadServiceImpl downloadService, Handler handler) {
+ public static void hidePlayingNotification(final Context context, final DownloadServiceImpl downloadService) {
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancelAll();