Skip to content

Commit 1e72749

Browse files
author
钟龙
committed
[fix]Fix the error of writing logs on some api level of Android devices due to writing sd card permissions issues.
1 parent 537e903 commit 1e72749

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

blockcanary-analyzer/src/main/java/com/github/moduth/blockcanary/BlockCanaryInternals.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static String getPath() {
124124
&& Environment.getExternalStorageDirectory().canWrite()) {
125125
return Environment.getExternalStorageDirectory().getPath() + logPath;
126126
}
127-
return Environment.getDataDirectory().getAbsolutePath() + BlockCanaryInternals.getContext().providePath();
127+
return getContext().provideContext().getFilesDir() + BlockCanaryInternals.getContext().providePath();
128128
}
129129

130130
static File detectedBlockDirectory() {

0 commit comments

Comments
 (0)