1
0
mirror of https://github.com/vector-im/riotX-android synced 2025-10-05 15:52:47 +02:00

Upgrade a few dependencies and update the codebase

Use fully qualified R classes
Fix or ignore deprecation
Update github actions and ensure JDK 17 is used
Add group for paparazzi
Fixes Lint issues
Fix Jacoco configuration
This commit is contained in:
Benoit Marty
2024-07-15 18:12:08 +02:00
parent 84b8d410d5
commit 19500a8cd9
711 changed files with 4776 additions and 4296 deletions

View File

@@ -250,7 +250,7 @@ android {
resValue "string", "app_name", "Element - dbg"
if (project.hasProperty("coverage")) {
testCoverageEnabled = coverage == "true"
testCoverageEnabled = project.coverage == "true"
}
}
@@ -342,7 +342,7 @@ android {
}
}
lintOptions {
lint {
lintConfig file("../tools/lint/lint.xml")
checkDependencies true
@@ -355,7 +355,7 @@ android {
}
kotlinOptions {
jvmTarget = "11"
jvmTarget = versions.jvmTarget
freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn",
// Fixes false positive "This is an internal Mavericks API. It is not intended for external use."
@@ -370,6 +370,7 @@ android {
buildFeatures {
viewBinding true
buildConfig true
}
}
@@ -377,6 +378,7 @@ dependencies {
implementation project(':vector')
implementation project(':vector-config')
implementation project(':library:core-utils')
implementation project(':library:ui-strings')
debugImplementation project(':library:external:span')
debugImplementation project(':library:ui-styles')
implementation libs.dagger.hilt
@@ -393,7 +395,7 @@ dependencies {
debugImplementation 'com.facebook.soloader:soloader:0.10.5'
debugImplementation "com.kgurgul.flipper:flipper-realm-android:2.2.0"
gplayImplementation "com.google.android.gms:play-services-location:21.0.1"
gplayImplementation "com.google.android.gms:play-services-location:21.3.0"
// UnifiedPush gplay flavor only
gplayImplementation platform(libs.google.firebaseBom)
gplayImplementation(libs.google.messaging) {
@@ -409,7 +411,7 @@ dependencies {
nightlyImplementation libs.google.appdistribution
// OSS License, gplay flavor only
gplayImplementation 'com.google.android.gms:play-services-oss-licenses:17.0.1'
gplayImplementation 'com.google.android.gms:play-services-oss-licenses:17.1.0'
kapt libs.dagger.hiltCompiler
ksp libs.airbnb.epoxyProcessor

View File

@@ -80,3 +80,16 @@
# JNA
-keep class com.sun.jna.** { *; }
-keep class * implements com.sun.jna.** { *; }
# New
-dontwarn com.google.appengine.api.urlfetch.**
-dontwarn com.google.common.io.LimitInputStream
-dontwarn com.google.firebase.analytics.connector.AnalyticsConnector
-dontwarn com.google.javascript.jscomp.**
-dontwarn com.likethesalad.android.templates.provider.api.TemplatesProvider
-dontwarn com.yahoo.platform.yui.compressor.**
-dontwarn java.awt.**
-dontwarn org.apache.velocity.**
-dontwarn org.commonmark.ext.gfm.strikethrough.Strikethrough
-dontwarn org.mozilla.javascript.**
-dontwarn org.slf4j.**

View File

@@ -26,6 +26,7 @@ import androidx.test.filters.LargeTest
import com.adevinta.android.barista.internal.viewaction.SleepViewAction
import im.vector.app.features.MainActivity
import im.vector.app.ui.robot.ElementRobot
import im.vector.lib.strings.CommonStrings
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
@@ -61,7 +62,7 @@ class CantVerifyTest {
val activity = EspressoHelper.getCurrentActivity()!!
Espresso.onView(ViewMatchers.isRoot())
.perform(waitForView(ViewMatchers.withText(R.string.crosssigning_cannot_verify_this_session)))
.perform(waitForView(ViewMatchers.withText(CommonStrings.crosssigning_cannot_verify_this_session)))
// check that the text is correct
val popup = activity.findViewById<View>(com.tapadoo.alerter.R.id.llAlertBackground)!!
@@ -73,7 +74,7 @@ class CantVerifyTest {
Espresso.onView(ViewMatchers.isRoot()).perform(SleepViewAction.sleep(2000))
Espresso.onView(ViewMatchers.withText(R.string.bottom_sheet_setup_secure_backup_title))
Espresso.onView(ViewMatchers.withText(CommonStrings.bottom_sheet_setup_secure_backup_title))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
}
}

View File

@@ -31,6 +31,7 @@ import androidx.test.filters.LargeTest
import im.vector.app.features.MainActivity
import im.vector.app.features.analytics.ui.consent.AnalyticsOptInActivity
import im.vector.app.features.home.HomeActivity
import im.vector.lib.strings.CommonStrings
import org.hamcrest.CoreMatchers.not
import org.junit.Ignore
import org.junit.Rule
@@ -55,7 +56,7 @@ class RegistrationTest {
// Check splashscreen is there
onView(withId(R.id.loginSplashSubmit))
.check(matches(isDisplayed()))
.check(matches(withText(R.string.login_splash_submit)))
.check(matches(withText(CommonStrings.login_splash_submit)))
// Click on get started
onView(withId(R.id.loginSplashSubmit))
@@ -64,7 +65,7 @@ class RegistrationTest {
// Check that homeserver options are shown
onView(withId(R.id.loginServerTitle))
.check(matches(isDisplayed()))
.check(matches(withText(R.string.login_server_title)))
.check(matches(withText(CommonStrings.login_server_title)))
// Chose custom server
onView(withId(R.id.loginServerChoiceOther))

View File

@@ -42,6 +42,7 @@ import im.vector.app.core.utils.getMatrixInstance
import im.vector.app.features.MainActivity
import im.vector.app.features.crypto.recover.SetupMode
import im.vector.app.features.home.HomeActivity
import im.vector.lib.strings.CommonStrings
import org.hamcrest.CoreMatchers.not
import org.junit.Before
import org.junit.Ignore
@@ -109,7 +110,7 @@ class SecurityBootstrapTest : VerificationTestBase() {
.perform(click())
onView(isRoot())
.perform(waitForView(withText(R.string.bootstrap_info_text_2)))
.perform(waitForView(withText(CommonStrings.bootstrap_info_text_2)))
// test back
onView(isRoot()).perform(pressBack())
@@ -124,7 +125,7 @@ class SecurityBootstrapTest : VerificationTestBase() {
.perform(click())
onView(isRoot())
.perform(waitForView(withText(R.string.bootstrap_info_text_2)))
.perform(waitForView(withText(CommonStrings.bootstrap_info_text_2)))
onView(withId(R.id.ssss_passphrase_enter_edittext))
.perform(typeText("person woman man camera tv"))
@@ -139,7 +140,7 @@ class SecurityBootstrapTest : VerificationTestBase() {
onView(withId(R.id.bootstrapSubmit))
.perform(closeSoftKeyboard(), click())
onView(withText(R.string.passphrase_passphrase_does_not_match)).check(matches(isDisplayed()))
onView(withText(CommonStrings.passphrase_passphrase_does_not_match)).check(matches(isDisplayed()))
onView(withId(R.id.ssss_passphrase_enter_edittext))
.perform(replaceText("person woman man camera tv"))
@@ -148,7 +149,7 @@ class SecurityBootstrapTest : VerificationTestBase() {
.perform(closeSoftKeyboard(), click())
onView(withId(R.id.bottomSheetScrollView))
.perform(waitForView(withText(R.string.bottom_sheet_save_your_recovery_key_content)))
.perform(waitForView(withText(CommonStrings.bottom_sheet_save_your_recovery_key_content)))
intending(hasAction(Intent.ACTION_SEND)).respondWith(ActivityResult(Activity.RESULT_OK, null))
@@ -156,12 +157,12 @@ class SecurityBootstrapTest : VerificationTestBase() {
.perform(click())
// Dismiss dialog
onView(withText(R.string.ok)).inRoot(RootMatchers.isDialog()).perform(click())
onView(withText(CommonStrings.ok)).inRoot(RootMatchers.isDialog()).perform(click())
onView(withId(R.id.bottomSheetScrollView))
.perform(waitForView(withText(R.string.bottom_sheet_save_your_recovery_key_content)))
.perform(waitForView(withText(CommonStrings.bottom_sheet_save_your_recovery_key_content)))
onView(withText(R.string._continue)).perform(click())
onView(withText(CommonStrings._continue)).perform(click())
// Assert that all is configured
val crossSigningInitialized = runBlockingTest {

View File

@@ -27,6 +27,7 @@ import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.home.HomeActivity
import im.vector.app.ui.robot.AnalyticsRobot
import im.vector.app.ui.robot.OnboardingRobot
import im.vector.lib.strings.CommonStrings
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
@@ -184,18 +185,18 @@ abstract class VerificationTestBase {
Espresso.onView(ViewMatchers.isRoot())
.perform(waitForView(ViewMatchers.withId(R.id.bottomSheetFragmentContainer)))
Espresso.onView(ViewMatchers.withText(R.string.verification_verify_identity))
Espresso.onView(ViewMatchers.withText(CommonStrings.verification_verify_identity))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
// 4S is not setup so passphrase option should be hidden
Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.check(ViewAssertions.matches(CoreMatchers.not(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_cannot_access_other_session)))))
.check(ViewAssertions.matches(CoreMatchers.not(ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.verification_cannot_access_other_session)))))
Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_verify_with_another_device))))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.verification_verify_with_another_device))))
Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.bad_passphrase_key_reset_all_action))))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.bad_passphrase_key_reset_all_action))))
return uiSession
}

