Loading AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="24" /> android:targetSdkVersion="26" /> <original-package android:name="com.cyanogenmod.eleven" /> Loading res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -207,4 +207,6 @@ <string name="search_title_playlists">All \"%s\" playlists</string> <string name="duration_format"><xliff:g id="hours">%1$s</xliff:g> <xliff:g id="minutes">%2$s</xliff:g></string> <string name="channel_music">Music playback</string> </resources> src/org/lineageos/eleven/MusicPlaybackService.java +23 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import android.annotation.NonNull; import android.annotation.SuppressLint; import android.app.AlarmManager; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; Loading Loading @@ -56,6 +57,7 @@ import android.os.SystemClock; import android.provider.MediaStore; import android.provider.MediaStore.Audio.AlbumColumns; import android.provider.MediaStore.Audio.AudioColumns; import android.support.v4.os.BuildCompat; import android.text.TextUtils; import android.util.Log; import android.util.LongSparseArray; Loading Loading @@ -337,6 +339,8 @@ public class MusicPlaybackService extends Service { */ public static final int MAX_HISTORY_SIZE = 1000; private static final String CHANNEL_NAME = "eleven_playback"; public interface TrackErrorExtra { /** * Name of the track that was unable to play Loading Loading @@ -1645,7 +1649,7 @@ public class MusicPlaybackService extends Service { mNotificationPostTime = System.currentTimeMillis(); } Notification.Builder builder = new Notification.Builder(this) Notification.Builder builder = new Notification.Builder(this, CHANNEL_NAME) .setSmallIcon(R.drawable.ic_notification) .setLargeIcon(artwork.getBitmap()) .setContentIntent(clickIntent) Loading @@ -1666,6 +1670,24 @@ public class MusicPlaybackService extends Service { builder.setColor(artwork.getVibrantDarkColor()); if (BuildCompat.isAtLeastO()) { NotificationChannel channel = mNotificationManager .getNotificationChannel(CHANNEL_NAME); if (channel == null) { String name = getString(R.string.channel_music); channel = new NotificationChannel(CHANNEL_NAME, name, mNotificationManager.IMPORTANCE_DEFAULT); channel.setShowBadge(false); channel.enableVibration(false); channel.setSound(null, null); mNotificationManager.createNotificationChannel(channel); } builder.setChannelId(channel.getId()); } return builder.build(); } Loading Loading
AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="24" /> android:targetSdkVersion="26" /> <original-package android:name="com.cyanogenmod.eleven" /> Loading
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -207,4 +207,6 @@ <string name="search_title_playlists">All \"%s\" playlists</string> <string name="duration_format"><xliff:g id="hours">%1$s</xliff:g> <xliff:g id="minutes">%2$s</xliff:g></string> <string name="channel_music">Music playback</string> </resources>
src/org/lineageos/eleven/MusicPlaybackService.java +23 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import android.annotation.NonNull; import android.annotation.SuppressLint; import android.app.AlarmManager; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; Loading Loading @@ -56,6 +57,7 @@ import android.os.SystemClock; import android.provider.MediaStore; import android.provider.MediaStore.Audio.AlbumColumns; import android.provider.MediaStore.Audio.AudioColumns; import android.support.v4.os.BuildCompat; import android.text.TextUtils; import android.util.Log; import android.util.LongSparseArray; Loading Loading @@ -337,6 +339,8 @@ public class MusicPlaybackService extends Service { */ public static final int MAX_HISTORY_SIZE = 1000; private static final String CHANNEL_NAME = "eleven_playback"; public interface TrackErrorExtra { /** * Name of the track that was unable to play Loading Loading @@ -1645,7 +1649,7 @@ public class MusicPlaybackService extends Service { mNotificationPostTime = System.currentTimeMillis(); } Notification.Builder builder = new Notification.Builder(this) Notification.Builder builder = new Notification.Builder(this, CHANNEL_NAME) .setSmallIcon(R.drawable.ic_notification) .setLargeIcon(artwork.getBitmap()) .setContentIntent(clickIntent) Loading @@ -1666,6 +1670,24 @@ public class MusicPlaybackService extends Service { builder.setColor(artwork.getVibrantDarkColor()); if (BuildCompat.isAtLeastO()) { NotificationChannel channel = mNotificationManager .getNotificationChannel(CHANNEL_NAME); if (channel == null) { String name = getString(R.string.channel_music); channel = new NotificationChannel(CHANNEL_NAME, name, mNotificationManager.IMPORTANCE_DEFAULT); channel.setShowBadge(false); channel.enableVibration(false); channel.setSound(null, null); mNotificationManager.createNotificationChannel(channel); } builder.setChannelId(channel.getId()); } return builder.build(); } Loading