mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-24 10:55:54 +00:00
Don't crash when opening folder on Android 7 (fixes #831)
This commit is contained in:
parent
4e8142b6b8
commit
1d6fc644ca
1 changed files with 8 additions and 0 deletions
|
@ -6,6 +6,7 @@ import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.StrictMode;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
|
@ -33,6 +34,13 @@ public class FirstStartActivity extends Activity implements Button.OnClickListen
|
||||||
Button cont = (Button) findViewById(R.id.cont);
|
Button cont = (Button) findViewById(R.id.cont);
|
||||||
cont.setOnClickListener(this);
|
cont.setOnClickListener(this);
|
||||||
|
|
||||||
|
// Set VM policy to avoid crash when sending folder URI to file manager.
|
||||||
|
StrictMode.VmPolicy policy = new StrictMode.VmPolicy.Builder()
|
||||||
|
.detectAll()
|
||||||
|
.penaltyLog()
|
||||||
|
.build();
|
||||||
|
StrictMode.setVmPolicy(policy);
|
||||||
|
|
||||||
if (!isFirstStart()) {
|
if (!isFirstStart()) {
|
||||||
if (haveStoragePermission()) {
|
if (haveStoragePermission()) {
|
||||||
startApp();
|
startApp();
|
||||||
|
|
Loading…
Reference in a new issue