@Test public void testGetParentOfRoot() throws Exception { assertEquals( MediaIDHelper.MEDIA_ID_ROOT, MediaIDHelper.getParentMediaID(MediaIDHelper.MEDIA_ID_ROOT)); }
public static String getParentMediaID(@NonNull String mediaID) { String[] hierarchy = getHierarchy(mediaID); if (!isBrowseable(mediaID)) { return createMediaID(null, hierarchy); } if (hierarchy.length <= 1) { return MEDIA_ID_ROOT; } String[] parentHierarchy = Arrays.copyOf(hierarchy, hierarchy.length-1); return createMediaID(null, parentHierarchy); }
MediaIDHelper { public static String getParentMediaID(@NonNull String mediaID) { String[] hierarchy = getHierarchy(mediaID); if (!isBrowseable(mediaID)) { return createMediaID(null, hierarchy); } if (hierarchy.length <= 1) { return MEDIA_ID_ROOT; } String[] parentHierarchy = Arrays.copyOf(hierarchy, hierarchy.length-1); return createMediaID(null, parentHierarchy); } }
MediaIDHelper { public static String getParentMediaID(@NonNull String mediaID) { String[] hierarchy = getHierarchy(mediaID); if (!isBrowseable(mediaID)) { return createMediaID(null, hierarchy); } if (hierarchy.length <= 1) { return MEDIA_ID_ROOT; } String[] parentHierarchy = Arrays.copyOf(hierarchy, hierarchy.length-1); return createMediaID(null, parentHierarchy); }  }
MediaIDHelper { public static String getParentMediaID(@NonNull String mediaID) { String[] hierarchy = getHierarchy(mediaID); if (!isBrowseable(mediaID)) { return createMediaID(null, hierarchy); } if (hierarchy.length <= 1) { return MEDIA_ID_ROOT; } String[] parentHierarchy = Arrays.copyOf(hierarchy, hierarchy.length-1); return createMediaID(null, parentHierarchy); }  static String createMediaID(String musicID, String... categories); static String extractMusicIDFromMediaID(@NonNull String mediaID); static @NonNull String[] getHierarchy(@NonNull String mediaID); static String extractBrowseCategoryValueFromMediaID(@NonNull String mediaID); static boolean isBrowseable(@NonNull String mediaID); static boolean isPlaylist(@NonNull String mediaId); static String getParentMediaID(@NonNull String mediaID); static boolean isMediaItemPlaying(Context context,
                                             MediaBrowserCompat.MediaItem mediaItem); static MediaDescriptionCompat getDescriptionWithRating(MediaMetadataCompat metadata); }
MediaIDHelper { public static String getParentMediaID(@NonNull String mediaID) { String[] hierarchy = getHierarchy(mediaID); if (!isBrowseable(mediaID)) { return createMediaID(null, hierarchy); } if (hierarchy.length <= 1) { return MEDIA_ID_ROOT; } String[] parentHierarchy = Arrays.copyOf(hierarchy, hierarchy.length-1); return createMediaID(null, parentHierarchy); }  static String createMediaID(String musicID, String... categories); static String extractMusicIDFromMediaID(@NonNull String mediaID); static @NonNull String[] getHierarchy(@NonNull String mediaID); static String extractBrowseCategoryValueFromMediaID(@NonNull String mediaID); static boolean isBrowseable(@NonNull String mediaID); static boolean isPlaylist(@NonNull String mediaId); static String getParentMediaID(@NonNull String mediaID); static boolean isMediaItemPlaying(Context context,
                                             MediaBrowserCompat.MediaItem mediaItem); static MediaDescriptionCompat getDescriptionWithRating(MediaMetadataCompat metadata); static final String MEDIA_ID_EMPTY_ROOT; static final String MEDIA_ID_ROOT; static final String MEDIA_ID_MUSICS_BY_GENRE; static final String MEDIA_ID_MUSICS_BY_SEARCH; static final String MEDIA_ID_PLAYLISTS; static final String MEDIA_ID_ARTIST_SONGS; static final String MEDIA_ID_ARTISTS; static final String MEDIA_ID_ALBUMS; }