Loading app/src/main/java/foundation/e/drive/utils/ServiceExceptionHandler.java +9 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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(); } Loading Loading
app/src/main/java/foundation/e/drive/utils/ServiceExceptionHandler.java +9 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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(); } Loading