OSDN Git Service

Eleven: Fix artist header transparency
[android-x86/packages-apps-Eleven.git] / src / com / cyngn / eleven / utils / MusicUtils.java
index 66ff57d..f2cc778 100644 (file)
@@ -974,6 +974,7 @@ public final class MusicUtils {
         final String message = context.getResources().getQuantityString(
                 R.plurals.NNNtrackstoplaylist, numinserted, numinserted);
         AppMsg.makeText((Activity)context, message, AppMsg.STYLE_CONFIRM).show();
+        playlistChanged();
     }
 
     /**
@@ -992,6 +993,7 @@ public final class MusicUtils {
         final String message = context.getResources().getQuantityString(
                 R.plurals.NNNtracksfromplaylist, 1, 1);
         AppMsg.makeText((Activity)context, message, AppMsg.STYLE_CONFIRM).show();
+        playlistChanged();
     }
 
     /**
@@ -1301,6 +1303,18 @@ public final class MusicUtils {
     }
 
     /**
+     * Called when one of playlists have changed
+     */
+    public static void playlistChanged() {
+        try {
+            if (mService != null) {
+                mService.playlistChanged();
+            }
+        } catch (final RemoteException ignored) {
+        }
+    }
+
+    /**
      * Seeks the current track to a desired position
      *
      * @param position The position to seek to
@@ -1323,7 +1337,10 @@ public final class MusicUtils {
                 return mService.position();
             } catch (final RemoteException ignored) {
             } catch (final IllegalStateException ex) {
-                Log.e(MusicUtils.class.getSimpleName(), ex.getMessage());
+                // Illegal State Exception message is empty so logging will actually throw an
+                // exception.  We should come back and figure out why we get an exception in the
+                // first place and make sure we understand it completely.  I will use
+                // https://cyanogen.atlassian.net/browse/MUSIC-125 to track investigating this more
             }
         }
         return 0;
@@ -1338,6 +1355,10 @@ public final class MusicUtils {
                 return mService.duration();
             } catch (final RemoteException ignored) {
             } catch (final IllegalStateException ignored) {
+                // Illegal State Exception message is empty so logging will actually throw an
+                // exception.  We should come back and figure out why we get an exception in the
+                // first place and make sure we understand it completely.  I will use
+                // https://cyanogen.atlassian.net/browse/MUSIC-125 to track investigating this more
             }
         }
         return 0;