Android: Convert BooleanSupplier to Kotlin

This commit is contained in:
Simonx22 2025-11-17 15:31:30 -05:00
parent 0d22dc0392
commit 123b242e9b
2 changed files with 16 additions and 11 deletions

View File

@ -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();
}

View File

@ -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")` isnt desugared, so native code cant 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
}