// Path: app/src/main/java/com/teocci/ytinbg/utils/LogHelper.java
// public class LogHelper
// {
//     private static final int LOG_PREFIX_LENGTH = LOG_PREFIX.length();
//     private static final int MAX_LOG_TAG_LENGTH = 23;
//     private static final int RESERVED_LENGTH = MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH - 2;
// 
//     public static String makeLogTag(String str)
//     {
//         return LOG_PREFIX
//                 + '['
//                 + (str.length() > RESERVED_LENGTH ? str.substring(0, RESERVED_LENGTH - 1) : str)
//                 + ']';
//     }
// 
//     /**
//      * Don't use this when obfuscating class names!
//      */
//     public static String makeLogTag(Class cls)
//     {
//         return makeLogTag(cls.getSimpleName());
//     }
// 
// 
//     public static void v(String tag, Object... messages)
//     {
//         // Only log VERBOSE if build type is DEBUG
//         if (BuildConfig.DEBUG) {
//             log(tag, Log.VERBOSE, null, messages);
//         }
//     }
// 
//     public static void d(String tag, Object... messages)
//     {
//         // Only log DEBUG if build type is DEBUG
//         if (BuildConfig.DEBUG) {
//             log(tag, Log.DEBUG, null, messages);
//         }
//     }
// 
//     public static void i(String tag, Object... messages)
//     {
//         log(tag, Log.INFO, null, messages);
//     }
// 
//     public static void w(String tag, Object... messages)
//     {
//         log(tag, Log.WARN, null, messages);
//     }
// 
//     public static void w(String tag, Throwable t, Object... messages)
//     {
//         log(tag, Log.WARN, t, messages);
//     }
// 
//     public static void e(String tag, Object... messages)
//     {
//         log(tag, Log.ERROR, null, messages);
//     }
// 
//     public static void e(String tag, Throwable t, Object... messages)
//     {
//         log(tag, Log.ERROR, t, messages);
//     }
// 
//     public static void log(String tag, int level, Throwable t, Object... messages)
//     {
//         if (Log.isLoggable(tag, level)) {
//             String message;
//             if (t == null && messages != null && messages.length == 1) {
//                 // Handle this common case without the extra cost of creating a StringBuffer:
//                 message = messages[0].toString();
//             } else {
//                 StringBuilder sb = new StringBuilder();
//                 if (messages != null) for (Object m : messages) {
//                     sb.append(m);
//                 }
//                 if (t != null) {
//                     sb.append("\n").append(Log.getStackTraceString(t));
//                 }
//                 message = sb.toString();
//             }
// 
//             Log.println(level, tag, message);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/teocci/ytinbg/utils/BuildUtil.java
// public static boolean minAPI26()
// {
//     return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
// }


import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Build;
import android.os.RemoteException;
import android.support.v4.media.MediaDescriptionCompat;
import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.MediaSessionCompat;
import android.support.v4.media.session.PlaybackStateCompat;
import com.teocci.ytinbg.R;
import com.teocci.ytinbg.utils.LogHelper;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationCompat.Action;
import androidx.media.app.NotificationCompat.MediaStyle;
import androidx.media.session.MediaButtonReceiver;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_PAUSE;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_PLAY;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_SKIP_TO_NEXT;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_STOP;
import static com.teocci.ytinbg.utils.BuildUtil.minAPI26;
package com.teocci.ytinbg.notification;





/**
 * Created by teocci.
 *
 * @author teocci@yandex.com on 2019-Jun-28
 */
public class NotificationBuilder
{
    private static final String TAG = LogHelper.makeLogTag(NotificationBuilder.class);

    private static final String CHANNEL_ID = "com.teocci.ytinbg.notification.YIB_CHANNEL_ID";

    private static final int NOTIFICATION_ID = 412;

    private final Context context;

    private final NotificationManager notificationManager;

    private MediaControllerCompat mediaController;
    private MediaDescriptionCompat mediaDescription;
    private PlaybackStateCompat playbackState;

    private NotificationCompat.Builder builder;

