diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
index f31e07181c..1b9911acf6 100644
--- a/android/AndroidManifest.xml
+++ b/android/AndroidManifest.xml
@@ -4,7 +4,7 @@
android:versionCode="1"
android:versionName="1.0" >
-
+
diff --git a/android/native-audio-so.cpp b/android/native-audio-so.cpp
index 4448b8173e..53fa40273c 100644
--- a/android/native-audio-so.cpp
+++ b/android/native-audio-so.cpp
@@ -153,7 +153,9 @@ extern "C" void OpenSLWrap_Shutdown() {
SLresult result;
ILOG("OpenSLWrap_Shutdown - stopping playback");
result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_STOPPED);
- assert(SL_RESULT_SUCCESS == result);
+ if (SL_RESULT_SUCCESS != result) {
+ ELOG("SetPlayState failed");
+ }
ILOG("OpenSLWrap_Shutdown - deleting player object");
diff --git a/android/project.properties b/android/project.properties
index 137f19ac6a..f06f217ce4 100644
--- a/android/project.properties
+++ b/android/project.properties
@@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt
# Project target.
-target=android-17
+target=android-19
android.library=true
diff --git a/android/src/com/henrikrydgard/libnative/NativeActivity.java b/android/src/com/henrikrydgard/libnative/NativeActivity.java
index 094e7d693e..db4302bace 100644
--- a/android/src/com/henrikrydgard/libnative/NativeActivity.java
+++ b/android/src/com/henrikrydgard/libnative/NativeActivity.java
@@ -313,6 +313,9 @@ public class NativeActivity extends Activity {
if (Build.VERSION.SDK_INT >= 14) {
darkenOnScreenButtons();
}
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ setImmersiveMode();
+ }
}
@Override
@@ -339,6 +342,12 @@ public class NativeActivity extends Activity {
public void darkenOnScreenButtons() {
mGLSurfaceView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
+
+ @TargetApi(Build.VERSION_CODES.KITKAT)
+ public void setImmersiveMode() {
+ this.setImmersive(true); // This is an entirely different kind of immersive mode - hides some notification
+ mGLSurfaceView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
+ }
private boolean detectOpenGLES20() {
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
@@ -385,6 +394,9 @@ public class NativeActivity extends Activity {
if (Build.VERSION.SDK_INT >= 14) {
darkenOnScreenButtons();
}
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ setImmersiveMode();
+ }
}
// Prevent destroying and recreating the main activity when the device rotates etc,