mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
No need to use @SuppressLint("NewApi")
when @ChecksSdkIntAtLeast
is used.
This commit is contained in:
parent
5886245bbf
commit
658a09ea6a
@ -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 New Issue
Block a user