    private Action skipToPreviousAction;
// Path: app/src/main/java/com/teocci/ytinbg/utils/LogHelper.java
// public class LogHelper
// {
//     private static final int LOG_PREFIX_LENGTH = LOG_PREFIX.length();
//     private static final int MAX_LOG_TAG_LENGTH = 23;
//     private static final int RESERVED_LENGTH = MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH - 2;
// 
//     public static String makeLogTag(String str)
//     {
//         return LOG_PREFIX
//                 + '['
//                 + (str.length() > RESERVED_LENGTH ? str.substring(0, RESERVED_LENGTH - 1) : str)
//                 + ']';
//     }
// 
//     /**
//      * Don't use this when obfuscating class names!
//      */
//     public static String makeLogTag(Class cls)
//     {
//         return makeLogTag(cls.getSimpleName());
//     }
// 
// 
//     public static void v(String tag, Object... messages)
//     {
//         // Only log VERBOSE if build type is DEBUG
//         if (BuildConfig.DEBUG) {
//             log(tag, Log.VERBOSE, null, messages);
//         }
//     }
// 
//     public static void d(String tag, Object... messages)
//     {
//         // Only log DEBUG if build type is DEBUG
//         if (BuildConfig.DEBUG) {
//             log(tag, Log.DEBUG, null, messages);
//         }
//     }
// 
//     public static void i(String tag, Object... messages)
//     {
//         log(tag, Log.INFO, null, messages);
//     }
// 
//     public static void w(String tag, Object... messages)
//     {
//         log(tag, Log.WARN, null, messages);
//     }
// 
//     public static void w(String tag, Throwable t, Object... messages)
//     {
//         log(tag, Log.WARN, t, messages);
//     }
// 
//     public static void e(String tag, Object... messages)
//     {
//         log(tag, Log.ERROR, null, messages);
//     }
// 
//     public static void e(String tag, Throwable t, Object... messages)
//     {
//         log(tag, Log.ERROR, t, messages);
//     }
// 
//     public static void log(String tag, int level, Throwable t, Object... messages)
//     {
//         if (Log.isLoggable(tag, level)) {
//             String message;
//             if (t == null && messages != null && messages.length == 1) {
//                 // Handle this common case without the extra cost of creating a StringBuffer:
//                 message = messages[0].toString();
//             } else {
//                 StringBuilder sb = new StringBuilder();
//                 if (messages != null) for (Object m : messages) {
//                     sb.append(m);
//                 }
//                 if (t != null) {
//                     sb.append("\n").append(Log.getStackTraceString(t));
//                 }
//                 message = sb.toString();
//             }
// 
//             Log.println(level, tag, message);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/teocci/ytinbg/utils/BuildUtil.java
// public static boolean minAPI26()
// {
//     return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
// }


// Path: app/src/main/java/com/teocci/ytinbg/notification/NotificationBuilder.java
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Build;
import android.os.RemoteException;
import android.support.v4.media.MediaDescriptionCompat;
import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.MediaSessionCompat;
import android.support.v4.media.session.PlaybackStateCompat;
import com.teocci.ytinbg.R;
import com.teocci.ytinbg.utils.LogHelper;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationCompat.Action;
import androidx.media.app.NotificationCompat.MediaStyle;
import androidx.media.session.MediaButtonReceiver;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_PAUSE;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_PLAY;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_SKIP_TO_NEXT;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS;
import static android.support.v4.media.session.PlaybackStateCompat.ACTION_STOP;
import static com.teocci.ytinbg.utils.BuildUtil.minAPI26;

package com.teocci.ytinbg.notification;





/**
 * Created by teocci.
 *
 * @author teocci@yandex.com on 2019-Jun-28
 */
public class NotificationBuilder
{
    private static final String TAG = LogHelper.makeLogTag(NotificationBuilder.class);

    private static final String CHANNEL_ID = "com.teocci.ytinbg.notification.YIB_CHANNEL_ID";

    private static final int NOTIFICATION_ID = 412;

    private final Context context;

    private final NotificationManager notificationManager;

    private MediaControllerCompat mediaController;
    private MediaDescriptionCompat mediaDescription;
    private PlaybackStateCompat playbackState;

    private NotificationCompat.Builder builder;

    private Action skipToPreviousAction;
    private Action playAction;