Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8853cc9 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

XAPK: Migrate to getExternalFilesDir method

parent 160c1250
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package foundation.e.apps.XAPK

import android.os.Environment
import foundation.e.apps.BuildConfig
import foundation.e.apps.MainActivity
import java.io.File

object AppFolder {
@@ -51,7 +52,8 @@ object AppFolder {
    private val appFolder: File?
        get() {
            return if (FsUtils.isSdUsable) {
                val appFolder = File(Environment.getExternalStorageDirectory(), APP_FOLDER_NAME)
                val appContext = MainActivity.applicationContext()
                val appFolder = File(appContext.getExternalFilesDir(null), APP_FOLDER_NAME)
                FsUtils.createOnNotFound(appFolder)
            } else {
                null
+3 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package foundation.e.apps.XAPK

import android.os.Environment
import android.text.TextUtils
import foundation.e.apps.MainActivity
import java.io.File

object FsUtils {
@@ -28,7 +29,8 @@ object FsUtils {

    fun getStorageDir(): File? {
        return if (isSdUsable) {
            Environment.getExternalStorageDirectory()
            val appContext = MainActivity.applicationContext()
            appContext.getExternalFilesDir(null)
        } else {
            null
        }