Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba2a149c authored by nift4's avatar nift4
Browse files

FMRadio: Play Music is dead - fix saved recordings

Change-Id: Icd431b60d4312b977e86f742ba7887c1239c97f1
parent a71ab2ca
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -51,17 +51,6 @@
            android:singleLine="true"
            android:textColor="#000000"
            android:textSize="16sp"/>

        <TextView
            android:id="@+id/save_dialog_caption"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:alpha="0.54"
            android:fontFamily="sans-serif"
            android:paddingTop="20dip"
            android:text="@string/save_dialog_caption"
            android:textColor="#000000"
            android:textSize="16sp" />
    </LinearLayout>

    <LinearLayout
+6 −16
Original line number Diff line number Diff line
@@ -823,15 +823,13 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
                extras.putInt("playlist", playlistId);
                try {
                    playMusicIntent.putExtras(extras);
                    playMusicIntent.setClassName("com.google.android.music",
                            "com.google.android.music.ui.TrackContainerActivity");
                    playMusicIntent.setType("vnd.android.cursor.dir/playlist");
                    startActivity(playMusicIntent);
                } catch (IllegalArgumentException | ActivityNotFoundException e1) {
                    try {
                        playMusicIntent = new Intent(Intent.ACTION_VIEW);
                        playMusicIntent.putExtras(extras);
                        playMusicIntent.setType("vnd.android.cursor.dir/playlist");
                        playMusicIntent.setDataAndType(FmRecorder.RECORDINGS_URI,
                                "vnd.android.document/directory");
                        startActivity(playMusicIntent);
                    } catch (ActivityNotFoundException e2) {
                        // No activity respond
@@ -883,13 +881,6 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
                        public void onActionTriggered() {
                            Intent playMusicIntent = new Intent(Intent.ACTION_VIEW);
                            try {
                                playMusicIntent.setClassName("com.google.android.music",
                                        "com.google.android.music.AudioPreview");
                                playMusicIntent.setDataAndType(playUri, "audio/3gpp");
                                startActivity(playMusicIntent);
                            } catch (IllegalArgumentException | ActivityNotFoundException e1) {
                                try {
                                    playMusicIntent = new Intent(Intent.ACTION_VIEW);
                                playMusicIntent.setDataAndType(playUri, "audio/3gpp");
                                startActivity(playMusicIntent);
                            } catch (ActivityNotFoundException e2) {
@@ -898,7 +889,6 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
                                        + "respond play record file intent");
                            }
                        }
                        }
                    };
                }
                FmSnackBar.make(FmMainActivity.this, title, action, listener,
+3 −0
Original line number Diff line number Diff line
@@ -49,6 +49,9 @@ public class FmRecorder implements AudioRecorder.Callback {
    public static final String RECORDING_FILE_EXTENSION = ".3gpp";
    // recording file folder
    public static final String FM_RECORD_FOLDER = "FM Recording";
    public static final Uri RECORDINGS_URI = Uri.parse("content://" +
                                "com.android.externalstorage.documents/document/" +
                                "primary%3AFM%20Recording");
    private static final String RECORDING_FILE_TYPE = "audio/3gpp";
    private static final String RECORDING_FILE_SOURCE = "FM Recordings";
    // error type no sdcard