multiimageview: relax the vm policy when sharing uri to file

when opening a video externally the file path is exposed. this is
obviously not good, but this is a fix for later. strictmode crashes
the app when this happens, temporary disable it when opening the
intent as a workaround.
refactor-toolbar
Floens 8 years ago
parent ad2beeb470
commit 287adb1056
  1. 11
      Clover/app/src/main/java/org/floens/chan/ui/view/MultiImageView.java

@ -24,6 +24,7 @@ import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.os.StrictMode;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
@ -370,7 +371,15 @@ public class MultiImageView extends FrameLayout implements View.OnClickListener
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "video/*");
AndroidUtils.openIntent(intent);
{
StrictMode.VmPolicy vmPolicy = StrictMode.getVmPolicy();
StrictMode.setVmPolicy(StrictMode.VmPolicy.LAX);
AndroidUtils.openIntent(intent);
StrictMode.setVmPolicy(vmPolicy);
}
onModeLoaded(Mode.MOVIE, videoView);
} else {
Context proxyContext = new NoMusicServiceCommandContext(getContext());

Loading…
Cancel
Save