Loading play-services-core/src/main/kotlin/org/microg/gms/ui/ExposureNotificationsPreferencesFragment.kt +6 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,12 @@ class ExposureNotificationsPreferencesFragment : PreferenceFragmentCompat() { } } collectedRpis.summary = getString(R.string.pref_exposure_collected_rpis_summary, lastHourKeys) if (currentId != null) { advertisingId.isVisible = true advertisingId.summary = currentId.toString() } else { advertisingId.isVisible = false } exposureApps.removeAll() if (apps.isEmpty()) { exposureApps.addPreference(exposureAppsNone) Loading play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureDatabase.kt +16 −16 Original line number Diff line number Diff line Loading @@ -499,8 +499,7 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit } } private val currentTemporaryExposureKey: TemporaryExposureKey get() = writableDatabase.let { database -> private fun ensureTemporaryExposureKey(): TemporaryExposureKey = writableDatabase.let { database -> database.beginTransaction() try { var key = findOwnKeyAt(currentRollingStartNumber.toInt(), database) Loading @@ -515,13 +514,14 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit } } val currentRpiId: UUID val currentRpiId: UUID? get() { val buffer = ByteBuffer.wrap(currentTemporaryExposureKey.generateRpiId(currentIntervalNumber.toInt())) val key = findOwnKeyAt(currentRollingStartNumber.toInt()) ?: return null val buffer = ByteBuffer.wrap(key.generateRpiId(currentIntervalNumber.toInt())) return UUID(buffer.long, buffer.long) } fun generateCurrentPayload(metadata: ByteArray) = currentTemporaryExposureKey.generatePayload(currentIntervalNumber.toInt(), metadata) fun generateCurrentPayload(metadata: ByteArray) = ensureTemporaryExposureKey().generatePayload(currentIntervalNumber.toInt(), metadata) override fun getWritableDatabase(): SQLiteDatabase { if (this != instance) { Loading Loading
play-services-core/src/main/kotlin/org/microg/gms/ui/ExposureNotificationsPreferencesFragment.kt +6 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,12 @@ class ExposureNotificationsPreferencesFragment : PreferenceFragmentCompat() { } } collectedRpis.summary = getString(R.string.pref_exposure_collected_rpis_summary, lastHourKeys) if (currentId != null) { advertisingId.isVisible = true advertisingId.summary = currentId.toString() } else { advertisingId.isVisible = false } exposureApps.removeAll() if (apps.isEmpty()) { exposureApps.addPreference(exposureAppsNone) Loading
play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureDatabase.kt +16 −16 Original line number Diff line number Diff line Loading @@ -499,8 +499,7 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit } } private val currentTemporaryExposureKey: TemporaryExposureKey get() = writableDatabase.let { database -> private fun ensureTemporaryExposureKey(): TemporaryExposureKey = writableDatabase.let { database -> database.beginTransaction() try { var key = findOwnKeyAt(currentRollingStartNumber.toInt(), database) Loading @@ -515,13 +514,14 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit } } val currentRpiId: UUID val currentRpiId: UUID? get() { val buffer = ByteBuffer.wrap(currentTemporaryExposureKey.generateRpiId(currentIntervalNumber.toInt())) val key = findOwnKeyAt(currentRollingStartNumber.toInt()) ?: return null val buffer = ByteBuffer.wrap(key.generateRpiId(currentIntervalNumber.toInt())) return UUID(buffer.long, buffer.long) } fun generateCurrentPayload(metadata: ByteArray) = currentTemporaryExposureKey.generatePayload(currentIntervalNumber.toInt(), metadata) fun generateCurrentPayload(metadata: ByteArray) = ensureTemporaryExposureKey().generatePayload(currentIntervalNumber.toInt(), metadata) override fun getWritableDatabase(): SQLiteDatabase { if (this != instance) { Loading