mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
fixed warning
This commit is contained in:
parent
68c24c47e3
commit
6e929e3786
1 changed files with 190 additions and 189 deletions
|
|
@ -32,8 +32,8 @@ private const val RADIUS_STEP_SIZE_IN_METRES = 100
|
|||
private const val MIN_NEARBY_RESULTS = 5
|
||||
|
||||
class FileProcessor
|
||||
@Inject
|
||||
constructor(
|
||||
@Inject
|
||||
constructor(
|
||||
private val context: Context,
|
||||
private val contentResolver: ContentResolver,
|
||||
private val gpsCategoryModel: GpsCategoryModel,
|
||||
|
|
@ -41,7 +41,7 @@ class FileProcessor
|
|||
@param:Named("default_preferences") private val defaultKvStore: JsonKvStore,
|
||||
private val apiCall: CategoryApi,
|
||||
private val okHttpJsonApiClient: OkHttpJsonApiClient,
|
||||
) {
|
||||
) {
|
||||
private val compositeDisposable = CompositeDisposable()
|
||||
|
||||
fun cleanup() {
|
||||
|
|
@ -86,7 +86,7 @@ class FileProcessor
|
|||
*/
|
||||
fun getExifTagsToRedact(): Set<String> {
|
||||
val prefManageEXIFTags =
|
||||
defaultKvStore.getStringSet(Prefs.MANAGED_EXIF_TAGS) ?: emptySet()
|
||||
defaultKvStore.getStringSet(Prefs.MANAGED_EXIF_TAGS) ?: emptySet<String>()
|
||||
val redactTags: Set<String> =
|
||||
context.resources.getStringArray(R.array.pref_exifTag_values).toSet()
|
||||
return redactTags - prefManageEXIFTags
|
||||
|
|
@ -131,9 +131,10 @@ class FileProcessor
|
|||
?.getAttribute(tag)
|
||||
?.takeIf { it.isNotEmpty() }
|
||||
?.let { attributeName ->
|
||||
exifInterface.setAttribute(tag, null).also {
|
||||
Timber.d("Exif tag $tag with value $attributeName redacted.")
|
||||
exifInterface.setAttribute(tag, "").also {
|
||||
Timber.d("EXIF tag $tag removed or set to empty.")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -232,4 +233,4 @@ class FileProcessor
|
|||
{ depictsModel.nearbyPlaces.offer(it) },
|
||||
{ Timber.e(it) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue