Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/develop' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro committed Nov 30, 2020
2 parents 95e77c3 + e85657b commit 2874f46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ class VGSCollectActivity: AppCompatActivity(), VgsCollectResponseListener, View.
.setHostname("collect-android-testing.verygoodsecurity.io/test")
.create()

val cacheSize = 10 * 1024 * 1024 // 10MB
vgsForm.getFileProvider().resize(cacheSize)
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
val cacheSize = 10 * 1024 * 1024 // 10MB
vgsForm.getFileProvider().resize(cacheSize)
}
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.util.LruCache
import androidx.annotation.RequiresApi
import androidx.annotation.VisibleForTesting
import com.verygoodsecurity.vgscollect.app.FilePickerActivity
import com.verygoodsecurity.vgscollect.core.model.network.VGSError
Expand Down Expand Up @@ -38,6 +40,7 @@ internal class TemporaryFileStorage(
memoryCache.evictAll()
}

@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
override fun resize(size: Int) {
memoryCache.resize(size)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.verygoodsecurity.vgscollect.core.storage.content.file

import android.os.Build
import androidx.annotation.RequiresApi
import com.verygoodsecurity.vgscollect.core.model.state.FileState

/**
Expand All @@ -13,6 +15,7 @@ interface VGSFileProvider {
*
* @param cacheSize The new maximum size.
*/
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
fun resize(cacheSize: Int)

/**
Expand Down

0 comments on commit 2874f46

Please sign in to comment.