Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1cd7ae2e authored by Joey's avatar Joey Committed by Michael Bestas
Browse files

Eleven: bump to api26



Change-Id: Ib2099cf0852ce2194fbd1058ab74c0710746c7d8
Signed-off-by: default avatarJoey <joey@lineageos.org>
parent 92355484
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@

    <uses-sdk
        android:minSdkVersion="24"
        android:targetSdkVersion="24" />
        android:targetSdkVersion="26" />

    <original-package android:name="com.cyanogenmod.eleven" />

+2 −0
Original line number Diff line number Diff line
@@ -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>
+23 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -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
@@ -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)
@@ -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();
    }