Remove backward compatibility flag

Kotlin updates to 1.4 and fixes an issue where @JvmOverload methods
were not final.
See https://kotlinlang.org/docs/reference/compatibility-guide-14.html#generated-overloads-for-jvmoverloads-on-open-methods-should-be-final

Remove the backward compatibility flag by special-casing the method
that needs to be overridden at this time, which gets rid of the
local concern.

Bug: 166499531
Test: Builds, atest ConnectivityServiceTest
Change-Id: Ia13c67876f99dafd77d890e82d62453713b7b5fe
This commit is contained in:
Chalard Jean
2020-08-28 16:54:40 +09:00
parent 33ed824e80
commit d59af18458
2 changed files with 5 additions and 5 deletions

View File

@@ -170,8 +170,11 @@ open class TestableNetworkCallback private constructor(
}
// Make open for use in ConnectivityServiceTest which is the only one knowing its handlers.
@JvmOverloads
open fun assertNoCallback(timeoutMs: Long = defaultTimeoutMs) {
// TODO : remove the necessity to overload this, remove the open qualifier, and give a
// default argument to assertNoCallback instead, possibly with @JvmOverloads if necessary.
open fun assertNoCallback() = assertNoCallback(defaultTimeoutMs)
fun assertNoCallback(timeoutMs: Long) {
val cb = history.poll(timeoutMs)
if (null != cb) fail("Expected no callback but got $cb")
}