diff options
author | Danny Baumann <dannybaumann@web.de> | 2014-12-12 15:57:58 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2014-12-19 09:13:22 +0100 |
commit | 5223eb743062abf1a735bbb59bd37d0d486e500f (patch) | |
tree | a4af30e0185975feaff8d10d8324f16f4ea5a97a /src/com/cyanogenmod/eleven/utils/MusicUtils.java | |
parent | 62225e873bf4495bec1c81aa68b75d499bf7ad3e (diff) | |
download | android_packages_apps_Eleven-5223eb743062abf1a735bbb59bd37d0d486e500f.tar.gz android_packages_apps_Eleven-5223eb743062abf1a735bbb59bd37d0d486e500f.tar.bz2 android_packages_apps_Eleven-5223eb743062abf1a735bbb59bd37d0d486e500f.zip |
Improve notification UX.
- Add a proper notification icon (courtesy of Joey Rizzoli)
- Use separate notification modes to allow the user to dismiss the
notification when music isn't playing.
- Always show notification regardless whether an activity is in
foreground to ensure the notification doesn't pop up out of the blue
when ending playback inside the app and leaving it afterwards.
- Keep notification timestamp constant when updating it
Change-Id: I2fa9a56ff31ab2874d6d96786e6b80695397702b
Diffstat (limited to 'src/com/cyanogenmod/eleven/utils/MusicUtils.java')
-rw-r--r-- | src/com/cyanogenmod/eleven/utils/MusicUtils.java | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/com/cyanogenmod/eleven/utils/MusicUtils.java b/src/com/cyanogenmod/eleven/utils/MusicUtils.java index 0eb4429..441413a 100644 --- a/src/com/cyanogenmod/eleven/utils/MusicUtils.java +++ b/src/com/cyanogenmod/eleven/utils/MusicUtils.java @@ -76,8 +76,6 @@ public final class MusicUtils { public static IElevenService mService = null; - private static int sForegroundActivities = 0; - private static final WeakHashMap<Context, ServiceBinder> mConnectionMap; private static final long[] sEmptyList; @@ -1550,28 +1548,6 @@ public final class MusicUtils { } /** - * Used to build and show a notification when Apollo is sent into the - * background - * - * @param context The {@link Context} to use. - */ - public static void notifyForegroundStateChanged(final Context context, boolean inForeground) { - int old = sForegroundActivities; - if (inForeground) { - sForegroundActivities++; - } else { - sForegroundActivities--; - } - - if (old == 0 || sForegroundActivities == 0) { - final Intent intent = new Intent(context, MusicPlaybackService.class); - intent.setAction(MusicPlaybackService.FOREGROUND_STATE_CHANGED); - intent.putExtra(MusicPlaybackService.NOW_IN_FOREGROUND, sForegroundActivities != 0); - context.startService(intent); - } - } - - /** * Perminately deletes item(s) from the user's device * * @param context The {@link Context} to use. |