fix log emails crashing on 7.1+ devices

This commit is contained in:
dosiecki 2017-05-01 16:16:33 -07:00
parent 240bffe2a2
commit ec8427bf86
3 changed files with 18 additions and 2 deletions

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.newsblur"
android:versionCode="137"
android:versionName="5.2.0b2" >
android:versionName="5.2.0b3" >
<uses-sdk
android:minSdkVersion="16"
@ -145,6 +145,16 @@
<receiver android:name=".util.NotifySaveReceiver" android:exported="false" />
<receiver android:name=".util.NotifyMarkreadReceiver" android:exported="false" />
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.newsblur.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-cache-path name="external_cache" />
<external-path name="external_files" />
</paths>

View file

@ -21,6 +21,7 @@ import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.support.v4.content.FileProvider;
import android.util.Log;
import com.newsblur.R;
@ -98,7 +99,7 @@ public class PrefsUtils {
File f = com.newsblur.util.Log.getLogfile();
if (f == null) return;
String debugInfo = "Tell us a bit a about your problem:\n\n\n\n" + getDebugInfo(context);
android.net.Uri localPath = android.net.Uri.fromFile(f);
android.net.Uri localPath = FileProvider.getUriForFile(context, "com.newsblur.fileprovider", f);
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("*/*");
i.putExtra(Intent.EXTRA_EMAIL, new String[]{"android@newsblur.com"});