View File

@@ -31,6 +31,7 @@ import androidx.test.filters.LargeTest
import im.vector.app.core.utils.getMatrixInstance
import im.vector.app.features.MainActivity
import im.vector.app.ui.robot.ElementRobot
import im.vector.lib.strings.CommonStrings
import kotlinx.coroutines.test.runTest
import org.amshove.kluent.internal.assertEquals
import org.junit.After
@@ -117,13 +118,13 @@ class VerifySessionInteractiveTest : VerificationTestBase() {
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.verification_verify_with_another_device)),
hasDescendant(withText(CommonStrings.verification_verify_with_another_device)),
click()
)
)
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.check(matches(hasDescendant(withText(R.string.verification_request_was_sent))))
.check(matches(hasDescendant(withText(CommonStrings.verification_request_was_sent))))
val txId = runBlockingTest {
otherRequest.await().transactionId
@@ -139,9 +140,9 @@ class VerifySessionInteractiveTest : VerificationTestBase() {
}
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(waitForView(hasDescendant(withText(R.string.verification_scan_self_notice))))
.perform(waitForView(hasDescendant(withText(CommonStrings.verification_scan_self_notice))))
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(waitForView(hasDescendant(withText(R.string.verification_scan_self_emoji_subtitle))))
.perform(waitForView(hasDescendant(withText(CommonStrings.verification_scan_self_emoji_subtitle))))
// there should be the QR code also
onView(withId(R.id.bottomSheetVerificationRecyclerView))
@@ -151,16 +152,16 @@ class VerifySessionInteractiveTest : VerificationTestBase() {
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.verification_scan_self_emoji_subtitle)),
hasDescendant(withText(CommonStrings.verification_scan_self_emoji_subtitle)),
click()
)
)
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(waitForView(hasDescendant(withText(R.string.verification_sas_do_not_match))))
.perform(waitForView(hasDescendant(withText(CommonStrings.verification_sas_do_not_match))))
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(waitForView(hasDescendant(withText(R.string.verification_sas_match))))
.perform(waitForView(hasDescendant(withText(CommonStrings.verification_sas_match))))
// check that the code matches
val uiCode = runBlockingTest {
@@ -190,19 +191,19 @@ class VerifySessionInteractiveTest : VerificationTestBase() {
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.verification_sas_match)),
hasDescendant(withText(CommonStrings.verification_sas_match)),
click()
)
)
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(waitForView(hasDescendant(withText(R.string.verification_conclusion_ok_notice))))
.perform(waitForView(hasDescendant(withText(CommonStrings.verification_conclusion_ok_notice))))
// click on done
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.done)),
hasDescendant(withText(CommonStrings.done)),
click()
)
)

View File

@@ -31,6 +31,7 @@ import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.MainActivity
import im.vector.app.features.home.HomeActivity
import im.vector.app.ui.robot.ElementRobot
import im.vector.lib.strings.CommonStrings
import kotlinx.coroutines.test.runTest
import org.junit.After
import org.junit.Before
@@ -102,13 +103,13 @@ class VerifySessionNavigationTest : VerificationTestBase() {
Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
RecyclerViewActions.actionOnItem<RecyclerView.ViewHolder>(
ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_verify_with_another_device)),
ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.verification_verify_with_another_device)),
ViewActions.click()
)
)
Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_request_was_sent))))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.verification_request_was_sent))))
val txId = runBlockingTest {
otherRequest.await().transactionId
@@ -127,7 +128,7 @@ class VerifySessionNavigationTest : VerificationTestBase() {
.perform(waitForView(ViewMatchers.withId(R.id.bottomSheetFragmentContainer)))
Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_verify_with_another_device))))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.verification_verify_with_another_device))))
runBlockingTest {
otherGetCancelledRequest.await()

View File

@@ -43,6 +43,7 @@ import im.vector.app.features.crypto.recover.Params
import im.vector.app.features.crypto.recover.SetupMode
import im.vector.app.features.home.HomeActivity
import im.vector.app.ui.robot.AnalyticsRobot
import im.vector.lib.strings.CommonStrings
import kotlinx.coroutines.runBlocking
import org.junit.Before
import org.junit.Ignore
@@ -148,17 +149,17 @@ class VerifySessionPassphraseTest : VerificationTestBase() {
onView(isRoot())
.perform(waitForView(withId(R.id.bottomSheetFragmentContainer)))
onView(withText(R.string.verification_verify_identity))
onView(withText(CommonStrings.verification_verify_identity))
.check(matches(isDisplayed()))
// 4S is setup so passphrase option should be visible
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.check(matches((hasDescendant(withText(R.string.verification_cannot_access_other_session)))))
.check(matches((hasDescendant(withText(CommonStrings.verification_cannot_access_other_session)))))
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.verification_cannot_access_other_session)),
hasDescendant(withText(CommonStrings.verification_cannot_access_other_session)),
click()
)
)
@@ -178,14 +179,14 @@ class VerifySessionPassphraseTest : VerificationTestBase() {
withIdlingResource(activityIdlingResource(HomeActivity::class.java)) {
System.out.println("*** passphrase 1.1")
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(waitForView(hasDescendant(withText(R.string.verification_conclusion_ok_notice))))
.perform(waitForView(hasDescendant(withText(CommonStrings.verification_conclusion_ok_notice))))
}
// click on done
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.done)),
hasDescendant(withText(CommonStrings.done)),
click()
)
)

View File

