mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Android: Convert BooleanSupplier to Kotlin
This commit is contained in:
parent
0d22dc0392
commit
123b242e9b
@ -1,11 +0,0 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
package org.dolphinemu.dolphinemu.utils;
|
|
||||||
|
|
||||||
import androidx.annotation.Keep;
|
|
||||||
|
|
||||||
public interface BooleanSupplier
|
|
||||||
{
|
|
||||||
@Keep
|
|
||||||
boolean get();
|
|
||||||
}
|
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
package org.dolphinemu.dolphinemu.utils
|
||||||
|
|
||||||
|
import androidx.annotation.Keep
|
||||||
|
|
||||||
|
/**
|
||||||
|
* java.util.function.BooleanSupplier is only provided starting with API 24, while Dolphin still supports API
|
||||||
|
* 21. API desugaring lets Kotlin/Java code use it on older Android versions, but JNI `FindClass("java/util/
|
||||||
|
* function/BooleanSupplier")` isn’t desugared, so native code can’t look up that type reliably on API 23 and
|
||||||
|
* below. Because of that limitation, we keep our own interface instead of relying on the platform type.
|
||||||
|
*/
|
||||||
|
@Keep
|
||||||
|
fun interface BooleanSupplier {
|
||||||
|
fun get(): Boolean
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user