Android: add MinimizeWindow function (Bug 4580, 4657)

shouldMinimizeOnFocusLoss is un-activated (return false)
This commit is contained in:
Sylvain Becker
2019-06-10 21:58:03 +02:00
parent 3f4e189b27
commit f9a9193e2c
7 changed files with 78 additions and 1 deletions

View File

@@ -846,6 +846,45 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
}
/**
* This method is called by SDL using JNI.
*/
public static void minimizeWindow() {
if (mSingleton == null) {
return;
}
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mSingleton.startActivity(startMain);
}
/**
* This method is called by SDL using JNI.
*/
public static boolean shouldMinimizeOnFocusLoss() {
/*
if (Build.VERSION.SDK_INT >= 24) {
if (mSingleton == null) {
return true;
}
if (mSingleton.isInMultiWindowMode()) {
return false;
}
if (mSingleton.isInPictureInPictureMode()) {
return false;
}
}
return true;
*/
return false;
}
/**
* This method is called by SDL using JNI.
*/