Open mhsmith opened 2 weeks ago
No users have complained about this, and increasing minSdk
is an easy workaround. So we can probably just leave this issue open for visibility until our minimum API level is 24 or higher, at which time it can be closed.
However, there may be some non-Android-specific corner cases that we still don't cover (#1205).
For default methods, "desugaring" occurs to transform the bytecode into something which could have been generated by a Java 7 compiler. Based on my experiments, desugaring always occurs unless one of the following is true:
Based on my experiements with dexdump, the desugaring works as follows:
$-CC
class which contains the method implementations.So at runtime, the reflection API will indicate that the methods are abstract and not default. They can still be called via the subclass, but they can't be called via the interface. And the extra abstract methods may prevent the interface from being recognized as functional (which is why
test_call_interface_default
is disabled on Android).The only workaround I can see is to detect the existence of the
$-CC
class, and use it to work out which methods are supposed to be default.