Merge pull request #14133 from Simonx22/android/boolean-supplier-kotlin

Android: Convert BooleanSupplier to Kotlin
This commit is contained in:
Jordan Woyak 2025-11-17 15:41:00 -06:00 committed by GitHub
commit f1db7ff25e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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
}