From 5005c38e8b9587f361e12cdd59aa56d0e4201fd4 Mon Sep 17 00:00:00 2001 From: Adrian Ulrich Date: Sun, 1 Sep 2013 09:43:36 +0200 Subject: [PATCH] remove some honeycomb legacy stuff --- .../android/vanilla/FullPlaybackActivity.java | 5 --- .../android/vanilla/PlaybackService.java | 35 +++++++------------ 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/src/ch/blinkenlights/android/vanilla/FullPlaybackActivity.java b/src/ch/blinkenlights/android/vanilla/FullPlaybackActivity.java index 5450fbff..e65c2667 100644 --- a/src/ch/blinkenlights/android/vanilla/FullPlaybackActivity.java +++ b/src/ch/blinkenlights/android/vanilla/FullPlaybackActivity.java @@ -354,9 +354,6 @@ public class FullPlaybackActivity extends PlaybackActivity @Override public boolean onCreateOptionsMenu(Menu menu) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - menu.add(0, MENU_LIBRARY, 0, R.string.library).setIcon(R.drawable.ic_menu_music_library); - } super.onCreateOptionsMenu(menu); menu.add(0, MENU_CLEAR_QUEUE, 0, R.string.clear_queue).setIcon(R.drawable.ic_menu_close_clear_cancel); menu.add(0, MENU_ENQUEUE_ALBUM, 0, R.string.enqueue_current_album).setIcon(R.drawable.ic_menu_add); @@ -503,8 +500,6 @@ public class FullPlaybackActivity extends PlaybackActivity TableLayout table = mInfoTable; if (table == null) return; - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD_MR1) - visible = false; table.setColumnCollapsed(0, !visible); // Make title, album, and artist multi-line when extra info is visible diff --git a/src/ch/blinkenlights/android/vanilla/PlaybackService.java b/src/ch/blinkenlights/android/vanilla/PlaybackService.java index 93347be8..093891f8 100644 --- a/src/ch/blinkenlights/android/vanilla/PlaybackService.java +++ b/src/ch/blinkenlights/android/vanilla/PlaybackService.java @@ -1870,26 +1870,22 @@ public final class PlaybackService extends Service String title = song.title; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - int playButton = playing ? R.drawable.pause : R.drawable.play; - views.setImageViewResource(R.id.play_pause, playButton); + int playButton = playing ? R.drawable.pause : R.drawable.play; + views.setImageViewResource(R.id.play_pause, playButton); - ComponentName service = new ComponentName(this, PlaybackService.class); + ComponentName service = new ComponentName(this, PlaybackService.class); - Intent playPause = new Intent(PlaybackService.ACTION_TOGGLE_PLAYBACK_NOTIFICATION); - playPause.setComponent(service); - views.setOnClickPendingIntent(R.id.play_pause, PendingIntent.getService(this, 0, playPause, 0)); + Intent playPause = new Intent(PlaybackService.ACTION_TOGGLE_PLAYBACK_NOTIFICATION); + playPause.setComponent(service); + views.setOnClickPendingIntent(R.id.play_pause, PendingIntent.getService(this, 0, playPause, 0)); - Intent next = new Intent(PlaybackService.ACTION_NEXT_SONG); - next.setComponent(service); - views.setOnClickPendingIntent(R.id.next, PendingIntent.getService(this, 0, next, 0)); + Intent next = new Intent(PlaybackService.ACTION_NEXT_SONG); + next.setComponent(service); + views.setOnClickPendingIntent(R.id.next, PendingIntent.getService(this, 0, next, 0)); - Intent close = new Intent(PlaybackService.ACTION_CLOSE_NOTIFICATION); - close.setComponent(service); - views.setOnClickPendingIntent(R.id.close, PendingIntent.getService(this, 0, close, 0)); - } else if (!playing) { - title = getResources().getString(R.string.notification_title_paused, song.title); - } + Intent close = new Intent(PlaybackService.ACTION_CLOSE_NOTIFICATION); + close.setComponent(service); + views.setOnClickPendingIntent(R.id.close, PendingIntent.getService(this, 0, close, 0)); views.setTextViewText(R.id.title, title); views.setTextViewText(R.id.artist, song.artist); @@ -1918,12 +1914,7 @@ public final class PlaybackService extends Service case AudioManager.AUDIOFOCUS_LOSS: case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT: mDuckedLoss = false; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - // On Honeycomb and above we have controls in the notification. - // Ensure they are shown when music is paused from focus loss - // so music can easily be started again if desired. - mForceNotificationVisible = true; - } + mForceNotificationVisible = true; unsetFlag(FLAG_PLAYING); break; case AudioManager.AUDIOFOCUS_GAIN: