mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Merge pull request #6340 from vector-im/feature/bma/test_flipper
Add link to the Matrix room.
This commit is contained in:
commit
3dcec85dea
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -60,7 +60,7 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Assemble GPlay unsigned apk
|
||||
run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES --stacktrace
|
||||
run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES --stacktrace
|
||||
- name: Upload Gplay unsigned APKs
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
@ -88,6 +88,6 @@ jobs:
|
||||
with:
|
||||
name: exodus.json
|
||||
path: |
|
||||
exodus.json
|
||||
exodus.json
|
||||
- name: Check for trackers
|
||||
run: "jq -e '.trackers == []' exodus.json > /dev/null || { echo '::error static analysis identified user tracking library' ; exit 1; }"
|
||||
|
4
.github/workflows/quality.yml
vendored
4
.github/workflows/quality.yml
vendored
@ -113,13 +113,13 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Dependency analysis
|
||||
run: ./gradlew buildHealth $CI_GRADLE_ARG_PROPERTIES
|
||||
run: ./gradlew dependencyCheckAnalyze $CI_GRADLE_ARG_PROPERTIES
|
||||
- name: Upload dependency analysis
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dependency-analysis
|
||||
path: build/reports/dependency-analysis/build-health-report.txt
|
||||
path: build/reports/dependency-check-report.html
|
||||
|
||||
# Lint for main module
|
||||
android-lint:
|
||||
|
@ -53,5 +53,6 @@ https://fbflipper.com/docs/getting-started/troubleshooting/android/ may help.
|
||||
|
||||
## Links
|
||||
|
||||
- https://fbflipper.com
|
||||
- Official Flipper website: https://fbflipper.com
|
||||
- Realm Plugin for Flipper: https://github.com/kamgurgul/Flipper-Realm
|
||||
- Dedicated Matrix room: https://matrix.to/#/#unifiedpush:matrix.org
|
||||
|
@ -14,4 +14,11 @@
|
||||
<packageUrl regex="true">^pkg:maven/com\.pinterest\.ktlint/ktlint\-reporter\-checkstyle@.*$</packageUrl>
|
||||
<cve>CVE-2019-9658</cve>
|
||||
</suppress>
|
||||
<suppress until="2023-01-01Z">
|
||||
<notes><![CDATA[
|
||||
file name: sarif4k-0.0.1.jar
|
||||
]]></notes>
|
||||
<packageUrl regex="true">^pkg:maven/io\.github\.detekt\.sarif4k/sarif4k@.*$</packageUrl>
|
||||
<cpe>cpe:/a:detekt:detekt</cpe>
|
||||
</suppress>
|
||||
</suppressions>
|
||||
|
@ -19,17 +19,18 @@ package im.vector.app.core.utils
|
||||
import org.amshove.kluent.shouldBe
|
||||
import org.junit.Test
|
||||
import java.lang.Thread.sleep
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
class TemporaryStoreTest {
|
||||
|
||||
@Test
|
||||
fun testTemporaryStore() {
|
||||
// Keep the data 300 millis
|
||||
val store = TemporaryStore<String>(300)
|
||||
val store = TemporaryStore<String>(300.milliseconds)
|
||||
|
||||
store.data = "test"
|
||||
store.data shouldBe "test"
|
||||
sleep(10)
|
||||
sleep(100)
|
||||
store.data shouldBe "test"
|
||||
sleep(300)
|
||||
store.data shouldBe null
|
||||
|
@ -18,15 +18,14 @@ package im.vector.app.core.utils
|
||||
|
||||
import java.util.Timer
|
||||
import java.util.TimerTask
|
||||
|
||||
const val THREE_MINUTES = 3 * 60_000L
|
||||
import kotlin.time.Duration
|
||||
|
||||
/**
|
||||
* Store an object T for a specific period of time.
|
||||
* @param T type of the data to store
|
||||
* @property delay delay to keep the data, in millis
|
||||
* @property delay delay to keep the data
|
||||
*/
|
||||
open class TemporaryStore<T>(private val delay: Long = THREE_MINUTES) {
|
||||
open class TemporaryStore<T>(private val delay: Duration) {
|
||||
|
||||
private var timer: Timer? = null
|
||||
|
||||
@ -40,7 +39,7 @@ open class TemporaryStore<T>(private val delay: Long = THREE_MINUTES) {
|
||||
override fun run() {
|
||||
field = null
|
||||
}
|
||||
}, delay)
|
||||
}, delay.inWholeMilliseconds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,8 @@ package im.vector.app.features.home.room.detail
|
||||
import im.vector.app.core.utils.TemporaryStore
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
// Store to keep a pending action from sub screen of a room detail
|
||||
@Singleton
|
||||
class RoomDetailPendingActionStore @Inject constructor() : TemporaryStore<RoomDetailPendingAction>(10_000)
|
||||
class RoomDetailPendingActionStore @Inject constructor() : TemporaryStore<RoomDetailPendingAction>(10.seconds)
|
||||
|
@ -19,9 +19,10 @@ package im.vector.app.features.login
|
||||
import im.vector.app.core.utils.TemporaryStore
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlin.time.Duration.Companion.minutes
|
||||
|
||||
/**
|
||||
* Will store the account password for 3 minutes.
|
||||
*/
|
||||
@Singleton
|
||||
class ReAuthHelper @Inject constructor() : TemporaryStore<String>()
|
||||
class ReAuthHelper @Inject constructor() : TemporaryStore<String>(3.minutes)
|
||||
|
Loading…
Reference in New Issue
Block a user