diff --git a/project/jni/application/teeworlds/AndroidAppSettings.cfg b/project/jni/application/teeworlds/AndroidAppSettings.cfg index 42e4b2287..4e03acd95 100644 --- a/project/jni/application/teeworlds/AndroidAppSettings.cfg +++ b/project/jni/application/teeworlds/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="TeeWorlds" AppFullName=com.teeworlds # Application version code (integer) -AppVersionCode=06324 +AppVersionCode=06325 # Application user-visible version name (string) -AppVersionName="0.6.3.24" +AppVersionName="0.6.3.25" # Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...' # If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu diff --git a/project/jni/application/teeworlds/java.patch b/project/jni/application/teeworlds/java.patch new file mode 100644 index 000000000..369aac5a6 --- /dev/null +++ b/project/jni/application/teeworlds/java.patch @@ -0,0 +1,55 @@ +diff --git a/project/java/Accelerometer.java b/project/java/Accelerometer.java +index 3e93b82..9796355 100644 +--- a/project/java/Accelerometer.java ++++ b/project/java/Accelerometer.java +@@ -45,6 +45,7 @@ class AccelerometerReader implements SensorEventListener + public boolean openedBySDL = false; + public static final GyroscopeListener gyro = new GyroscopeListener(); + public static final OrientationListener orientation = new OrientationListener(); ++ public static final ProximityListener proximity = new ProximityListener(); + + public AccelerometerReader(Activity context) + { +@@ -59,6 +60,7 @@ class AccelerometerReader implements SensorEventListener + _manager.unregisterListener(this); + _manager.unregisterListener(gyro); + _manager.unregisterListener(orientation); ++ _manager.unregisterListener(proximity); + } + } + +@@ -84,6 +86,11 @@ class AccelerometerReader implements SensorEventListener + Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ? Sensor.TYPE_GAME_ROTATION_VECTOR : Sensor.TYPE_ROTATION_VECTOR), + SensorManager.SENSOR_DELAY_GAME); + } ++ if( _manager != null && _manager.getDefaultSensor(Sensor.TYPE_PROXIMITY) != null ) ++ { ++ Log.i("SDL", "libSDL: starting proximity sensor"); ++ _manager.registerListener(proximity, _manager.getDefaultSensor(Sensor.TYPE_PROXIMITY), SensorManager.SENSOR_DELAY_GAME); ++ } + } + + public void onSensorChanged(SensorEvent event) +@@ -168,7 +175,22 @@ class AccelerometerReader implements SensorEventListener + } + } + ++ static class ProximityListener implements SensorEventListener ++ { ++ public ProximityListener() ++ { ++ } ++ public void onSensorChanged(SensorEvent event) ++ { ++ nativeProximity(event.values[0]); ++ } ++ public void onAccuracyChanged(Sensor s, int a) ++ { ++ } ++ } ++ + private static native void nativeAccelerometer(float accX, float accY, float accZ); + private static native void nativeGyroscope(float X, float Y, float Z); + private static native void nativeOrientation(float X, float Y, float Z); ++ private static native void nativeProximity(float X); + } diff --git a/project/jni/application/teeworlds/src b/project/jni/application/teeworlds/src index 747dc6db2..1a6c7de86 160000 --- a/project/jni/application/teeworlds/src +++ b/project/jni/application/teeworlds/src @@ -1 +1 @@ -Subproject commit 747dc6db230d2029fbda4aa328c63143a09861e3 +Subproject commit 1a6c7de86a38256c0c338f7d4c7c8d5541cb30c4