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

Commit 3cbd808c authored by Michael W's avatar Michael W
Browse files

Recorder: Fix sharing

* In an effort to migrate to using MediaProvider,
  commit a7fa15c7 removed the
  Intent's EXTRA_STREAM, which, according to the documentation
  https://developer.android.com/reference/android/content/Intent#EXTRA_STREAM
  is used for ACTION_SEND to supply the data being sent
* Restore setting type and data

Error:
BluetoothLauncherActivity: type is null; or sending file URI is null

This fixes sharing a recording via Bluetooth and very probably
https://gitlab.com/LineageOS/issues/android/-/issues/3038

Change-Id: Ibc6f45f93f0f01df6b3547b28a6311db7fe57024
parent c7dd05af
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -62,7 +62,8 @@ public class LastRecordHelper {

    public static Intent getShareIntent(Uri uri, String mimeType) {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setDataAndType(uri, mimeType);
        intent.setType(mimeType);
        intent.putExtra(Intent.EXTRA_STREAM, uri);
        Intent chooserIntent = Intent.createChooser(intent, null);
        chooserIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
        return chooserIntent;