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

Commit b32e1cdb authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Get AuthToken from AppLounge as a fallback

If no microG Google account has been added, we want to fallback
to AppLounge AuthToken.
parent 0a9a83f4
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ import androidx.annotation.RequiresApi
import androidx.core.content.pm.PackageInfoCompat
import com.android.vending.installer.KEY_BYTES_DOWNLOADED
import com.android.vending.installer.installPackagesFromNetwork
import com.android.vending.licensing.ContentProviderAuthData
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -55,7 +56,7 @@ class SplitInstallManager(val context: Context) {
        if (packagesToDownload.isEmpty()) return false

        val authData = runCatching { withContext(Dispatchers.IO) {
            AuthManager.getAuthData(context)
            AuthManager.getAuthData(context) ?: ContentProviderAuthData(context).fetch()
        } }.getOrNull()
        Log.v(TAG, "splitInstallFlow oauthToken: $authData")
        if (authData?.authToken.isNullOrEmpty()) return false