Browse Source

Fix moar ktlint issues

pull/2207/head
Benoit Marty 8 months ago committed by Benoit Marty
parent
commit
5d086ad82d
  1. 1
      features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInNode.kt
  2. 1
      features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenter.kt
  3. 1
      features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/preferences/DefaultAnalyticsPreferencesPresenter.kt
  4. 1
      features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenterTest.kt
  5. 1
      features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/preferences/AnalyticsPreferencesPresenterTest.kt
  6. 1
      features/createroom/api/src/main/kotlin/io/element/android/features/createroom/api/CreateRoomEntryPoint.kt
  7. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/ConfigureRoomFlowNode.kt
  8. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/CreateRoomDataStore.kt
  9. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/CreateRoomFlowNode.kt
  10. 2
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/DefaultCreateRoomEntryPoint.kt
  11. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/DefaultStartDMAction.kt
  12. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeopleNode.kt
  13. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeoplePresenter.kt
  14. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomNode.kt
  15. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomPresenter.kt
  16. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/di/CreateRoomComponent.kt
  17. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootNode.kt
  18. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenter.kt
  19. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/userlist/DefaultUserListPresenter.kt
  20. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/userlist/UserListDataStore.kt
  21. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/userlist/UserListPresenter.kt
  22. 1
      features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/DefaultStartDMActionTests.kt
  23. 1
      features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeoplePresenterTests.kt
  24. 1
      features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomPresenterTests.kt
  25. 1
      features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt
  26. 1
      features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/userlist/DefaultUserListPresenterTests.kt
  27. 1
      features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/userlist/FakeUserListPresenter.kt
  28. 1
      features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/userlist/FakeUserListPresenterFactory.kt
  29. 1
      features/createroom/test/src/main/kotlin/io/element/android/features/createroom/test/FakeStartDMAction.kt
  30. 1
      features/ftue/api/src/main/kotlin/io/element/android/features/ftue/api/FtueEntryPoint.kt
  31. 2
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/DefaultFtueEntryPoint.kt
  32. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/FtueFlowNode.kt
  33. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/migration/MigrationScreenNode.kt
  34. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/migration/SharedPrefsMigrationScreenStore.kt
  35. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/notifications/NotificationsOptInNode.kt
  36. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/notifications/NotificationsOptInPresenter.kt
  37. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/state/DefaultFtueState.kt
  38. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/welcome/WelcomeNode.kt
  39. 1
      features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/welcome/state/AndroidWelcomeScreenState.kt
  40. 7
      features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/DefaultFtueStateTests.kt
  41. 1
      features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/migration/MigrationScreenPresenterTest.kt
  42. 1
      features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/notifications/NotificationsOptInPresenterTests.kt
  43. 1
      features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/welcome/state/FakeWelcomeState.kt
  44. 1
      features/invitelist/api/src/main/kotlin/io/element/android/features/invitelist/api/InviteListEntryPoint.kt
  45. 2
      features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/DefaultInviteListEntryPoint.kt
  46. 1
      features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/DefaultSeenInvitesStore.kt
  47. 1
      features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListNode.kt
  48. 1
      features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListPresenter.kt
  49. 1
      features/invitelist/test/src/main/kotlin/io/element/android/features/invitelist/test/FakeSeenInvitesStore.kt
  50. 1
      features/leaveroom/impl/src/test/kotlin/io/element/android/features/leaveroom/impl/LeaveRoomPresenterImplTest.kt
  51. 1
      features/leaveroom/test/src/main/kotlin/io/element/android/features/leaveroom/fake/FakeLeaveRoomPresenter.kt
  52. 6
      features/location/api/build.gradle.kts
  53. 1
      features/location/api/src/main/kotlin/io/element/android/features/location/api/ShowLocationEntryPoint.kt
  54. 1
      features/location/api/src/main/kotlin/io/element/android/features/location/api/internal/MapTilerStaticMapUrlBuilder.kt
  55. 1
      features/location/api/src/main/kotlin/io/element/android/features/location/api/internal/MapTilerTileServerStyleUriBuilder.kt
  56. 1
      features/location/api/src/test/kotlin/io/element/android/features/location/api/LocationKtTest.kt
  57. 1
      features/location/api/src/test/kotlin/io/element/android/features/location/api/internal/MapTilerStaticMapUrlBuilderTest.kt
  58. 1
      features/location/api/src/test/kotlin/io/element/android/features/location/api/internal/MapTilerTileServerStyleUriBuilderTest.kt
  59. 1
      features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/permissions/PermissionsPresenterImpl.kt
  60. 1
      features/location/impl/src/main/kotlin/io/element/android/features/location/impl/send/SendLocationNode.kt
  61. 1
      features/location/impl/src/main/kotlin/io/element/android/features/location/impl/send/SendLocationPresenter.kt
  62. 1
      features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationNode.kt
  63. 1
      features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationPresenter.kt
  64. 1
      features/location/impl/src/test/kotlin/io/element/android/features/location/impl/common/actions/AndroidLocationActionsTest.kt
  65. 1
      features/location/impl/src/test/kotlin/io/element/android/features/location/impl/common/actions/FakeLocationActions.kt
  66. 1
      features/location/impl/src/test/kotlin/io/element/android/features/location/impl/common/permissions/PermissionsPresenterFake.kt
  67. 1
      features/location/impl/src/test/kotlin/io/element/android/features/location/impl/send/SendLocationPresenterTest.kt
  68. 1
      features/location/impl/src/test/kotlin/io/element/android/features/location/impl/show/ShowLocationPresenterTest.kt
  69. 1
      features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenEntryPoint.kt
  70. 2
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenEntryPoint.kt
  71. 14
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenService.kt
  72. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/LockScreenFlowNode.kt
  73. 3
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/biometric/BiometricUnlock.kt
  74. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/biometric/BiometricUnlockManager.kt
  75. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/biometric/DefaultBiometricUnlockManager.kt
  76. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/components/PinEntryTextField.kt
  77. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/DefaultPinCodeManager.kt
  78. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/PinCodeManager.kt
  79. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/model/PinEntry.kt
  80. 2
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsFlowNode.kt
  81. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsNode.kt
  82. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsPresenter.kt
  83. 2
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/LockScreenSetupFlowNode.kt
  84. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/biometric/SetupBiometricNode.kt
  85. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/biometric/SetupBiometricPresenter.kt
  86. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinNode.kt
  87. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinPresenter.kt
  88. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinStateProvider.kt
  89. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/validation/PinValidator.kt
  90. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/storage/LockScreenStore.kt
  91. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/storage/PreferencesLockScreenStore.kt
  92. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockHelper.kt
  93. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockNode.kt
  94. 1
      features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockPresenter.kt
  95. 1
      features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/biometric/FakeBiometricUnlockManager.kt
  96. 1
      features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/pin/DefaultPinCodeManagerTest.kt
  97. 1
      features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/pin/model/PinEntryTest.kt
  98. 1
      features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/pin/storage/InMemoryLockScreenStore.kt
  99. 1
      features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsPresenterTest.kt
  100. 1
      features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/setup/biometric/SetupBiometricPresenterTest.kt
  101. Some files were not shown because too many files have changed in this diff Show More

