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()
|
result()
|
||||||
} else null
|
} 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.
|
* Performs any needed migrations in order.
|
||||||
*/
|
*/
|
||||||
@SuppressLint("NewApi")
|
|
||||||
suspend fun migrateIfNeeded() {
|
suspend fun migrateIfNeeded() {
|
||||||
if (legacyPinCodeMigrator.isMigrationNeeded()) {
|
if (legacyPinCodeMigrator.isMigrationNeeded()) {
|
||||||
legacyPinCodeMigrator.migrate()
|
legacyPinCodeMigrator.migrate()
|
||||||
missingSystemKeyMigrator.migrateIfNeeded()
|
missingSystemKeyMigrator.migrateIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (systemKeyV1Migrator.isMigrationNeeded() && versionProvider.get() >= Build.VERSION_CODES.M) {
|
if (systemKeyV1Migrator.isMigrationNeeded() && versionProvider.isAtLeast(Build.VERSION_CODES.M)) {
|
||||||
systemKeyV1Migrator.migrate()
|
systemKeyV1Migrator.migrate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user