FMAPP: Removed deprecated content values from recording file
In app target sdk version upgrade, removed the contents
of recording file, that are no longer used in the database table.
Change-Id: Ib51aea5300df43a0b523c1eea21f1283926c9cb0
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 5f375dd..619194c 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -1349,7 +1349,6 @@
// Lets label the recorded audio file as NON-MUSIC so that the file
// won't be displayed automatically, except for in the playlist.
- cv.put(MediaStore.Audio.Media.IS_MUSIC, "1");
cv.put(MediaStore.Audio.Media.DURATION, mSampleLength);
cv.put(MediaStore.Audio.Media.TITLE, title);
cv.put(MediaStore.Audio.Media.DATA, file.getAbsolutePath());
@@ -1424,24 +1423,16 @@
}
private void addToPlaylist(ContentResolver resolver, int audioId, long playlistId) {
- String[] cols = new String[] {
- MediaStore.Audio.Media.ALBUM_ID
- };
Uri uri = MediaStore.Audio.Playlists.Members.getContentUri("external", playlistId);
- Cursor cur = resolver.query(uri, cols, null, null, null);
- final int base;
- if(cur != null && cur.getCount() != 0) {
- cur.moveToFirst();
- base = cur.getInt(0);
- cur.close();
- }
- else {
- base = 0;
- }
+
ContentValues values = new ContentValues();
- values.put(MediaStore.Audio.Playlists.Members.PLAY_ORDER, Integer.valueOf(base + audioId));
+ values.put(MediaStore.Audio.Playlists.Members.PLAY_ORDER, audioId);
values.put(MediaStore.Audio.Playlists.Members.AUDIO_ID, audioId);
- resolver.insert(uri, values);
+ try {
+ resolver.insert(uri, values);
+ } catch (Exception exception) {
+ exception.printStackTrace();
+ }
}
private void resumeAfterCall() {