Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
eDrive
Commits
50eda989
Commit
50eda989
authored
Dec 12, 2019
by
vince-bourgmayer
Browse files
make file readable by user
parent
deac7849
Changes
1
Show whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/drive/utils/ServiceExceptionHandler.java
View file @
50eda989
...
...
@@ -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
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment