// Path: app/src/main/java/com/koma/music/util/LogUtils.java
// public class LogUtils {
//     private static final boolean IS_DEBUG = true;
//     private static final String TAG = "KomaMusic";
// 
//     public static void d(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.d(TAG, buildString(tag, msg));
//         }
//     }
// 
//     public static void i(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.i(TAG, buildString(tag, msg));
//         }
//     }
// 
//     public static void e(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.e(TAG, buildString(tag, msg));
//         }
//     }
// 
//     private static String buildString(String tag, String msg) {
//         StringBuilder sb = new StringBuilder(tag);
//         sb.append("----");
//         sb.append(msg);
//         return sb.toString();
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.view.KeyEvent;
import com.koma.music.util.LogUtils;
            if (event == null || event.getAction() != KeyEvent.ACTION_UP) {
                return;
            }

            String command = null;
            switch (event.getKeyCode()) {
                case KeyEvent.KEYCODE_HEADSETHOOK:
                    command = MusicServiceConstants.CMDHEADSETHOOK;
                    break;
                case KeyEvent.KEYCODE_MEDIA_STOP:
                    command = MusicServiceConstants.CMDSTOP;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
                    command = MusicServiceConstants.CMDTOGGLEPAUSE;
                    break;
                case KeyEvent.KEYCODE_MEDIA_NEXT:
                    command = MusicServiceConstants.CMDNEXT;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
                    command = MusicServiceConstants.CMDPREVIOUS;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PAUSE:
                    command = MusicServiceConstants.CMDPAUSE;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PLAY:
                    command = MusicServiceConstants.CMDPLAY;
                    break;
            }
            if (command != null) {
                startService(context, command, event.getEventTime());
// Path: app/src/main/java/com/koma/music/util/LogUtils.java
// public class LogUtils {
//     private static final boolean IS_DEBUG = true;
//     private static final String TAG = "KomaMusic";
// 
//     public static void d(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.d(TAG, buildString(tag, msg));
//         }
//     }
// 
//     public static void i(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.i(TAG, buildString(tag, msg));
//         }
//     }
// 
//     public static void e(String tag, String msg) {
//         if (IS_DEBUG) {
//             Log.e(TAG, buildString(tag, msg));
//         }
//     }
// 
//     private static String buildString(String tag, String msg) {
//         StringBuilder sb = new StringBuilder(tag);
//         sb.append("----");
//         sb.append(msg);
//         return sb.toString();
//     }
// }


// Path: app/src/main/java/com/koma/music/service/MediaButtonIntentReceiver.java
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.view.KeyEvent;
import com.koma.music.util.LogUtils;

            if (event == null || event.getAction() != KeyEvent.ACTION_UP) {
                return;
            }

            String command = null;
            switch (event.getKeyCode()) {
                case KeyEvent.KEYCODE_HEADSETHOOK:
                    command = MusicServiceConstants.CMDHEADSETHOOK;
                    break;
                case KeyEvent.KEYCODE_MEDIA_STOP:
                    command = MusicServiceConstants.CMDSTOP;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
                    command = MusicServiceConstants.CMDTOGGLEPAUSE;
                    break;
                case KeyEvent.KEYCODE_MEDIA_NEXT:
                    command = MusicServiceConstants.CMDNEXT;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
                    command = MusicServiceConstants.CMDPREVIOUS;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PAUSE:
                    command = MusicServiceConstants.CMDPAUSE;
                    break;
                case KeyEvent.KEYCODE_MEDIA_PLAY:
                    command = MusicServiceConstants.CMDPLAY;
                    break;
            }
            if (command != null) {
                startService(context, command, event.getEventTime());
                if (isOrderedBroadcast()) {