mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
No need to use @SuppressLint("NewApi")
when @ChecksSdkIntAtLeast
is used.
This commit is contained in:
parent
5886245bbf
commit
658a09ea6a
2 changed files with 4 additions and 2 deletions
|
@ -34,4 +34,7 @@ interface BuildVersionSdkIntProvider {
|
|||
result()
|
||||
} else null
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(parameter = 0)
|
||||
fun isAtLeast(version: Int) = get() >= version
|
||||
}
|
||||
|
|
|
@ -36,14 +36,13 @@ class LockScreenKeysMigrator @Inject constructor(
|
|||
/**
|
||||
* Performs any needed migrations in order.
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
suspend fun migrateIfNeeded() {
|
||||
if (legacyPinCodeMigrator.isMigrationNeeded()) {
|
||||
legacyPinCodeMigrator.migrate()
|
||||
missingSystemKeyMigrator.migrateIfNeeded()
|
||||
}
|
||||
|
||||
if (systemKeyV1Migrator.isMigrationNeeded() && versionProvider.get() >= Build.VERSION_CODES.M) {
|
||||
if (systemKeyV1Migrator.isMigrationNeeded() && versionProvider.isAtLeast(Build.VERSION_CODES.M)) {
|
||||
systemKeyV1Migrator.migrate()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue