Add full screen intent permissions banner (#3024)

* Add full screen intent permissions banner, creating `:libraries:fullscreenintent` modules.
* Add it to notification settings too:
    - Create `libraries:fullscreenintent` modules for the permission presenter and associated data.
    - Add the presenter and states to `NotificationSettingsPresenter` and `NotificationSettingsView`.
* Use the right API to check for full screen intent permissions.
- Use the right package name for `:libraries:permission` contents.
* Fix broken tests (flaky?)
* Ignore coverage verification for fake and small presenters

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2024-06-18 09:41:10 +02:00 committed by GitHub
parent 7322c75a67
commit feef0f6976
163 changed files with 867 additions and 48 deletions

View file

@ -23,8 +23,9 @@ android {
dependencies {
api(projects.libraries.preferences.api)
implementation(libs.coroutines.core)
implementation(projects.libraries.matrix.api)
implementation(projects.tests.testutils)
implementation(libs.coroutines.core)
implementation(libs.androidx.datastore.preferences)
}
}

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2024 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.libraries.preferences.test
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import io.element.android.libraries.preferences.api.store.PreferenceDataStoreFactory
import java.io.File
import androidx.datastore.preferences.core.PreferenceDataStoreFactory as AndroidPreferenceDataStoreFactory
class FakePreferenceDataStoreFactory : PreferenceDataStoreFactory {
override fun create(name: String): DataStore<Preferences> {
return AndroidPreferenceDataStoreFactory.create { File.createTempFile("test", ".preferences_pb") }
}
}

View file

@ -16,9 +16,9 @@
package io.element.android.libraries.preferences.test
import io.element.android.features.preferences.api.store.SessionPreferencesStore
import io.element.android.features.preferences.api.store.SessionPreferencesStoreFactory
import io.element.android.libraries.matrix.api.core.SessionId
import io.element.android.libraries.preferences.api.store.SessionPreferencesStore
import io.element.android.libraries.preferences.api.store.SessionPreferencesStoreFactory
import io.element.android.tests.testutils.lambda.LambdaOneParamRecorder
import io.element.android.tests.testutils.lambda.LambdaTwoParamsRecorder
import io.element.android.tests.testutils.lambda.lambdaError

View file

@ -16,7 +16,7 @@
package io.element.android.libraries.preferences.test
import io.element.android.features.preferences.api.store.AppPreferencesStore
import io.element.android.libraries.preferences.api.store.AppPreferencesStore
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow

View file

@ -16,7 +16,7 @@
package io.element.android.libraries.preferences.test
import io.element.android.features.preferences.api.store.SessionPreferencesStore
import io.element.android.libraries.preferences.api.store.SessionPreferencesStore
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow