mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-05 10:36:17 +02:00
Expose the Android system version to the app. Useful to enable/disable android-only features like immersive mode
This commit is contained in:
1 parent
ed04a0bf28
commit
2ab2016002
7 files changed
+24
-3
No files matched your search
+12
-1
@@ -53,6 +53,7 @@ static float hat_joystick_y_async;
|
||||
|
||||
int optimalFramesPerBuffer = 0;
|
||||
int optimalSampleRate = 0;
|
||||
static int androidVersion;
|
||||
|
||||
// Android implementation of callbacks to the Java part of the app
|
||||
void SystemToast(const char *text) {
|
||||
@@ -103,6 +104,15 @@ std::string System_GetProperty(SystemProperty prop) {
|
||||
}
|
||||
}
|
||||
|
||||
int System_GetPropertyInt(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_SYSTEMVERSION:
|
||||
return androidVersion;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Remember that all of these need initialization on init! The process
|
||||
// may be reused when restarting the game. Globals are DANGEROUS.
|
||||
|
||||
@@ -154,7 +164,7 @@ extern "C" jstring Java_com_henrikrydgard_libnative_NativeApp_queryConfig
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
(JNIEnv *env, jclass, jstring jdevicetype, jstring jlangRegion, jstring japkpath,
|
||||
jstring jdataDir, jstring jexternalDir, jstring jlibraryDir, jstring jshortcutParam,
|
||||
jstring jinstallID, jboolean juseNativeAudio) {
|
||||
jstring jinstallID, jboolean juseNativeAudio, jint jAndroidVersion) {
|
||||
jniEnvUI = env;
|
||||
|
||||
ILOG("NativeApp.init() -- begin");
|
||||
@@ -162,6 +172,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
memset(&input_state, 0, sizeof(input_state));
|
||||
renderer_inited = false;
|
||||
first_lost = true;
|
||||
androidVersion = jAndroidVersion;
|
||||
|
||||
g_buttonTracker.Reset();
|
||||
|
||||
|
||||
Reference in new issue
Block a user