File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
app/src/main/java/cc/chenhe/qqnotifyevo/utils Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -116,15 +116,23 @@ private fun getCacheDir(context: Context): File {
116116 }
117117}
118118
119+ private fun getDataDir (context : Context ): File {
120+ return if (Environment .MEDIA_MOUNTED == Environment .getExternalStorageState()
121+ || ! Environment .isExternalStorageRemovable()) {
122+ context.getExternalFilesDir(null )!!
123+ } else {
124+ context.filesDir
125+ }
126+ }
127+
119128fun getAvatarDiskCacheDir (context : Context ): File {
120129 return File (getCacheDir(context), " conversion_icon" )
121130}
122131
123132fun getLogDir (context : Context ): File {
124- return File (getCacheDir (context), " log" )
133+ return File (getDataDir (context), " log" )
125134}
126135
127-
128136fun describeFileSize (size : Long ): String {
129137 return if (size < 1000 ) {
130138 " ${size} B"
You can’t perform that action at this time.
0 commit comments