@@ -30,13 +30,12 @@ import androidx.test.espresso.matcher.ViewMatchers.isFocusable
import androidx.test.espresso.matcher.ViewMatchers.withClassName
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import im.vector.app.R
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.instanceOf
import org.hamcrest.Matchers.`is`
fun clickOnPreference(@StringRes textResId: Int) {
onView(withId(R.id.recycler_view))
onView(withId(androidx.preference.R.id.recycler_view))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
allOf(

View File

@@ -23,13 +23,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.GrantPermissionRule
import im.vector.app.R
import im.vector.app.espresso.tools.ScreenshotFailureRule
import im.vector.app.features.MainActivity
import im.vector.app.getString
import im.vector.app.ui.robot.ElementRobot
import im.vector.app.ui.robot.settings.labs.LabFeaturesPreferences
import im.vector.app.ui.robot.withDeveloperMode
import im.vector.lib.strings.CommonStrings
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
@@ -55,7 +55,7 @@ class UiAllScreensSanityTest {
InstrumentationRegistry.getInstrumentation()
.targetContext
.resources
.getBoolean(R.bool.settings_labs_new_app_layout_default)
.getBoolean(im.vector.app.config.R.bool.settings_labs_new_app_layout_default)
)
)
@@ -151,7 +151,7 @@ class UiAllScreensSanityTest {
advancedSettings { crawlDeveloperOptions() }
}
roomList {
openRoom(getString(R.string.room_displayname_empty_room)) {
openRoom(getString(CommonStrings.room_displayname_empty_room)) {
val message = "Test view source"
postMessage(message)
openMessageMenu(message) {

View File

@@ -23,6 +23,7 @@ import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilActivityVisible
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.analytics.ui.consent.AnalyticsOptInActivity
import im.vector.lib.strings.CommonStrings
class AnalyticsRobot {
@@ -38,7 +39,7 @@ class AnalyticsRobot {
waitUntilActivityVisible<AnalyticsOptInActivity> {
waitUntilViewVisible(withId(R.id.title))
}
assertDisplayed(R.id.title, R.string.analytics_opt_in_title)
assertDisplayed(R.id.title, CommonStrings.analytics_opt_in_title)
if (optIn) {
clickOn(R.id.submit)
} else {

View File

@@ -29,6 +29,7 @@ import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilActivityVisible
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.home.room.detail.RoomDetailActivity
import im.vector.lib.strings.CommonStrings
import org.hamcrest.CoreMatchers.allOf
class CreateNewRoomRobot(
@@ -39,7 +40,7 @@ class CreateNewRoomRobot(
createdRoom = true
BaristaListAssertions.assertListItemCount(R.id.createRoomForm, 12)
roomName?.let {
onView(allOf(withId(R.id.formTextInputTextInputEditText), withHint(R.string.create_room_name_hint)))
onView(allOf(withId(R.id.formTextInputTextInputEditText), withHint(CommonStrings.create_room_name_hint)))
.perform(replaceText(roomName))
closeSoftKeyboard()
}
@@ -53,7 +54,7 @@ class CreateNewRoomRobot(
fun crawl() {
// Room access bottom sheet
BaristaClickInteractions.clickOn(R.string.room_settings_room_access_private_title)
BaristaClickInteractions.clickOn(CommonStrings.room_settings_room_access_private_title)
pressBack()
}
}

View File

@@ -49,6 +49,7 @@ import im.vector.app.ui.robot.settings.labs.LabFeature
import im.vector.app.ui.robot.settings.labs.LabFeaturesPreferences
import im.vector.app.ui.robot.space.SpaceRobot
import im.vector.app.withIdlingResource
import im.vector.lib.strings.CommonStrings
import timber.log.Timber
class ElementRobot(
@@ -100,7 +101,7 @@ class ElementRobot(
openActionBarOverflowOrOptionsMenu(
ApplicationProvider.getApplicationContext()
)
clickOn(R.string.home_layout_preferences)
clickOn(CommonStrings.home_layout_preferences)
waitUntilDialogVisible(withId(R.id.home_layout_settings_recents))
block(LayoutPreferencesRobot())
@@ -149,7 +150,7 @@ class ElementRobot(
LabFeature.THREAD_MESSAGES -> {
settings(shouldGoBack = false) {
labs(shouldGoBack = false) {
onView(withText(R.string.labs_enable_thread_messages))
onView(withText(CommonStrings.labs_enable_thread_messages))
.check(ViewAssertions.matches(isDisplayed()))
.perform(ViewActions.closeSoftKeyboard(), click())
}
@@ -185,9 +186,9 @@ class ElementRobot(
onView(withId((R.id.avatar)))
.perform(click())
waitUntilActivityVisible<VectorSettingsActivity> {
clickOn(R.string.settings_general_title)
clickOn(CommonStrings.settings_general_title)
}
clickOnPreference(R.string.action_sign_out)
clickOnPreference(CommonStrings.action_sign_out)
} else {
clickOn(R.id.groupToolbarAvatarImageView)
clickOn(R.id.homeDrawerHeaderSignoutView)

View File

@@ -29,6 +29,7 @@ import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.home.room.detail.timeline.edithistory.ViewEditHistoryBottomSheet
import im.vector.app.features.reactions.EmojiReactionPickerActivity
import im.vector.app.interactWithSheet
import im.vector.lib.strings.CommonStrings
import java.lang.Thread.sleep
class MessageMenuRobot(
@@ -36,7 +37,7 @@ class MessageMenuRobot(
) {
fun viewSource() {
clickOn(R.string.view_source)
clickOn(CommonStrings.view_source)
// wait for library
sleep(1000)
pressBack()
@@ -44,8 +45,8 @@ class MessageMenuRobot(
}
fun editHistory() {
clickOn(R.string.message_view_edit_history)
interactWithSheet<ViewEditHistoryBottomSheet>(withText(R.string.message_edits), openState = BottomSheetBehavior.STATE_COLLAPSED) {
clickOn(CommonStrings.message_view_edit_history)
interactWithSheet<ViewEditHistoryBottomSheet>(withText(CommonStrings.message_edits), openState = BottomSheetBehavior.STATE_COLLAPSED) {
pressBack()
}
autoClosed = true
@@ -57,7 +58,7 @@ class MessageMenuRobot(
}
fun addReactionFromEmojiPicker() {
clickOn(R.string.message_add_reaction)
clickOn(CommonStrings.message_add_reaction)
// Wait for emoji to load, it's async now
waitUntilActivityVisible<EmojiReactionPickerActivity> {
closeSoftKeyboard()
@@ -69,17 +70,17 @@ class MessageMenuRobot(
}
fun edit() {
clickOn(R.string.edit)
clickOn(CommonStrings.edit)
autoClosed = true
}
fun replyInThread() {
clickOn(R.string.reply_in_thread)
clickOn(CommonStrings.reply_in_thread)
autoClosed = true
}
fun viewInRoom() {
clickOn(R.string.view_in_room)
clickOn(CommonStrings.view_in_room)
autoClosed = true
}
}

View File

@@ -20,16 +20,17 @@ import androidx.test.espresso.Espresso
import androidx.test.espresso.matcher.ViewMatchers
import im.vector.app.R
import im.vector.app.waitForView
import im.vector.lib.strings.CommonStrings
class NewDirectMessageRobot {
fun verifyQrCodeButton() {
Espresso.onView(ViewMatchers.withId(R.id.userListRecyclerView))
.perform(waitForView(ViewMatchers.withText(R.string.qr_code)))
.perform(waitForView(ViewMatchers.withText(CommonStrings.qr_code)))
}
fun verifyInviteFriendsButton() {
Espresso.onView(ViewMatchers.withId(R.id.userListRecyclerView))
.perform(waitForView(ViewMatchers.withText(R.string.invite_friends)))
.perform(waitForView(ViewMatchers.withText(CommonStrings.invite_friends)))
}
}

View File

@@ -24,6 +24,7 @@ import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.VectorFeatures
import im.vector.app.ui.robot.settings.labs.LabFeaturesPreferences
import im.vector.lib.strings.CommonStrings
class NewRoomRobot(
var createdRoom: Boolean = false,
@@ -32,7 +33,7 @@ class NewRoomRobot(
private val features: VectorFeatures = DefaultVectorFeatures()
fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) {
clickOn(R.string.create_new_room)
clickOn(CommonStrings.create_new_room)
waitUntilViewVisible(withId(R.id.createRoomForm))
val createNewRoomRobot = CreateNewRoomRobot()
block(createNewRoomRobot)

View File

@@ -31,6 +31,7 @@ import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.waitForView
import im.vector.lib.strings.CommonStrings
class OnboardingRobot {
private val defaultVectorFeatures = DefaultVectorFeatures()
@@ -46,7 +47,7 @@ class OnboardingRobot {
// TODO https://github.com/element-hq/element-android/issues/6652
} else {
clickOn(R.id.loginSplashSubmit)
assertDisplayed(R.id.useCaseHeaderTitle, R.string.ftue_auth_use_case_title)
assertDisplayed(R.id.useCaseHeaderTitle, CommonStrings.ftue_auth_use_case_title)
clickOn(R.id.useCaseOptionOne)
OnboardingServersRobot().crawlSignUp()
pressBack()
@@ -71,27 +72,27 @@ class OnboardingRobot {
initSession(true, userId, password, homeServerUrl)
}
waitUntilViewVisible(withText(R.string.ftue_account_created_congratulations_title))
waitUntilViewVisible(withText(CommonStrings.ftue_account_created_congratulations_title))
if (defaultVectorFeatures.isOnboardingPersonalizeEnabled()) {
clickOn(R.string.ftue_account_created_personalize)
clickOn(CommonStrings.ftue_account_created_personalize)
waitUntilViewVisible(withText(R.string.ftue_display_name_title))
waitUntilViewVisible(withText(CommonStrings.ftue_display_name_title))
writeTo(R.id.displayNameInput, "UI automation")
clickOn(R.string.ftue_personalize_submit)
clickOn(CommonStrings.ftue_personalize_submit)
waitUntilViewVisible(withText(R.string.ftue_profile_picture_title))
clickOn(R.string.ftue_personalize_skip_this_step)
waitUntilViewVisible(withText(CommonStrings.ftue_profile_picture_title))
clickOn(CommonStrings.ftue_personalize_skip_this_step)
waitUntilViewVisible(withText(R.string.ftue_personalize_complete_title))
clickOn(R.string.ftue_personalize_lets_go)
waitUntilViewVisible(withText(CommonStrings.ftue_personalize_complete_title))
clickOn(CommonStrings.ftue_personalize_lets_go)
} else {
clickOn(R.string.ftue_account_created_take_me_home)
clickOn(CommonStrings.ftue_account_created_take_me_home)
}
}
private fun createAccountViaCombinedRegister(homeServerUrl: String, userId: String, password: String) {
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
assertDisplayed(R.id.loginSplashSubmit, R.string.login_splash_create_account)
assertDisplayed(R.id.loginSplashSubmit, CommonStrings.login_splash_create_account)
clickOn(R.id.loginSplashSubmit)
clickOn(R.id.useCaseOptionOne)
@@ -117,7 +118,7 @@ class OnboardingRobot {
private fun loginViaCombinedLogin(homeServerUrl: String, userId: String, password: String) {
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
assertDisplayed(R.id.loginSplashSubmit, R.string.login_splash_create_account)
assertDisplayed(R.id.loginSplashSubmit, CommonStrings.login_splash_create_account)
clickOn(R.id.loginSplashAlreadyHaveAccount)
waitUntilViewVisible(withId(R.id.loginRoot))
@@ -139,14 +140,14 @@ class OnboardingRobot {
homeServerUrl: String
) {
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
assertDisplayed(R.id.loginSplashSubmit, R.string.login_splash_create_account)
assertDisplayed(R.id.loginSplashSubmit, CommonStrings.login_splash_create_account)
if (createAccount) {
clickOn(R.id.loginSplashSubmit)
clickOn(R.id.useCaseOptionOne)
} else {
clickOn(R.id.loginSplashAlreadyHaveAccount)
}
assertDisplayed(R.id.loginServerTitle, R.string.login_server_title)
assertDisplayed(R.id.loginServerTitle, CommonStrings.login_server_title)
// Chose custom server
clickOn(R.id.loginServerChoiceOther)
// Enter local synapse

View File

@@ -23,11 +23,12 @@ import com.adevinta.android.barista.interaction.BaristaClickInteractions
import com.adevinta.android.barista.interaction.BaristaEditTextInteractions
import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.lib.strings.CommonStrings
class OnboardingServersRobot {
fun crawlSignUp() {
BaristaVisibilityAssertions.assertDisplayed(R.id.loginServerTitle, R.string.login_server_title)
BaristaVisibilityAssertions.assertDisplayed(R.id.loginServerTitle, CommonStrings.login_server_title)
crawlMatrixServer(isSignUp = true)
crawlEmsServer()
crawlOtherServer(isSignUp = true)
@@ -35,7 +36,7 @@ class OnboardingServersRobot {
}
fun crawlSignIn() {
BaristaVisibilityAssertions.assertDisplayed(R.id.loginServerTitle, R.string.login_server_title)
BaristaVisibilityAssertions.assertDisplayed(R.id.loginServerTitle, CommonStrings.login_server_title)
crawlMatrixServer(isSignUp = false)
crawlEmsServer()
crawlOtherServer(isSignUp = false)
@@ -49,7 +50,7 @@ class OnboardingServersRobot {
BaristaClickInteractions.clickOn(R.id.loginServerUrlFormSubmit)
waitUntilViewVisible(ViewMatchers.withId(R.id.loginSignupSigninTitle))
BaristaVisibilityAssertions.assertDisplayed(R.id.loginSignupSigninText, "Connect to chat.mozilla.org")
BaristaVisibilityAssertions.assertDisplayed(R.id.loginSignupSigninSubmit, R.string.login_signin_sso)
BaristaVisibilityAssertions.assertDisplayed(R.id.loginSignupSigninSubmit, CommonStrings.login_signin_sso)
Espresso.pressBack()
BaristaEditTextInteractions.writeTo(R.id.loginServerUrlFormHomeServerUrl, "https://matrix.org")
@@ -62,14 +63,14 @@ class OnboardingServersRobot {
private fun crawlEmsServer() {
BaristaClickInteractions.clickOn(R.id.loginServerChoiceEms)
waitUntilViewVisible(ViewMatchers.withId(R.id.loginServerUrlFormTitle))
BaristaVisibilityAssertions.assertDisplayed(R.id.loginServerUrlFormTitle, R.string.login_connect_to_modular)
BaristaVisibilityAssertions.assertDisplayed(R.id.loginServerUrlFormTitle, CommonStrings.login_connect_to_modular)
BaristaEditTextInteractions.writeTo(R.id.loginServerUrlFormHomeServerUrl, "https://one.ems.host")
BaristaClickInteractions.clickOn(R.id.loginServerUrlFormSubmit)
waitUntilViewVisible(ViewMatchers.withId(R.id.loginSignupSigninTitle))
BaristaVisibilityAssertions.assertDisplayed(R.id.loginSignupSigninText, "one.ems.host")
BaristaVisibilityAssertions.assertDisplayed(R.id.loginSignupSigninSubmit, R.string.login_signin_sso)
BaristaVisibilityAssertions.assertDisplayed(R.id.loginSignupSigninSubmit, CommonStrings.login_signin_sso)
Espresso.pressBack()
Espresso.pressBack()
}
@@ -91,7 +92,7 @@ class OnboardingServersRobot {
private fun crawlSignInWithMatrixId() {
BaristaClickInteractions.clickOn(R.id.loginServerIKnowMyIdSubmit)
waitUntilViewVisible(ViewMatchers.withId(R.id.loginTitle))
BaristaVisibilityAssertions.assertDisplayed(R.id.loginTitle, R.string.login_signin_matrix_id_title)
BaristaVisibilityAssertions.assertDisplayed(R.id.loginTitle, CommonStrings.login_signin_matrix_id_title)
Espresso.pressBack()
}
}

View File

@@ -39,6 +39,7 @@ import im.vector.app.features.home.room.detail.timeline.reactions.ViewReactionsB
import im.vector.app.features.reactions.data.EmojiDataSource
import im.vector.app.interactWithSheet
import im.vector.app.withRetry
import im.vector.lib.strings.CommonStrings
import java.lang.Thread.sleep
class RoomDetailRobot {
@@ -93,7 +94,7 @@ class RoomDetailRobot {
// Open reactions
longClickReaction(quickReaction)
// wait for bottom sheet
interactWithSheet<ViewReactionsBottomSheet>(withText(R.string.reactions), openState = BottomSheetBehavior.STATE_COLLAPSED) {
interactWithSheet<ViewReactionsBottomSheet>(withText(CommonStrings.reactions), openState = BottomSheetBehavior.STATE_COLLAPSED) {
pressBack()
}
println("Room Detail Robot: Open reaction from emoji picker")

View File

@@ -36,6 +36,7 @@ import im.vector.app.features.home.room.list.home.header.HomeRoomFilter
import im.vector.app.features.roomdirectory.RoomDirectoryActivity
import im.vector.app.ui.robot.settings.labs.LabFeaturesPreferences
import im.vector.app.waitForView
import im.vector.lib.strings.CommonStrings
class RoomListRobot(private val labsPreferences: LabFeaturesPreferences) {
@@ -55,7 +56,7 @@ class RoomListRobot(private val labsPreferences: LabFeaturesPreferences) {
onView(withId(R.id.roomListView))
.perform(
RecyclerViewActions.actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.room_displayname_empty_room)),
hasDescendant(withText(CommonStrings.room_displayname_empty_room)),
ViewActions.longClick()
)
)

View File

@@ -29,6 +29,7 @@ import im.vector.app.espresso.tools.waitUntilActivityVisible
import im.vector.app.espresso.tools.waitUntilDialogVisible
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.roommemberprofile.RoomMemberProfileActivity
import im.vector.lib.strings.CommonStrings
class RoomSettingsRobot {
@@ -58,8 +59,8 @@ class RoomSettingsRobot {
// Uploads
clickListItem(R.id.matrixProfileRecyclerView, 10)
// File tab
clickOn(R.string.uploads_files_title)
waitUntilViewVisible(withText(R.string.uploads_media_title))
clickOn(CommonStrings.uploads_files_title)
waitUntilViewVisible(withText(CommonStrings.uploads_media_title))
pressBack()
waitUntilViewVisible(withId(R.id.matrixProfileRecyclerView))
@@ -74,19 +75,19 @@ class RoomSettingsRobot {
// Room addresses
clickListItem(R.id.matrixProfileRecyclerView, 16)
waitUntilViewVisible(withText(R.string.room_alias_published_alias_title))
waitUntilViewVisible(withText(CommonStrings.room_alias_published_alias_title))
pressBack()
// Room permissions
clickListItem(R.id.matrixProfileRecyclerView, 18)
waitUntilViewVisible(withText(R.string.room_permissions_change_room_avatar))
clickOn(R.string.room_permissions_change_room_avatar)
waitUntilViewVisible(withText(CommonStrings.room_permissions_change_room_avatar))
clickOn(CommonStrings.room_permissions_change_room_avatar)
waitUntilDialogVisible(withId(android.R.id.button2))
clickDialogNegativeButton()
waitUntilViewVisible(withText(R.string.room_permissions_title))
waitUntilViewVisible(withText(CommonStrings.room_permissions_title))
// Toggle
clickOn(R.string.show_advanced)
clickOn(R.string.hide_advanced)
clickOn(CommonStrings.show_advanced)
clickOn(CommonStrings.hide_advanced)
pressBack()
// Menu share

View File

@@ -19,31 +19,31 @@ package im.vector.app.ui.robot.settings
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import im.vector.app.R
import im.vector.app.espresso.tools.clickOnPreference
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.lib.strings.CommonStrings
class SettingsAdvancedRobot {
fun crawl() {
clickOnPreference(R.string.settings_notifications_targets)
clickOnPreference(CommonStrings.settings_notifications_targets)
pressBack()
clickOnPreference(R.string.settings_push_rules)
clickOnPreference(CommonStrings.settings_push_rules)
pressBack()
}
fun toggleDeveloperMode() {
clickOn(R.string.settings_developer_mode_summary)
clickOn(CommonStrings.settings_developer_mode_summary)
}
fun crawlDeveloperOptions() {
clickOnPreference(R.string.settings_account_data)
clickOnPreference(CommonStrings.settings_account_data)
waitUntilViewVisible(withText("m.push_rules"))
clickOn("m.push_rules")
pressBack()
pressBack()
clickOnPreference(R.string.settings_key_requests)
clickOnPreference(CommonStrings.settings_key_requests)
pressBack()
}
}

View File

@@ -20,32 +20,32 @@ import androidx.test.espresso.Espresso.pressBack
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogNegativeButton
import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogPositiveButton
import im.vector.app.R
import im.vector.app.espresso.tools.clickOnPreference
import im.vector.lib.strings.CommonStrings
class SettingsGeneralRobot {
fun crawl() {
clickOn(R.string.settings_profile_picture)
clickOn(CommonStrings.settings_profile_picture)
clickDialogPositiveButton()
clickOn(R.string.settings_display_name)
clickOn(CommonStrings.settings_display_name)
clickDialogNegativeButton()
clickOn(R.string.settings_password)
clickOn(CommonStrings.settings_password)
clickDialogNegativeButton()
clickOn(R.string.settings_emails_and_phone_numbers_title)
clickOn(CommonStrings.settings_emails_and_phone_numbers_title)
pressBack()
clickOn(R.string.settings_discovery_manage)
clickOn(R.string.add_identity_server)
clickOn(CommonStrings.settings_discovery_manage)
clickOn(CommonStrings.add_identity_server)
pressBack()
pressBack()
// Homeserver
clickOnPreference(R.string.settings_home_server)
clickOnPreference(CommonStrings.settings_home_server)
pressBack()
// Identity server
clickOnPreference(R.string.settings_identity_server)
clickOnPreference(CommonStrings.settings_identity_server)
pressBack()
// Deactivate account
clickOnPreference(R.string.settings_deactivate_my_account)
clickOnPreference(CommonStrings.settings_deactivate_my_account)
pressBack()
}
}

View File

@@ -20,14 +20,14 @@ class SettingsHelpRobot {
fun crawl() {
/*
clickOn(R.string.settings_app_info_link_title)
clickOn(CommonStrings.settings_app_info_link_title)
Cannot go back...
pressBack()
clickOn(R.string.settings_copyright)
clickOn(CommonStrings.settings_copyright)
pressBack()
clickOn(R.string.settings_app_term_conditions)
clickOn(CommonStrings.settings_app_term_conditions)
pressBack()
clickOn(R.string.settings_privacy_policy)
clickOn(CommonStrings.settings_privacy_policy)
pressBack()
*/
}

View File

@@ -18,12 +18,12 @@ package im.vector.app.ui.robot.settings
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogPositiveButton
import im.vector.app.R
import im.vector.lib.strings.CommonStrings
class SettingsLegalsRobot {
fun crawl() {
clickOn(R.string.settings_third_party_notices)
clickOn(CommonStrings.settings_third_party_notices)
clickDialogPositiveButton()
}
}

View File

@@ -19,39 +19,39 @@ package im.vector.app.ui.robot.settings
import androidx.test.espresso.Espresso.pressBack
import com.adevinta.android.barista.assertion.BaristaVisibilityAssertions.assertDisplayed
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import im.vector.app.R
import im.vector.app.espresso.tools.clickOnPreference
import im.vector.lib.strings.CommonStrings
class SettingsNotificationsRobot {
fun crawl() {
clickOn(R.string.settings_notification_default)
clickOn(CommonStrings.settings_notification_default)
pressBack()
clickOn(R.string.settings_notification_mentions_and_keywords)
clickOn(CommonStrings.settings_notification_mentions_and_keywords)
// TODO Test adding a keyword?
pressBack()
clickOn(R.string.settings_notification_other)
clickOn(CommonStrings.settings_notification_other)
pressBack()
/*
clickOn(R.string.settings_noisy_notifications_preferences)
clickOn(CommonStrings.settings_noisy_notifications_preferences)
TODO Cannot go back
pressBack()
clickOn(R.string.settings_silent_notifications_preferences)
clickOn(CommonStrings.settings_silent_notifications_preferences)
pressBack()
clickOn(R.string.settings_call_notifications_preferences)
clickOn(CommonStrings.settings_call_notifications_preferences)
pressBack()
*/
// Email notification. No Emails are configured so we show go to the screen to add email
clickOnPreference(R.string.settings_notification_emails_no_emails)
assertDisplayed(R.string.settings_emails_and_phone_numbers_title)
clickOnPreference(CommonStrings.settings_notification_emails_no_emails)
assertDisplayed(CommonStrings.settings_emails_and_phone_numbers_title)
pressBack()
// Display the notification method change dialog
clickOnPreference(R.string.settings_notification_method)
clickOnPreference(CommonStrings.settings_notification_method)
pressBack()
clickOnPreference(R.string.settings_notification_troubleshoot)
clickOnPreference(CommonStrings.settings_notification_troubleshoot)
// Give time for the tests to perform
Thread.sleep(12_000)
pressBack()

View File

@@ -23,16 +23,17 @@ import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogNegativeButton
import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.lib.strings.CommonStrings
class SettingsPreferencesRobot {
fun crawl() {
clickOn(R.string.settings_interface_language)
clickOn(CommonStrings.settings_interface_language)
waitUntilViewVisible(withText("Dansk (Danmark)"))
pressBack()
clickOn(R.string.settings_theme)
clickOn(CommonStrings.settings_theme)
clickDialogNegativeButton()
clickOn(R.string.font_size)
clickOn(CommonStrings.font_size)
waitUntilViewVisible(withId(R.id.fons_scale_recycler))
pressBack()
}

View File

@@ -17,8 +17,8 @@
package im.vector.app.ui.robot.settings
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import im.vector.app.R
import im.vector.app.clickOnAndGoBack
import im.vector.lib.strings.CommonStrings
class SettingsRobot {
@@ -29,45 +29,45 @@ class SettingsRobot {
}
fun general(block: SettingsGeneralRobot.() -> Unit) {
clickOnAndGoBack(R.string.settings_general_title) { block(SettingsGeneralRobot()) }
clickOnAndGoBack(CommonStrings.settings_general_title) { block(SettingsGeneralRobot()) }
}
fun notifications(block: SettingsNotificationsRobot.() -> Unit) {
clickOnAndGoBack(R.string.settings_notifications) { block(SettingsNotificationsRobot()) }
clickOnAndGoBack(CommonStrings.settings_notifications) { block(SettingsNotificationsRobot()) }
}
fun preferences(block: SettingsPreferencesRobot.() -> Unit) {
clickOnAndGoBack(R.string.settings_preferences) { block(SettingsPreferencesRobot()) }
clickOnAndGoBack(CommonStrings.settings_preferences) { block(SettingsPreferencesRobot()) }
}
fun voiceAndVideo(block: () -> Unit = {}) {
clickOnAndGoBack(R.string.preference_voice_and_video) { block() }
clickOnAndGoBack(CommonStrings.preference_voice_and_video) { block() }
}
fun securityAndPrivacy(block: SettingsSecurityRobot.() -> Unit) {
clickOnAndGoBack(R.string.settings_security_and_privacy) { block(SettingsSecurityRobot()) }
clickOnAndGoBack(CommonStrings.settings_security_and_privacy) { block(SettingsSecurityRobot()) }
}
fun labs(shouldGoBack: Boolean = true, block: () -> Unit = {}) {
if (shouldGoBack) {
clickOnAndGoBack(R.string.room_settings_labs_pref_title) { block() }
clickOnAndGoBack(CommonStrings.room_settings_labs_pref_title) { block() }
} else {
clickOn(R.string.room_settings_labs_pref_title)
clickOn(CommonStrings.room_settings_labs_pref_title)
block()
}
}
fun advancedSettings(block: SettingsAdvancedRobot.() -> Unit) {
clickOnAndGoBack(R.string.settings_advanced_settings) {
clickOnAndGoBack(CommonStrings.settings_advanced_settings) {
block(SettingsAdvancedRobot())
}
}
fun helpAndAbout(block: SettingsHelpRobot.() -> Unit) {
clickOnAndGoBack(R.string.preference_root_help_about) { block(SettingsHelpRobot()) }
clickOnAndGoBack(CommonStrings.preference_root_help_about) { block(SettingsHelpRobot()) }
}
fun legals(block: SettingsLegalsRobot.() -> Unit) {
clickOnAndGoBack(R.string.preference_root_legals) { block(SettingsLegalsRobot()) }
clickOnAndGoBack(CommonStrings.preference_root_legals) { block(SettingsLegalsRobot()) }
}
}

View File

@@ -17,27 +17,27 @@
package im.vector.app.ui.robot.settings
import androidx.test.espresso.Espresso
import im.vector.app.R
import im.vector.app.espresso.tools.clickOnPreference
import im.vector.lib.strings.CommonStrings
class SettingsSecurityRobot {
fun crawl() {
clickOnPreference(R.string.settings_active_sessions_show_all)
clickOnPreference(CommonStrings.settings_active_sessions_show_all)
Espresso.pressBack()
clickOnPreference(R.string.encryption_message_recovery)
clickOnPreference(CommonStrings.encryption_message_recovery)
// TODO go deeper here
Espresso.pressBack()
/* Cannot exit
clickOnPreference(R.string.encryption_export_e2e_room_keys)
clickOnPreference(CommonStrings.encryption_export_e2e_room_keys)
pressBack()
*/
clickOnPreference(R.string.settings_opt_in_of_analytics)
clickOnPreference(CommonStrings.settings_opt_in_of_analytics)
Espresso.pressBack()
clickOnPreference(R.string.settings_ignored_users)
clickOnPreference(CommonStrings.settings_ignored_users)
Espresso.pressBack()
}
}

View File

@@ -32,6 +32,7 @@ import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.home.HomeActivity
import im.vector.app.features.home.room.detail.RoomDetailActivity
import im.vector.app.features.spaces.manage.SpaceManageActivity
import im.vector.lib.strings.CommonStrings
class SpaceCreateRobot {
@@ -39,7 +40,7 @@ class SpaceCreateRobot {
// public
clickOn(R.id.publicButton)
waitUntilViewVisible(withId(R.id.recyclerView))
onView(ViewMatchers.withHint(R.string.create_room_name_hint)).perform(ViewActions.replaceText(name))
onView(ViewMatchers.withHint(CommonStrings.create_room_name_hint)).perform(ViewActions.replaceText(name))
clickOn(R.id.nextButton)
waitUntilViewVisible(withId(R.id.recyclerView))
pressBack()
@@ -68,7 +69,7 @@ class SpaceCreateRobot {
onView(withId(R.id.roomList))
.perform(
RecyclerViewActions.actionOnItem<RecyclerView.ViewHolder>(
ViewMatchers.hasDescendant(withText(R.string.room_displayname_empty_room)),
ViewMatchers.hasDescendant(withText(CommonStrings.room_displayname_empty_room)),
click()
).atPosition(0)
)
@@ -81,7 +82,7 @@ class SpaceCreateRobot {
fun createPublicSpace(spaceName: String) {
clickOn(R.id.publicButton)
waitUntilViewVisible(withId(R.id.recyclerView))
onView(ViewMatchers.withHint(R.string.create_room_name_hint)).perform(ViewActions.replaceText(spaceName))
onView(ViewMatchers.withHint(CommonStrings.create_room_name_hint)).perform(ViewActions.replaceText(spaceName))
clickOn(R.id.nextButton)
waitUntilViewVisible(withId(R.id.recyclerView))
clickOn(R.id.nextButton)

View File

@@ -31,6 +31,7 @@ import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.VectorFeatures
import im.vector.app.ui.robot.settings.labs.LabFeaturesPreferences
import im.vector.lib.strings.CommonStrings
import org.hamcrest.Matchers
class SpaceRobot(private val labsPreferences: LabFeaturesPreferences) {
@@ -54,7 +55,7 @@ class SpaceRobot(private val labsPreferences: LabFeaturesPreferences) {
}
} else {
openDrawer()
clickOn(R.string.create_space)
clickOn(CommonStrings.create_space)
}
block(SpaceCreateRobot())
}

View File

@@ -25,13 +25,14 @@ import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilActivityVisible
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.roomprofile.settings.joinrule.RoomJoinRuleActivity
import im.vector.lib.strings.CommonStrings
class SpaceSettingsRobot {
fun crawl() {
Espresso.onView(ViewMatchers.withId(R.id.roomSettingsRecyclerView))
.perform(
RecyclerViewActions.actionOnItem<RecyclerView.ViewHolder>(
ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.room_settings_space_access_title)),
ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.room_settings_space_access_title)),
ViewActions.click()
)
)
@@ -45,7 +46,7 @@ class SpaceSettingsRobot {
Espresso.onView(ViewMatchers.withId(R.id.roomSettingsRecyclerView))
.perform(
RecyclerViewActions.actionOnItem<RecyclerView.ViewHolder>(
ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.space_settings_manage_rooms)),
ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.space_settings_manage_rooms)),
ViewActions.click()
)
)
@@ -56,7 +57,7 @@ class SpaceSettingsRobot {
Espresso.onView(ViewMatchers.withId(R.id.roomSettingsRecyclerView))
.perform(
RecyclerViewActions.actionOnItem<RecyclerView.ViewHolder>(
ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.space_settings_permissions_title)),
ViewMatchers.hasDescendant(ViewMatchers.withText(CommonStrings.space_settings_permissions_title)),
ViewActions.click()
)
)

View File

@@ -31,6 +31,7 @@ import im.vector.app.core.utils.onPermissionDeniedSnackbar
import im.vector.app.core.utils.registerForPermissionsResult
import im.vector.application.R
import im.vector.application.databinding.ActivityDebugPermissionBinding
import im.vector.lib.strings.CommonStrings
import timber.log.Timber
@AndroidEntryPoint
@@ -111,9 +112,9 @@ class DebugPermissionActivity : VectorBaseActivity<ActivityDebugPermissionBindin
if (deniedPermanently) {
dialogOrSnackbar = !dialogOrSnackbar
if (dialogOrSnackbar) {
onPermissionDeniedDialog(R.string.denied_permission_generic)
onPermissionDeniedDialog(CommonStrings.denied_permission_generic)
} else {
onPermissionDeniedSnackbar(R.string.denied_permission_generic)
onPermissionDeniedSnackbar(CommonStrings.denied_permission_generic)
}
} else {
Toast.makeText(this, "Denied", Toast.LENGTH_SHORT).show()

View File

@@ -11,6 +11,9 @@
-->
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<!-- For GuardAndroidService -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<application>
<receiver
@@ -30,6 +33,7 @@
<service
android:name="im.vector.app.fdroid.service.GuardAndroidService"
android:exported="false"
android:foregroundServiceType="dataSync"
tools:ignore="Instantiatable" />
</application>

View File

@@ -15,10 +15,10 @@
*/
package im.vector.app.fdroid.features.settings.troubleshoot
import im.vector.app.R
import im.vector.app.core.resources.StringProvider
import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.lib.strings.CommonStrings
import javax.inject.Inject
/**
@@ -28,16 +28,16 @@ class TestAutoStartBoot @Inject constructor(
private val vectorPreferences: VectorPreferences,
private val stringProvider: StringProvider
) :
TroubleshootTest(R.string.settings_troubleshoot_test_service_boot_title) {
TroubleshootTest(CommonStrings.settings_troubleshoot_test_service_boot_title) {
override fun perform(testParameters: TestParameters) {
if (vectorPreferences.autoStartOnBoot()) {
description = stringProvider.getString(R.string.settings_troubleshoot_test_service_boot_success)
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_service_boot_success)
status = TestStatus.SUCCESS
quickFix = null
} else {
description = stringProvider.getString(R.string.settings_troubleshoot_test_service_boot_failed)
quickFix = object : TroubleshootQuickFix(R.string.settings_troubleshoot_test_service_boot_quickfix) {
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_service_boot_failed)
quickFix = object : TroubleshootQuickFix(CommonStrings.settings_troubleshoot_test_service_boot_quickfix) {
override fun doFix() {
vectorPreferences.setAutoStartOnBoot(true)
manager?.retry(testParameters)

View File

@@ -19,16 +19,16 @@ import android.net.ConnectivityManager
import androidx.core.content.getSystemService
import androidx.core.net.ConnectivityManagerCompat
import androidx.fragment.app.FragmentActivity
import im.vector.app.R
import im.vector.app.core.resources.StringProvider
import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.lib.strings.CommonStrings
import javax.inject.Inject
class TestBackgroundRestrictions @Inject constructor(
private val context: FragmentActivity,
private val stringProvider: StringProvider
) :
TroubleshootTest(R.string.settings_troubleshoot_test_bg_restricted_title) {
TroubleshootTest(CommonStrings.settings_troubleshoot_test_bg_restricted_title) {
override fun perform(testParameters: TestParameters) {
context.getSystemService<ConnectivityManager>()!!.apply {
@@ -40,7 +40,7 @@ class TestBackgroundRestrictions @Inject constructor(
// Background data usage is blocked for this app. Wherever possible,
// the app should also use less data in the foreground.
description = stringProvider.getString(
R.string.settings_troubleshoot_test_bg_restricted_failed,
CommonStrings.settings_troubleshoot_test_bg_restricted_failed,
"RESTRICT_BACKGROUND_STATUS_ENABLED"
)
status = TestStatus.FAILED
@@ -50,7 +50,7 @@ class TestBackgroundRestrictions @Inject constructor(
// The app is whitelisted. Wherever possible,
// the app should use less data in the foreground and background.
description = stringProvider.getString(
R.string.settings_troubleshoot_test_bg_restricted_success,
CommonStrings.settings_troubleshoot_test_bg_restricted_success,
"RESTRICT_BACKGROUND_STATUS_WHITELISTED"
)
status = TestStatus.SUCCESS
@@ -60,7 +60,7 @@ class TestBackgroundRestrictions @Inject constructor(
// Data Saver is disabled. Since the device is connected to a
// metered network, the app should use less data wherever possible.
description = stringProvider.getString(
R.string.settings_troubleshoot_test_bg_restricted_success,
CommonStrings.settings_troubleshoot_test_bg_restricted_success,
"RESTRICT_BACKGROUND_STATUS_DISABLED"
)
status = TestStatus.SUCCESS
@@ -70,7 +70,7 @@ class TestBackgroundRestrictions @Inject constructor(
} else {
// The device is not on a metered network.
// Use data as required to perform syncs, downloads, and updates.
description = stringProvider.getString(R.string.settings_troubleshoot_test_bg_restricted_success, "")
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_bg_restricted_success, "")
status = TestStatus.SUCCESS
quickFix = null
}

View File

@@ -16,26 +16,26 @@
package im.vector.app.fdroid.features.settings.troubleshoot
import androidx.fragment.app.FragmentActivity
import im.vector.app.R
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.utils.isIgnoringBatteryOptimizations
import im.vector.app.core.utils.requestDisablingBatteryOptimization
import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.lib.strings.CommonStrings
import javax.inject.Inject
class TestBatteryOptimization @Inject constructor(
private val context: FragmentActivity,
private val stringProvider: StringProvider
) : TroubleshootTest(R.string.settings_troubleshoot_test_battery_title) {
) : TroubleshootTest(CommonStrings.settings_troubleshoot_test_battery_title) {
override fun perform(testParameters: TestParameters) {
if (context.isIgnoringBatteryOptimizations()) {
description = stringProvider.getString(R.string.settings_troubleshoot_test_battery_success)
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_battery_success)
status = TestStatus.SUCCESS
quickFix = null
} else {
description = stringProvider.getString(R.string.settings_troubleshoot_test_battery_failed)
quickFix = object : TroubleshootQuickFix(R.string.settings_troubleshoot_test_battery_quickfix) {
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_battery_failed)
quickFix = object : TroubleshootQuickFix(CommonStrings.settings_troubleshoot_test_battery_quickfix) {
override fun doFix() {
requestDisablingBatteryOptimization(context, testParameters.activityResultLauncher)
}

View File

@@ -17,9 +17,9 @@ package im.vector.app.fdroid.service
import android.content.Intent
import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.services.VectorAndroidService
import im.vector.app.features.notifications.NotificationUtils
import im.vector.lib.strings.CommonStrings
import javax.inject.Inject
/**
@@ -34,7 +34,7 @@ class GuardAndroidService : VectorAndroidService() {
@Inject lateinit var notificationUtils: NotificationUtils
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val notificationSubtitleRes = R.string.notification_listening_for_notifications
val notificationSubtitleRes = CommonStrings.notification_listening_for_notifications
val notification = notificationUtils.buildForegroundServiceNotification(notificationSubtitleRes, false)
startForeground(NotificationUtils.NOTIFICATION_ID_FOREGROUND_SERVICE, notification)
return START_STICKY

View File

@@ -17,11 +17,11 @@ package im.vector.app.gplay.features.settings.troubleshoot
import androidx.fragment.app.FragmentActivity
import com.google.firebase.messaging.FirebaseMessaging
import im.vector.app.R
import im.vector.app.core.pushers.FcmHelper
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.utils.startAddGoogleAccountIntent
import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.lib.strings.CommonStrings
import timber.log.Timber
import javax.inject.Inject
@@ -32,7 +32,7 @@ class TestFirebaseToken @Inject constructor(
private val context: FragmentActivity,
private val stringProvider: StringProvider,
private val fcmHelper: FcmHelper,
) : TroubleshootTest(R.string.settings_troubleshoot_test_fcm_title) {
) : TroubleshootTest(CommonStrings.settings_troubleshoot_test_fcm_title) {
override fun perform(testParameters: TestParameters) {
status = TestStatus.RUNNING
@@ -43,28 +43,28 @@ class TestFirebaseToken @Inject constructor(
// Can't find where this constant is (not documented -or deprecated in docs- and all obfuscated)
description = when (val errorMsg = task.exception?.localizedMessage ?: "Unknown") {
"SERVICE_NOT_AVAILABLE" -> {
stringProvider.getString(R.string.settings_troubleshoot_test_fcm_failed_service_not_available, errorMsg)
stringProvider.getString(CommonStrings.settings_troubleshoot_test_fcm_failed_service_not_available, errorMsg)
}
"TOO_MANY_REGISTRATIONS" -> {
stringProvider.getString(R.string.settings_troubleshoot_test_fcm_failed_too_many_registration, errorMsg)
stringProvider.getString(CommonStrings.settings_troubleshoot_test_fcm_failed_too_many_registration, errorMsg)
}
"ACCOUNT_MISSING" -> {
quickFix = object : TroubleshootQuickFix(R.string.settings_troubleshoot_test_fcm_failed_account_missing_quick_fix) {
quickFix = object : TroubleshootQuickFix(CommonStrings.settings_troubleshoot_test_fcm_failed_account_missing_quick_fix) {
override fun doFix() {
startAddGoogleAccountIntent(context, testParameters.activityResultLauncher)
}
}
stringProvider.getString(R.string.settings_troubleshoot_test_fcm_failed_account_missing, errorMsg)
stringProvider.getString(CommonStrings.settings_troubleshoot_test_fcm_failed_account_missing, errorMsg)
}
else -> {
stringProvider.getString(R.string.settings_troubleshoot_test_fcm_failed, errorMsg)
stringProvider.getString(CommonStrings.settings_troubleshoot_test_fcm_failed, errorMsg)
}
}
status = TestStatus.FAILED
} else {
task.result?.let { token ->
val tok = token.take(8) + "********************"
description = stringProvider.getString(R.string.settings_troubleshoot_test_fcm_success, tok)
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_fcm_success, tok)
Timber.e("Retrieved FCM token success [$tok].")
// Ensure it is well store in our local storage
fcmHelper.storeFcmToken(token)
@@ -73,7 +73,7 @@ class TestFirebaseToken @Inject constructor(
}
}
} catch (e: Throwable) {
description = stringProvider.getString(R.string.settings_troubleshoot_test_fcm_failed, e.localizedMessage)
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_fcm_failed, e.localizedMessage)
status = TestStatus.FAILED
}
}

View File

@@ -18,9 +18,9 @@ package im.vector.app.gplay.features.settings.troubleshoot
import androidx.fragment.app.FragmentActivity
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability
import im.vector.app.R
import im.vector.app.core.resources.StringProvider
import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.lib.strings.CommonStrings
import timber.log.Timber
import javax.inject.Inject
@@ -31,18 +31,18 @@ class TestPlayServices @Inject constructor(
private val context: FragmentActivity,
private val stringProvider: StringProvider
) :
TroubleshootTest(R.string.settings_troubleshoot_test_play_services_title) {
TroubleshootTest(CommonStrings.settings_troubleshoot_test_play_services_title) {
override fun perform(testParameters: TestParameters) {
val apiAvailability = GoogleApiAvailability.getInstance()
val resultCode = apiAvailability.isGooglePlayServicesAvailable(context)
if (resultCode == ConnectionResult.SUCCESS) {
quickFix = null
description = stringProvider.getString(R.string.settings_troubleshoot_test_play_services_success)
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_play_services_success)
status = TestStatus.SUCCESS
} else {
if (apiAvailability.isUserResolvableError(resultCode)) {
quickFix = object : TroubleshootQuickFix(R.string.settings_troubleshoot_test_play_services_quickfix) {
quickFix = object : TroubleshootQuickFix(CommonStrings.settings_troubleshoot_test_play_services_quickfix) {
override fun doFix() {
apiAvailability.getErrorDialog(context, resultCode, 9000 /*hey does the magic number*/)?.show()
}
@@ -50,7 +50,7 @@ class TestPlayServices @Inject constructor(
Timber.e("Play Services apk error $resultCode -> ${apiAvailability.getErrorString(resultCode)}.")
}
description = stringProvider.getString(R.string.settings_troubleshoot_test_play_services_failed, apiAvailability.getErrorString(resultCode))
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_play_services_failed, apiAvailability.getErrorString(resultCode))
status = TestStatus.FAILED
}
}

View File

@@ -20,12 +20,12 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.lifecycleScope
import androidx.work.WorkInfo
import androidx.work.WorkManager
import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.pushers.FcmHelper
import im.vector.app.core.pushers.PushersManager
import im.vector.app.core.resources.StringProvider
import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.lib.strings.CommonStrings
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.session.pushers.PusherState
@@ -41,7 +41,7 @@ class TestTokenRegistration @Inject constructor(
private val activeSessionHolder: ActiveSessionHolder,
private val fcmHelper: FcmHelper,
) :
TroubleshootTest(R.string.settings_troubleshoot_test_token_registration_title) {
TroubleshootTest(CommonStrings.settings_troubleshoot_test_token_registration_title) {
override fun perform(testParameters: TestParameters) {
// Check if we have a registered pusher for this token
@@ -58,10 +58,10 @@ class TestTokenRegistration @Inject constructor(
}
if (pushers.isEmpty()) {
description = stringProvider.getString(
R.string.settings_troubleshoot_test_token_registration_failed,
stringProvider.getString(R.string.sas_error_unknown)
CommonStrings.settings_troubleshoot_test_token_registration_failed,
stringProvider.getString(CommonStrings.sas_error_unknown)
)
quickFix = object : TroubleshootQuickFix(R.string.settings_troubleshoot_test_token_registration_quick_fix) {
quickFix = object : TroubleshootQuickFix(CommonStrings.settings_troubleshoot_test_token_registration_quick_fix) {
override fun doFix() {
context.lifecycleScope.launch(Dispatchers.IO) {
val workId = pushersManager.enqueueRegisterPusherWithFcmKey(fcmToken)
@@ -80,7 +80,7 @@ class TestTokenRegistration @Inject constructor(
status = TestStatus.FAILED
} else {
description = stringProvider.getString(R.string.settings_troubleshoot_test_token_registration_success)
description = stringProvider.getString(CommonStrings.settings_troubleshoot_test_token_registration_success)
status = TestStatus.SUCCESS
}
}

View File

@@ -23,12 +23,12 @@ import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability
import com.google.firebase.messaging.FirebaseMessaging
import dagger.hilt.android.qualifiers.ApplicationContext
import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.DefaultPreferences
import im.vector.app.core.dispatchers.CoroutineDispatchers
import im.vector.app.core.pushers.FcmHelper
import im.vector.app.core.pushers.PushersManager
import im.vector.lib.strings.CommonStrings
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import timber.log.Timber
@@ -84,7 +84,7 @@ class GoogleFcmHelper @Inject constructor(
Timber.e(e, "## ensureFcmTokenIsRetrieved() : failed")
}
} else {
Toast.makeText(context, R.string.no_valid_google_play_services_apk, Toast.LENGTH_SHORT).show()
Toast.makeText(context, CommonStrings.no_valid_google_play_services_apk, Toast.LENGTH_SHORT).show()
Timber.e("No valid Google Play Services found. Cannot use FCM.")
}
}

View File

@@ -19,7 +19,6 @@ package im.vector.app.push.fcm
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.pushers.FcmHelper
import im.vector.app.core.pushers.PushParser
@@ -70,7 +69,7 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
pushKey = token,
gateway = mdmService.getData(
mdmData = MdmData.DefaultPushGatewayUrl,
defaultValue = getString(R.string.pusher_http_url),
defaultValue = getString(im.vector.app.config.R.string.pusher_http_url),
),
)
}

View File

@@ -64,6 +64,7 @@ import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.ui.SharedPreferencesUiStateRepository
import im.vector.app.features.ui.UiStateRepository
import im.vector.application.BuildConfig
import im.vector.application.R
import im.vector.lib.core.utils.timer.Clock
import im.vector.lib.core.utils.timer.DefaultClock
import kotlinx.coroutines.CoroutineScope
@@ -225,9 +226,10 @@ import javax.inject.Singleton
@Provides
@Singleton
fun providesBuildMeta() = BuildMeta(
fun providesBuildMeta(context: Context) = BuildMeta(
isDebug = BuildConfig.DEBUG,
applicationId = BuildConfig.APPLICATION_ID,
applicationName = context.getString(R.string.app_name),
lowPrivacyLoggingEnabled = Config.LOW_PRIVACY_LOG_ENABLE,
versionName = BuildConfig.VERSION_NAME,
gitRevision = BuildConfig.GIT_REVISION,