1
features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInNode.kt

@ -37,7 +37,6 @@ class AnalyticsOptInNode @AssistedInject constructor( @@ -37,7 +37,6 @@ class AnalyticsOptInNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: AnalyticsOptInPresenter,
) : Node(buildContext, plugins = plugins) {
private fun onClickTerms(activity: Activity, darkTheme: Boolean) {
activity.openUrlInChromeCustomTab(null, darkTheme, AnalyticsConfig.POLICY_LINK)
}

1
features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenter.kt

@ -30,7 +30,6 @@ class AnalyticsOptInPresenter @Inject constructor( @@ -30,7 +30,6 @@ class AnalyticsOptInPresenter @Inject constructor(
private val buildMeta: BuildMeta,
private val analyticsService: AnalyticsService,
) : Presenter<AnalyticsOptInState> {
@Composable
override fun present(): AnalyticsOptInState {
val localCoroutineScope = rememberCoroutineScope()

1
features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/preferences/DefaultAnalyticsPreferencesPresenter.kt

@ -36,7 +36,6 @@ class DefaultAnalyticsPreferencesPresenter @Inject constructor( @@ -36,7 +36,6 @@ class DefaultAnalyticsPreferencesPresenter @Inject constructor(
private val analyticsService: AnalyticsService,
private val buildMeta: BuildMeta,
) : AnalyticsPreferencesPresenter {
@Composable
override fun present(): AnalyticsPreferencesState {
val localCoroutineScope = rememberCoroutineScope()

1
features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenterTest.kt

@ -30,7 +30,6 @@ import org.junit.Rule @@ -30,7 +30,6 @@ import org.junit.Rule
import org.junit.Test
class AnalyticsOptInPresenterTest {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/preferences/AnalyticsPreferencesPresenterTest.kt

@ -29,7 +29,6 @@ import org.junit.Rule @@ -29,7 +29,6 @@ import org.junit.Rule
import org.junit.Test
class AnalyticsPreferencesPresenterTest {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/createroom/api/src/main/kotlin/io/element/android/features/createroom/api/CreateRoomEntryPoint.kt

@ -23,7 +23,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint @@ -23,7 +23,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint
import io.element.android.libraries.matrix.api.core.RoomId
interface CreateRoomEntryPoint : FeatureEntryPoint {
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
interface NodeBuilder {
fun callback(callback: Callback): NodeBuilder

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/ConfigureRoomFlowNode.kt

@ -52,7 +52,6 @@ class ConfigureRoomFlowNode @AssistedInject constructor( @@ -52,7 +52,6 @@ class ConfigureRoomFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins
) {
private val component by lazy {
parent!!.bindings<CreateRoomComponent.ParentBindings>().createRoomComponentBuilder().build()
}

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/CreateRoomDataStore.kt

@ -33,7 +33,6 @@ import javax.inject.Inject @@ -33,7 +33,6 @@ import javax.inject.Inject
class CreateRoomDataStore @Inject constructor(
val selectedUserListDataStore: UserListDataStore,
) {
private val createRoomConfigFlow: MutableStateFlow<CreateRoomConfig> = MutableStateFlow(CreateRoomConfig())
private var cachedAvatarUri: Uri? = null
set(value) {

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/CreateRoomFlowNode.kt

@ -50,7 +50,6 @@ class CreateRoomFlowNode @AssistedInject constructor( @@ -50,7 +50,6 @@ class CreateRoomFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins
) {
sealed interface NavTarget : Parcelable {
@Parcelize
data object Root : NavTarget

2
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/DefaultCreateRoomEntryPoint.kt

@ -27,12 +27,10 @@ import javax.inject.Inject @@ -27,12 +27,10 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultCreateRoomEntryPoint @Inject constructor() : CreateRoomEntryPoint {
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): CreateRoomEntryPoint.NodeBuilder {
val plugins = ArrayList<Plugin>()
return object : CreateRoomEntryPoint.NodeBuilder {
override fun callback(callback: CreateRoomEntryPoint.Callback): CreateRoomEntryPoint.NodeBuilder {
plugins += callback
return this

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/DefaultStartDMAction.kt

@ -35,7 +35,6 @@ class DefaultStartDMAction @Inject constructor( @@ -35,7 +35,6 @@ class DefaultStartDMAction @Inject constructor(
private val matrixClient: MatrixClient,
private val analyticsService: AnalyticsService,
) : StartDMAction {
override suspend fun execute(userId: UserId, actionState: MutableState<AsyncAction<RoomId>>) {
actionState.value = AsyncAction.Loading
when (val result = matrixClient.startDM(userId)) {

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeopleNode.kt

@ -33,7 +33,6 @@ class AddPeopleNode @AssistedInject constructor( @@ -33,7 +33,6 @@ class AddPeopleNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: AddPeoplePresenter,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onContinue()
}

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeoplePresenter.kt

@ -31,7 +31,6 @@ class AddPeoplePresenter @Inject constructor( @@ -31,7 +31,6 @@ class AddPeoplePresenter @Inject constructor(
userRepository: UserRepository,
dataStore: CreateRoomDataStore,
) : Presenter<UserListState> {
private val userListPresenter = userListPresenterFactory.create(
UserListPresenterArgs(
selectionMode = SelectionMode.Multiple,

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomNode.kt

@ -38,7 +38,6 @@ class ConfigureRoomNode @AssistedInject constructor( @@ -38,7 +38,6 @@ class ConfigureRoomNode @AssistedInject constructor(
private val presenter: ConfigureRoomPresenter,
private val analyticsService: AnalyticsService,
) : Node(buildContext, plugins = plugins) {
init {
lifecycle.subscribe(
onResume = {

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomPresenter.kt

@ -57,7 +57,6 @@ class ConfigureRoomPresenter @Inject constructor( @@ -57,7 +57,6 @@ class ConfigureRoomPresenter @Inject constructor(
private val analyticsService: AnalyticsService,
permissionsPresenterFactory: PermissionsPresenter.Factory,
) : Presenter<ConfigureRoomState> {
private val cameraPermissionPresenter: PermissionsPresenter = permissionsPresenterFactory.create(android.Manifest.permission.CAMERA)
private var pendingPermissionRequest = false

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/di/CreateRoomComponent.kt

@ -26,7 +26,6 @@ import io.element.android.libraries.di.SingleIn @@ -26,7 +26,6 @@ import io.element.android.libraries.di.SingleIn
@SingleIn(CreateRoomScope::class)
@MergeSubcomponent(CreateRoomScope::class)
interface CreateRoomComponent : NodeFactoriesBindings {
@Subcomponent.Builder
interface Builder {
fun build(): CreateRoomComponent

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootNode.kt

@ -42,7 +42,6 @@ class CreateRoomRootNode @AssistedInject constructor( @@ -42,7 +42,6 @@ class CreateRoomRootNode @AssistedInject constructor(
private val analyticsService: AnalyticsService,
private val inviteFriendsUseCase: InviteFriendsUseCase,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onCreateNewRoom()
fun onStartChatSuccess(roomId: RoomId)

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenter.kt

@ -41,7 +41,6 @@ class CreateRoomRootPresenter @Inject constructor( @@ -41,7 +41,6 @@ class CreateRoomRootPresenter @Inject constructor(
private val startDMAction: StartDMAction,
private val buildMeta: BuildMeta,
) : Presenter<CreateRoomRootState> {
private val presenter = presenterFactory.create(
UserListPresenterArgs(
selectionMode = SelectionMode.Single,

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/userlist/DefaultUserListPresenter.kt

@ -42,7 +42,6 @@ class DefaultUserListPresenter @AssistedInject constructor( @@ -42,7 +42,6 @@ class DefaultUserListPresenter @AssistedInject constructor(
@Assisted val userRepository: UserRepository,
@Assisted val userListDataStore: UserListDataStore,
) : UserListPresenter {
@AssistedFactory
@ContributesBinding(SessionScope::class)
interface DefaultUserListFactory : UserListPresenter.Factory {

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/userlist/UserListDataStore.kt

@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.MutableStateFlow @@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
import javax.inject.Inject
class UserListDataStore @Inject constructor() {
private val selectedUsers: MutableStateFlow<List<MatrixUser>> = MutableStateFlow(emptyList())
fun selectUser(user: MatrixUser) {

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/userlist/UserListPresenter.kt

@ -20,7 +20,6 @@ import io.element.android.libraries.architecture.Presenter @@ -20,7 +20,6 @@ import io.element.android.libraries.architecture.Presenter
import io.element.android.libraries.usersearch.api.UserRepository
interface UserListPresenter : Presenter<UserListState> {
interface Factory {
fun create(
args: UserListPresenterArgs,

1
features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/DefaultStartDMActionTests.kt

@ -32,7 +32,6 @@ import kotlinx.coroutines.test.runTest @@ -32,7 +32,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
class DefaultStartDMActionTests {
@Test
fun `when dm is found, assert state is updated with given room id`() = runTest {
val matrixClient = FakeMatrixClient().apply {

1
features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeoplePresenterTests.kt

@ -31,7 +31,6 @@ import org.junit.Rule @@ -31,7 +31,6 @@ import org.junit.Rule
import org.junit.Test
class AddPeoplePresenterTests {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomPresenterTests.kt

@ -62,7 +62,6 @@ private const val AN_URI_FROM_GALLERY = "content://uri_from_gallery" @@ -62,7 +62,6 @@ private const val AN_URI_FROM_GALLERY = "content://uri_from_gallery"
@RunWith(RobolectricTestRunner::class)
class ConfigureRoomPresenterTests {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt

@ -38,7 +38,6 @@ import org.junit.Rule @@ -38,7 +38,6 @@ import org.junit.Rule
import org.junit.Test
class CreateRoomRootPresenterTests {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/userlist/DefaultUserListPresenterTests.kt

@ -33,7 +33,6 @@ import org.junit.Rule @@ -33,7 +33,6 @@ import org.junit.Rule
import org.junit.Test
class DefaultUserListPresenterTests {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/userlist/FakeUserListPresenter.kt

@ -19,7 +19,6 @@ package io.element.android.features.createroom.impl.userlist @@ -19,7 +19,6 @@ package io.element.android.features.createroom.impl.userlist
import androidx.compose.runtime.Composable
class FakeUserListPresenter : UserListPresenter {
private var state = aUserListState()
fun givenState(state: UserListState) {

1
features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/userlist/FakeUserListPresenterFactory.kt

@ -21,7 +21,6 @@ import io.element.android.libraries.usersearch.api.UserRepository @@ -21,7 +21,6 @@ import io.element.android.libraries.usersearch.api.UserRepository
class FakeUserListPresenterFactory(
private val fakeUserListPresenter: FakeUserListPresenter = FakeUserListPresenter()
) : UserListPresenter.Factory {
override fun create(
args: UserListPresenterArgs,
userRepository: UserRepository,

1
features/createroom/test/src/main/kotlin/io/element/android/features/createroom/test/FakeStartDMAction.kt

@ -25,7 +25,6 @@ import io.element.android.libraries.matrix.test.A_ROOM_ID @@ -25,7 +25,6 @@ import io.element.android.libraries.matrix.test.A_ROOM_ID
import kotlinx.coroutines.delay
class FakeStartDMAction : StartDMAction {
private var executeResult: AsyncAction<RoomId> = AsyncAction.Success(A_ROOM_ID)
fun givenExecuteResult(result: AsyncAction<RoomId>) {

1
features/ftue/api/src/main/kotlin/io/element/android/features/ftue/api/FtueEntryPoint.kt

@ -22,7 +22,6 @@ import com.bumble.appyx.core.plugin.Plugin @@ -22,7 +22,6 @@ import com.bumble.appyx.core.plugin.Plugin
import io.element.android.libraries.architecture.FeatureEntryPoint
interface FtueEntryPoint : FeatureEntryPoint {
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
interface NodeBuilder {

2
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/DefaultFtueEntryPoint.kt

@ -27,12 +27,10 @@ import javax.inject.Inject @@ -27,12 +27,10 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultFtueEntryPoint @Inject constructor() : FtueEntryPoint {
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): FtueEntryPoint.NodeBuilder {
val plugins = ArrayList<Plugin>()
return object : FtueEntryPoint.NodeBuilder {
override fun callback(callback: FtueEntryPoint.Callback): FtueEntryPoint.NodeBuilder {
plugins += callback
return this

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/FtueFlowNode.kt

@ -70,7 +70,6 @@ class FtueFlowNode @AssistedInject constructor( @@ -70,7 +70,6 @@ class FtueFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins,
) {
sealed interface NavTarget : Parcelable {
@Parcelize
data object Placeholder : NavTarget

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/migration/MigrationScreenNode.kt

@ -32,7 +32,6 @@ class MigrationScreenNode @AssistedInject constructor( @@ -32,7 +32,6 @@ class MigrationScreenNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: MigrationScreenPresenter,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onMigrationFinished()
}

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/migration/SharedPrefsMigrationScreenStore.kt

@ -29,7 +29,6 @@ import javax.inject.Inject @@ -29,7 +29,6 @@ import javax.inject.Inject
class SharedPrefsMigrationScreenStore @Inject constructor(
@DefaultPreferences private val sharedPreferences: SharedPreferences,
) : MigrationScreenStore {
override fun isMigrationScreenNeeded(sessionId: SessionId): Boolean {
return sharedPreferences.getBoolean(sessionId.toKey(), false).not()
}

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/notifications/NotificationsOptInNode.kt

@ -34,7 +34,6 @@ class NotificationsOptInNode @AssistedInject constructor( @@ -34,7 +34,6 @@ class NotificationsOptInNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
presenterFactory: NotificationsOptInPresenter.Factory,
) : Node(buildContext, plugins = plugins) {
interface Callback : NodeInputs {
fun onNotificationsOptInFinished()
}

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/notifications/NotificationsOptInPresenter.kt

@ -40,7 +40,6 @@ class NotificationsOptInPresenter @AssistedInject constructor( @@ -40,7 +40,6 @@ class NotificationsOptInPresenter @AssistedInject constructor(
private val permissionStateProvider: PermissionStateProvider,
private val buildVersionSdkIntProvider: BuildVersionSdkIntProvider,
) : Presenter<NotificationsOptInState> {
@AssistedFactory
interface Factory {
fun create(callback: NotificationsOptInNode.Callback): NotificationsOptInPresenter

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/state/DefaultFtueState.kt

@ -48,7 +48,6 @@ class DefaultFtueState @Inject constructor( @@ -48,7 +48,6 @@ class DefaultFtueState @Inject constructor(
private val lockScreenService: LockScreenService,
private val matrixClient: MatrixClient,
) : FtueState {
override val shouldDisplayFlow = MutableStateFlow(isAnyStepIncomplete())
override suspend fun reset() {

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/welcome/WelcomeNode.kt

@ -33,7 +33,6 @@ class WelcomeNode @AssistedInject constructor( @@ -33,7 +33,6 @@ class WelcomeNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val buildMeta: BuildMeta,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onContinueClicked()
}

1
features/ftue/impl/src/main/kotlin/io/element/android/features/ftue/impl/welcome/state/AndroidWelcomeScreenState.kt

@ -29,7 +29,6 @@ import javax.inject.Inject @@ -29,7 +29,6 @@ import javax.inject.Inject
class AndroidWelcomeScreenState @Inject constructor(
@DefaultPreferences private val sharedPreferences: SharedPreferences,
) : WelcomeScreenState {
companion object {
private const val IS_WELCOME_SCREEN_SHOWN = "is_welcome_screen_shown"
}

7
features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/DefaultFtueStateTests.kt

@ -39,7 +39,6 @@ import kotlinx.coroutines.test.runTest @@ -39,7 +39,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
class DefaultFtueStateTests {
@Test
fun `given any check being false, should display flow is true`() = runTest {
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
@ -130,7 +129,8 @@ class DefaultFtueStateTests { @@ -130,7 +129,8 @@ class DefaultFtueStateTests {
FtueStep.NotificationsOptIn,
FtueStep.LockscreenSetup,
FtueStep.AnalyticsOptIn,
null, // Final state
// Final state
null,
)
// Cleanup
@ -204,7 +204,8 @@ class DefaultFtueStateTests { @@ -204,7 +204,8 @@ class DefaultFtueStateTests {
permissionStateProvider: FakePermissionStateProvider = FakePermissionStateProvider(permissionGranted = false),
matrixClient: MatrixClient = FakeMatrixClient(),
lockScreenService: LockScreenService = FakeLockScreenService(),
sdkIntVersion: Int = Build.VERSION_CODES.TIRAMISU, // First version where notification permission is required
// First version where notification permission is required
sdkIntVersion: Int = Build.VERSION_CODES.TIRAMISU,
) = DefaultFtueState(
sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkIntVersion),
coroutineScope = coroutineScope,

1
features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/migration/MigrationScreenPresenterTest.kt

@ -31,7 +31,6 @@ import org.junit.Rule @@ -31,7 +31,6 @@ import org.junit.Rule
import org.junit.Test
class MigrationScreenPresenterTest {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/notifications/NotificationsOptInPresenterTests.kt

@ -39,7 +39,6 @@ import org.junit.Rule @@ -39,7 +39,6 @@ import org.junit.Rule
import org.junit.Test
class NotificationsOptInPresenterTests {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/ftue/impl/src/test/kotlin/io/element/android/features/ftue/impl/welcome/state/FakeWelcomeState.kt

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package io.element.android.features.ftue.impl.welcome.state
class FakeWelcomeState : WelcomeScreenState {
private var isWelcomeScreenNeeded = true
override fun isWelcomeScreenNeeded(): Boolean {

1
features/invitelist/api/src/main/kotlin/io/element/android/features/invitelist/api/InviteListEntryPoint.kt

@ -23,7 +23,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint @@ -23,7 +23,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint
import io.element.android.libraries.matrix.api.core.RoomId
interface InviteListEntryPoint : FeatureEntryPoint {
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
interface NodeBuilder {

2
features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/DefaultInviteListEntryPoint.kt

@ -27,12 +27,10 @@ import javax.inject.Inject @@ -27,12 +27,10 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultInviteListEntryPoint @Inject constructor() : InviteListEntryPoint {
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): InviteListEntryPoint.NodeBuilder {
val plugins = ArrayList<Plugin>()
return object : InviteListEntryPoint.NodeBuilder {
override fun callback(callback: InviteListEntryPoint.Callback): InviteListEntryPoint.NodeBuilder {
plugins += callback
return this

1
features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/DefaultSeenInvitesStore.kt

@ -38,7 +38,6 @@ private val seenInvitesKey = stringSetPreferencesKey("seenInvites") @@ -38,7 +38,6 @@ private val seenInvitesKey = stringSetPreferencesKey("seenInvites")
class DefaultSeenInvitesStore @Inject constructor(
@ApplicationContext context: Context
) : SeenInvitesStore {
private val store = context.dataStore
override fun seenRoomIds(): Flow<Set<RoomId>> =

1
features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListNode.kt

@ -35,7 +35,6 @@ class InviteListNode @AssistedInject constructor( @@ -35,7 +35,6 @@ class InviteListNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: InviteListPresenter,
) : Node(buildContext, plugins = plugins) {
private fun onBackClicked() {
plugins<InviteListEntryPoint.Callback>().forEach { it.onBackClicked() }
}

1
features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListPresenter.kt

@ -52,7 +52,6 @@ class InviteListPresenter @Inject constructor( @@ -52,7 +52,6 @@ class InviteListPresenter @Inject constructor(
private val analyticsService: AnalyticsService,
private val notificationDrawerManager: NotificationDrawerManager,
) : Presenter<InviteListState> {
@Composable
override fun present(): InviteListState {
val invites by client

1
features/invitelist/test/src/main/kotlin/io/element/android/features/invitelist/test/FakeSeenInvitesStore.kt

@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.Flow @@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
class FakeSeenInvitesStore : SeenInvitesStore {
private val existing = MutableStateFlow(emptySet<RoomId>())
private var provided: Set<RoomId>? = null

1
features/leaveroom/impl/src/test/kotlin/io/element/android/features/leaveroom/impl/LeaveRoomPresenterImplTest.kt

@ -38,7 +38,6 @@ import org.junit.Rule @@ -38,7 +38,6 @@ import org.junit.Rule
import org.junit.Test
class LeaveRoomPresenterImplTest {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/leaveroom/test/src/main/kotlin/io/element/android/features/leaveroom/fake/FakeLeaveRoomPresenter.kt

@ -22,7 +22,6 @@ import io.element.android.features.leaveroom.api.LeaveRoomPresenter @@ -22,7 +22,6 @@ import io.element.android.features.leaveroom.api.LeaveRoomPresenter
import io.element.android.features.leaveroom.api.LeaveRoomState
class FakeLeaveRoomPresenter : LeaveRoomPresenter {
val events = mutableListOf<LeaveRoomEvent>()
private fun handleEvent(event: LeaveRoomEvent) {

6
features/location/api/build.gradle.kts

@ -45,14 +45,16 @@ android { @@ -45,14 +45,16 @@ android {
name = "maptiler_light_map_id",
value = System.getenv("ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID")
?: readLocalProperty("services.maptiler.lightMapId")
?: "basic-v2" // fall back to maptiler's default light map.
// fall back to maptiler's default light map.
?: "basic-v2"
)
resValue(
type = "string",
name = "maptiler_dark_map_id",
value = System.getenv("ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID")
?: readLocalProperty("services.maptiler.darkMapId")
?: "basic-v2-dark" // fall back to maptiler's default dark map.
// fall back to maptiler's default dark map.
?: "basic-v2-dark"
)
}
}

1
features/location/api/src/main/kotlin/io/element/android/features/location/api/ShowLocationEntryPoint.kt

@ -22,7 +22,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint @@ -22,7 +22,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint
import io.element.android.libraries.architecture.NodeInputs
interface ShowLocationEntryPoint : FeatureEntryPoint {
data class Inputs(val location: Location, val description: String?) : NodeInputs
fun createNode(parentNode: Node, buildContext: BuildContext, inputs: Inputs): Node

1
features/location/api/src/main/kotlin/io/element/android/features/location/api/internal/MapTilerStaticMapUrlBuilder.kt

@ -29,7 +29,6 @@ internal class MapTilerStaticMapUrlBuilder( @@ -29,7 +29,6 @@ internal class MapTilerStaticMapUrlBuilder(
private val lightMapId: String,
private val darkMapId: String,
) : StaticMapUrlBuilder {
constructor(context: Context) : this(
apiKey = context.apiKey,
lightMapId = context.mapId(darkMode = false),

1
features/location/api/src/main/kotlin/io/element/android/features/location/api/internal/MapTilerTileServerStyleUriBuilder.kt

@ -25,7 +25,6 @@ internal class MapTilerTileServerStyleUriBuilder( @@ -25,7 +25,6 @@ internal class MapTilerTileServerStyleUriBuilder(
private val lightMapId: String,
private val darkMapId: String,
) : TileServerStyleUriBuilder {
constructor(context: Context) : this(
apiKey = context.apiKey,
lightMapId = context.mapId(darkMode = false),

1
features/location/api/src/test/kotlin/io/element/android/features/location/api/LocationKtTest.kt

@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat @@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat
import org.junit.Test
internal class LocationKtTest {
@Test
fun `parseGeoUri - returns null for invalid urls`() {
assertThat(Location.fromGeoUri("")).isNull()

1
features/location/api/src/test/kotlin/io/element/android/features/location/api/internal/MapTilerStaticMapUrlBuilderTest.kt

@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat @@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat
import org.junit.Test
class MapTilerStaticMapUrlBuilderTest {
private val builder = MapTilerStaticMapUrlBuilder(
apiKey = "anApiKey",
lightMapId = "aLightMapId",

1
features/location/api/src/test/kotlin/io/element/android/features/location/api/internal/MapTilerTileServerStyleUriBuilderTest.kt

@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat @@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat
import org.junit.Test
class MapTilerTileServerStyleUriBuilderTest {
private val builder = MapTilerTileServerStyleUriBuilder(
apiKey = "anApiKey",
lightMapId = "aLightMapId",

1
features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/permissions/PermissionsPresenterImpl.kt

@ -29,7 +29,6 @@ import io.element.android.libraries.di.AppScope @@ -29,7 +29,6 @@ import io.element.android.libraries.di.AppScope
class PermissionsPresenterImpl @AssistedInject constructor(
@Assisted private val permissions: List<String>
) : PermissionsPresenter {
@AssistedFactory
@ContributesBinding(AppScope::class)
interface Factory : PermissionsPresenter.Factory {

1
features/location/impl/src/main/kotlin/io/element/android/features/location/impl/send/SendLocationNode.kt

@ -36,7 +36,6 @@ class SendLocationNode @AssistedInject constructor( @@ -36,7 +36,6 @@ class SendLocationNode @AssistedInject constructor(
private val presenter: SendLocationPresenter,
analyticsService: AnalyticsService,
) : Node(buildContext, plugins = plugins) {
init {
lifecycle.subscribe(
onResume = {

1
features/location/impl/src/main/kotlin/io/element/android/features/location/impl/send/SendLocationPresenter.kt

@ -47,7 +47,6 @@ class SendLocationPresenter @Inject constructor( @@ -47,7 +47,6 @@ class SendLocationPresenter @Inject constructor(
private val locationActions: LocationActions,
private val buildMeta: BuildMeta,
) : Presenter<SendLocationState> {
private val permissionsPresenter = permissionsPresenterFactory.create(MapDefaults.permissions)
@Composable

1
features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationNode.kt

@ -38,7 +38,6 @@ class ShowLocationNode @AssistedInject constructor( @@ -38,7 +38,6 @@ class ShowLocationNode @AssistedInject constructor(
@Assisted buildContext: BuildContext,
@Assisted plugins: List<Plugin>,
) : Node(buildContext, plugins = plugins) {
init {
lifecycle.subscribe(
onResume = {

1
features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationPresenter.kt

@ -42,7 +42,6 @@ class ShowLocationPresenter @AssistedInject constructor( @@ -42,7 +42,6 @@ class ShowLocationPresenter @AssistedInject constructor(
@Assisted private val location: Location,
@Assisted private val description: String?
) : Presenter<ShowLocationState> {
@AssistedFactory
interface Factory {
fun create(location: Location, description: String?): ShowLocationPresenter

1
features/location/impl/src/test/kotlin/io/element/android/features/location/impl/common/actions/AndroidLocationActionsTest.kt

@ -22,7 +22,6 @@ import org.junit.Test @@ -22,7 +22,6 @@ import org.junit.Test
import java.net.URLEncoder
internal class AndroidLocationActionsTest {
// We use an Android-native encoder in the actual app, switch to an equivalent JVM one for the tests
private fun urlEncoder(input: String) = URLEncoder.encode(input, "US-ASCII")

1
features/location/impl/src/test/kotlin/io/element/android/features/location/impl/common/actions/FakeLocationActions.kt

@ -19,7 +19,6 @@ package io.element.android.features.location.impl.common.actions @@ -19,7 +19,6 @@ package io.element.android.features.location.impl.common.actions
import io.element.android.features.location.api.Location
class FakeLocationActions : LocationActions {
var sharedLocation: Location? = null
private set

1
features/location/impl/src/test/kotlin/io/element/android/features/location/impl/common/permissions/PermissionsPresenterFake.kt

@ -19,7 +19,6 @@ package io.element.android.features.location.impl.common.permissions @@ -19,7 +19,6 @@ package io.element.android.features.location.impl.common.permissions
import androidx.compose.runtime.Composable
class PermissionsPresenterFake : PermissionsPresenter {
val events = mutableListOf<PermissionsEvents>()
private fun handleEvent(event: PermissionsEvents) {

1
features/location/impl/src/test/kotlin/io/element/android/features/location/impl/send/SendLocationPresenterTest.kt

@ -42,7 +42,6 @@ import org.junit.Rule @@ -42,7 +42,6 @@ import org.junit.Rule
import org.junit.Test
class SendLocationPresenterTest {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/location/impl/src/test/kotlin/io/element/android/features/location/impl/show/ShowLocationPresenterTest.kt

@ -35,7 +35,6 @@ import org.junit.Rule @@ -35,7 +35,6 @@ import org.junit.Rule
import org.junit.Test
class ShowLocationPresenterTest {
@get:Rule
val warmUpRule = WarmUpRule()

1
features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenEntryPoint.kt

@ -22,7 +22,6 @@ import com.bumble.appyx.core.plugin.Plugin @@ -22,7 +22,6 @@ import com.bumble.appyx.core.plugin.Plugin
import io.element.android.libraries.architecture.FeatureEntryPoint
interface LockScreenEntryPoint : FeatureEntryPoint {
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
interface NodeBuilder {

2
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenEntryPoint.kt

@ -26,13 +26,11 @@ import javax.inject.Inject @@ -26,13 +26,11 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultLockScreenEntryPoint @Inject constructor() : LockScreenEntryPoint {
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): LockScreenEntryPoint.NodeBuilder {
var innerTarget: LockScreenEntryPoint.Target = LockScreenEntryPoint.Target.Unlock
val callbacks = mutableListOf<LockScreenEntryPoint.Callback>()
return object : LockScreenEntryPoint.NodeBuilder {
override fun callback(callback: LockScreenEntryPoint.Callback): LockScreenEntryPoint.NodeBuilder {
callbacks += callback
return this

14
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenService.kt

@ -57,25 +57,24 @@ class DefaultLockScreenService @Inject constructor( @@ -57,25 +57,24 @@ class DefaultLockScreenService @Inject constructor(
private val appForegroundStateService: AppForegroundStateService,
private val biometricUnlockManager: BiometricUnlockManager,
) : LockScreenService {
private val _lockScreenState = MutableStateFlow<LockScreenLockState>(LockScreenLockState.Unlocked)
override val lockState: StateFlow<LockScreenLockState> = _lockScreenState
private val _lockState = MutableStateFlow<LockScreenLockState>(LockScreenLockState.Unlocked)
override val lockState: StateFlow<LockScreenLockState> = _lockState
private var lockJob: Job? = null
init {
pinCodeManager.addCallback(object : DefaultPinCodeManagerCallback() {
override fun onPinCodeVerified() {
_lockScreenState.value = LockScreenLockState.Unlocked
_lockState.value = LockScreenLockState.Unlocked
}
override fun onPinCodeRemoved() {
_lockScreenState.value = LockScreenLockState.Unlocked
_lockState.value = LockScreenLockState.Unlocked
}
})
biometricUnlockManager.addCallback(object : DefaultBiometricUnlockCallback() {
override fun onBiometricUnlockSuccess() {
_lockScreenState.value = LockScreenLockState.Unlocked
_lockState.value = LockScreenLockState.Unlocked
coroutineScope.launch {
lockScreenStore.resetCounter()
}
@ -91,7 +90,6 @@ class DefaultLockScreenService @Inject constructor( @@ -91,7 +90,6 @@ class DefaultLockScreenService @Inject constructor(
*/
private fun observeSessionsState() {
sessionObserver.addListener(object : SessionListener {
override suspend fun onSessionCreated(userId: String) = Unit
override suspend fun onSessionDeleted(userId: String) {
@ -135,7 +133,7 @@ class DefaultLockScreenService @Inject constructor( @@ -135,7 +133,7 @@ class DefaultLockScreenService @Inject constructor(
private fun CoroutineScope.lockIfNeeded(gracePeriod: Duration = Duration.ZERO) = launch {
if (isPinSetup().first()) {
delay(gracePeriod)
_lockScreenState.value = LockScreenLockState.Locked
_lockState.value = LockScreenLockState.Locked
}
}
}

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/LockScreenFlowNode.kt

@ -50,7 +50,6 @@ class LockScreenFlowNode @AssistedInject constructor( @@ -50,7 +50,6 @@ class LockScreenFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins,
) {
data class Inputs(
val initialNavTarget: NavTarget = NavTarget.Unlock,
) : NodeInputs

3
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/biometric/BiometricUnlock.kt

@ -31,7 +31,6 @@ import java.security.InvalidKeyException @@ -31,7 +31,6 @@ import java.security.InvalidKeyException
import javax.crypto.Cipher
interface BiometricUnlock {
interface Callback {
fun onBiometricSetupError()
fun onBiometricUnlockSuccess()
@ -62,7 +61,6 @@ class DefaultBiometricUnlock( @@ -62,7 +61,6 @@ class DefaultBiometricUnlock(
private val keyAlias: String,
private val callbacks: List<BiometricUnlock.Callback>
) : BiometricUnlock {
override val isActive: Boolean = true
private lateinit var cryptoObject: CryptoObject
@ -105,7 +103,6 @@ private class AuthenticationCallback( @@ -105,7 +103,6 @@ private class AuthenticationCallback(
private val callbacks: List<BiometricUnlock.Callback>,
private val deferredAuthenticationResult: CompletableDeferred<BiometricUnlock.AuthenticationResult>,
) : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
super.onAuthenticationError(errorCode, errString)
val biometricUnlockError = BiometricUnlockError(errorCode, errString.toString())

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/biometric/BiometricUnlockManager.kt

@ -19,7 +19,6 @@ package io.element.android.features.lockscreen.impl.biometric @@ -19,7 +19,6 @@ package io.element.android.features.lockscreen.impl.biometric
import androidx.compose.runtime.Composable
interface BiometricUnlockManager {
/**
* If the device is secured for example with a pin, pattern or password.
*/

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/biometric/DefaultBiometricUnlockManager.kt

@ -57,7 +57,6 @@ class DefaultBiometricUnlockManager @Inject constructor( @@ -57,7 +57,6 @@ class DefaultBiometricUnlockManager @Inject constructor(
private val secretKeyRepository: SecretKeyRepository,
private val coroutineScope: CoroutineScope,
) : BiometricUnlockManager {
private val callbacks = CopyOnWriteArrayList<BiometricUnlock.Callback>()
private val biometricManager = BiometricManager.from(context)
private val keyguardManager: KeyguardManager = context.getSystemService()!!

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/components/PinEntryTextField.kt

@ -99,7 +99,6 @@ private fun PinDigitView( @@ -99,7 +99,6 @@ private fun PinDigitView(
.size(48.dp)
.then(appearanceModifier),
contentAlignment = Alignment.Center,
) {
if (digit is PinDigit.Filled) {
val text = if (isSecured) {

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/DefaultPinCodeManager.kt

@ -36,7 +36,6 @@ class DefaultPinCodeManager @Inject constructor( @@ -36,7 +36,6 @@ class DefaultPinCodeManager @Inject constructor(
private val encryptionDecryptionService: EncryptionDecryptionService,
private val lockScreenStore: LockScreenStore,
) : PinCodeManager {
private val callbacks = CopyOnWriteArrayList<PinCodeManager.Callback>()
override fun addCallback(callback: PinCodeManager.Callback) {

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/PinCodeManager.kt

@ -23,7 +23,6 @@ import kotlinx.coroutines.flow.Flow @@ -23,7 +23,6 @@ import kotlinx.coroutines.flow.Flow
* Implementation should take care of encrypting the pin code and storing it.
*/
interface PinCodeManager {
/**
* Callbacks for pin code management events.
*/

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/model/PinEntry.kt

@ -22,7 +22,6 @@ import kotlinx.collections.immutable.toPersistentList @@ -22,7 +22,6 @@ import kotlinx.collections.immutable.toPersistentList
data class PinEntry(
val digits: ImmutableList<PinDigit>,
) {
companion object {
fun createEmpty(size: Int): PinEntry {
val digits = List(size) { PinDigit.Empty }

2
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsFlowNode.kt

@ -56,7 +56,6 @@ class LockScreenSettingsFlowNode @AssistedInject constructor( @@ -56,7 +56,6 @@ class LockScreenSettingsFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins,
) {
sealed interface NavTarget : Parcelable {
@Parcelize
data object Unknown : NavTarget
@ -72,7 +71,6 @@ class LockScreenSettingsFlowNode @AssistedInject constructor( @@ -72,7 +71,6 @@ class LockScreenSettingsFlowNode @AssistedInject constructor(
}
private val pinCodeManagerCallback = object : DefaultPinCodeManagerCallback() {
override fun onPinCodeRemoved() {
navigateUp()
}

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsNode.kt

@ -33,7 +33,6 @@ class LockScreenSettingsNode @AssistedInject constructor( @@ -33,7 +33,6 @@ class LockScreenSettingsNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: LockScreenSettingsPresenter,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onChangePinClicked()
}

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsPresenter.kt

@ -39,7 +39,6 @@ class LockScreenSettingsPresenter @Inject constructor( @@ -39,7 +39,6 @@ class LockScreenSettingsPresenter @Inject constructor(
private val biometricUnlockManager: BiometricUnlockManager,
private val coroutineScope: CoroutineScope,
) : Presenter<LockScreenSettingsState> {
@Composable
override fun present(): LockScreenSettingsState {
val showRemovePinOption by produceState(initialValue = false) {

2
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/LockScreenSetupFlowNode.kt

@ -52,7 +52,6 @@ class LockScreenSetupFlowNode @AssistedInject constructor( @@ -52,7 +52,6 @@ class LockScreenSetupFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins,
) {
interface Callback : Plugin {
fun onSetupDone()
}
@ -70,7 +69,6 @@ class LockScreenSetupFlowNode @AssistedInject constructor( @@ -70,7 +69,6 @@ class LockScreenSetupFlowNode @AssistedInject constructor(
}
private val pinCodeManagerCallback = object : DefaultPinCodeManagerCallback() {
override fun onPinCodeCreated() {
backstack.newRoot(NavTarget.Biometric)
}

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/biometric/SetupBiometricNode.kt

@ -34,7 +34,6 @@ class SetupBiometricNode @AssistedInject constructor( @@ -34,7 +34,6 @@ class SetupBiometricNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: SetupBiometricPresenter,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onBiometricSetupDone()
}

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/biometric/SetupBiometricPresenter.kt

@ -30,7 +30,6 @@ import javax.inject.Inject @@ -30,7 +30,6 @@ import javax.inject.Inject
class SetupBiometricPresenter @Inject constructor(
private val lockScreenStore: LockScreenStore,
) : Presenter<SetupBiometricState> {
@Composable
override fun present(): SetupBiometricState {
var isBiometricSetupDone by remember {

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinNode.kt

@ -32,7 +32,6 @@ class SetupPinNode @AssistedInject constructor( @@ -32,7 +32,6 @@ class SetupPinNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: SetupPinPresenter,
) : Node(buildContext, plugins = plugins) {
@Composable
override fun View(modifier: Modifier) {
val state = presenter.present()

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinPresenter.kt

@ -43,7 +43,6 @@ class SetupPinPresenter @Inject constructor( @@ -43,7 +43,6 @@ class SetupPinPresenter @Inject constructor(
private val buildMeta: BuildMeta,
private val pinCodeManager: PinCodeManager,
) : Presenter<SetupPinState> {
@Composable
override fun present(): SetupPinState {
var choosePinEntry by remember {

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinStateProvider.kt

@ -41,7 +41,6 @@ open class SetupPinStateProvider : PreviewParameterProvider<SetupPinState> { @@ -41,7 +41,6 @@ open class SetupPinStateProvider : PreviewParameterProvider<SetupPinState> {
choosePinEntry = PinEntry.createEmpty(4).fillWith("1111"),
creationFailure = SetupPinFailure.PinBlacklisted
),
)
}

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/validation/PinValidator.kt

@ -21,7 +21,6 @@ import io.element.android.features.lockscreen.impl.pin.model.PinEntry @@ -21,7 +21,6 @@ import io.element.android.features.lockscreen.impl.pin.model.PinEntry
import javax.inject.Inject
class PinValidator @Inject constructor(private val lockScreenConfig: LockScreenConfig) {
sealed interface Result {
data object Valid : Result
data class Invalid(val failure: SetupPinFailure) : Result

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/storage/LockScreenStore.kt

@ -19,7 +19,6 @@ package io.element.android.features.lockscreen.impl.storage @@ -19,7 +19,6 @@ package io.element.android.features.lockscreen.impl.storage
import kotlinx.coroutines.flow.Flow
interface LockScreenStore : EncryptedPinCodeStorage {
/**
* Returns the remaining PIN code attempts. When this reaches 0 the PIN code access won't be available for some time.
*/

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/storage/PreferencesLockScreenStore.kt

@ -42,7 +42,6 @@ class PreferencesLockScreenStore @Inject constructor( @@ -42,7 +42,6 @@ class PreferencesLockScreenStore @Inject constructor(
@ApplicationContext private val context: Context,
private val lockScreenConfig: LockScreenConfig,
) : LockScreenStore {
private val pinCodeKey = stringPreferencesKey("encoded_pin_code")
private val remainingAttemptsKey = intPreferencesKey("remaining_pin_code_attempts")
private val biometricUnlockKey = booleanPreferencesKey("biometric_unlock_enabled")

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockHelper.kt

@ -28,7 +28,6 @@ class PinUnlockHelper @Inject constructor( @@ -28,7 +28,6 @@ class PinUnlockHelper @Inject constructor(
private val biometricUnlockManager: BiometricUnlockManager,
private val pinCodeManager: PinCodeManager
) {
@Composable
fun OnUnlockEffect(onUnlock: () -> Unit) {
DisposableEffect(Unit) {

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockNode.kt

@ -36,7 +36,6 @@ class PinUnlockNode @AssistedInject constructor( @@ -36,7 +36,6 @@ class PinUnlockNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val presenter: PinUnlockPresenter,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onUnlock()
}

1
features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockPresenter.kt

@ -45,7 +45,6 @@ class PinUnlockPresenter @Inject constructor( @@ -45,7 +45,6 @@ class PinUnlockPresenter @Inject constructor(
private val coroutineScope: CoroutineScope,
private val pinUnlockHelper: PinUnlockHelper,
) : Presenter<PinUnlockState> {
@Composable
override fun present(): PinUnlockState {
val pinEntryState = remember {

1
features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/biometric/FakeBiometricUnlockManager.kt

@ -20,7 +20,6 @@ import androidx.compose.runtime.Composable @@ -20,7 +20,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
class FakeBiometricUnlockManager : BiometricUnlockManager {
override var isDeviceSecured: Boolean = true
override var hasAvailableAuthenticator: Boolean = false

1
features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/pin/DefaultPinCodeManagerTest.kt

@ -25,7 +25,6 @@ import kotlinx.coroutines.test.runTest @@ -25,7 +25,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
class DefaultPinCodeManagerTest {
private val lockScreenStore = InMemoryLockScreenStore()
private val secretKeyRepository = SimpleSecretKeyRepository()
private val encryptionDecryptionService = AESEncryptionDecryptionService()

1
features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/pin/model/PinEntryTest.kt

@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat @@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat
import org.junit.Test
class PinEntryTest {
@Test
fun `when using fillWith with empty string ensure pin is empty`() {
val pinEntry = PinEntry.createEmpty(4)

1
features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/pin/storage/InMemoryLockScreenStore.kt

@ -23,7 +23,6 @@ import kotlinx.coroutines.flow.MutableStateFlow @@ -23,7 +23,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
private const val DEFAULT_REMAINING_ATTEMPTS = 3
class InMemoryLockScreenStore : LockScreenStore {
private val hasPinCode = MutableStateFlow(false)
private var pinCode: String? = null
set(value) {

1
features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsPresenterTest.kt

@ -32,7 +32,6 @@ import kotlinx.coroutines.test.runTest @@ -32,7 +32,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
class LockScreenSettingsPresenterTest {
@Test
fun `present - remove pin flow`() = runTest {
val presenter = createLockScreenSettingsPresenter(this)

1
features/lockscreen/impl/src/test/kotlin/io/element/android/features/lockscreen/impl/setup/biometric/SetupBiometricPresenterTest.kt

@ -27,7 +27,6 @@ import kotlinx.coroutines.test.runTest @@ -27,7 +27,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
class SetupBiometricPresenterTest {
@Test
fun `present - allow flow`() = runTest {
val lockScreenStore = InMemoryLockScreenStore()

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save