fixed warning

This commit is contained in:
sonalyadav 2024-12-19 19:31:57 +05:30 committed by Sonal Yadav
parent 68c24c47e3
commit 6e929e3786

View file

@ -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) },
)
}
}