Commit 50eda989 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

make file readable by user

parent deac7849
......@@ -21,6 +21,7 @@ import java.lang.Thread.UncaughtExceptionHandler;
* @author Vincent Bourgmayer
*/
public class ServiceExceptionHandler implements UncaughtExceptionHandler{
private final static String TAG = ServiceExceptionHandler.class.getSimpleName();
private UncaughtExceptionHandler defaultUEH;
Service service;
......@@ -39,12 +40,19 @@ public class ServiceExceptionHandler implements UncaughtExceptionHandler{
//Create a new file that user can sent to us
String fileName = "eDrive-crash-"+timestamp+".log";
File downloadDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath());
File downloadDir = service.getApplication().getExternalFilesDir("Logs");
//File downloadDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath());
File logFile = new File(downloadDir, fileName);
try {
FileOutputStream fos = new FileOutputStream(logFile);
fos.write(getStackTraceAsString(e).getBytes());
fos.close();
logFile.setReadable(true, false);
//DID NOT WORKS: CommonUtils.doActionMediaScannerConnexionScanFile(service, logFile.getCanonicalPath());
} catch (IOException exception) {
exception.printStackTrace();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment