mirror of
https://github.com/android-password-store/Android-Password-Store.git
synced 2025-09-07 01:27:18 +02:00
Tweak documentation and drop unused import
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
a2741cd871
commit
f66652cbc6
|
@ -12,9 +12,9 @@ import dagger.hilt.components.SingletonComponent
|
|||
class ContextModule {
|
||||
|
||||
/**
|
||||
* A method which provides the path of app-specific files directory. This is useful where we want
|
||||
* to perform file operations but we do not want to depend on the [Context]. Injecting this in
|
||||
* place of [Context] allows the method/class to be unit-tested without any mocks/fakes.
|
||||
* We inject [Context.getFilesDir] to break the dependency on [Context], allowing tests to run on
|
||||
* the JVM. The principle here is identical to why [dev.msfjarvis.aps.util.totp.TotpFinder]
|
||||
* exists.
|
||||
*
|
||||
* @param context [ApplicationContext]
|
||||
* @return the path of app-specific files directory.
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package dev.msfjarvis.aps.injection.context
|
||||
|
||||
import android.content.Context
|
||||
import dev.msfjarvis.aps.util.settings.GitSettings
|
||||
import javax.inject.Qualifier
|
||||
|
||||
/**
|
||||
* Qualifier for a string value that needs to be provided to the [GitSettings]. It points to
|
||||
* `applicationContext.filesDir` and helps in removing the dependency on [Context].
|
||||
*/
|
||||
/** Qualifies a [String] representing the absolute path of [Context.getFilesDir]. */
|
||||
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class FilesDirPath
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package dev.msfjarvis.aps.injection.prefs
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import dev.msfjarvis.aps.util.settings.GitSettings
|
||||
import javax.inject.Qualifier
|
||||
|
||||
/**
|
||||
* Qualifier for a [SharedPreferences] that needs to be provided to the [GitSettings]. It provides a
|
||||
* [SharedPreferences] with the file name "git_operation" which stores the git settings.
|
||||
* Qualifies a [SharedPreferences] instance specifically used for encrypted Git-related settings.
|
||||
*/
|
||||
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class GitPreferences
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package dev.msfjarvis.aps.injection.prefs
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import dev.msfjarvis.aps.util.settings.GitSettings
|
||||
import javax.inject.Qualifier
|
||||
|
||||
/**
|
||||
* Qualifier for a [SharedPreferences] that needs to be provided to the [GitSettings]. It provides a
|
||||
* [SharedPreferences] with the file name "http_proxy" which stores all the http proxy settings.
|
||||
* Qualifies a [SharedPreferences] instance specifically used for encrypted proxy-related settings.
|
||||
*/
|
||||
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class ProxyPreferences
|
||||
|
|
|
@ -11,7 +11,6 @@ import android.content.SharedPreferences
|
|||
import androidx.core.content.edit
|
||||
import com.github.ivanshafran.sharedpreferencesmock.SPMockBuilder
|
||||
import dev.msfjarvis.aps.util.extensions.getString
|
||||
import dev.msfjarvis.aps.util.extensions.sharedPrefs
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
|
|
Loading…
Reference in a new issue