diff --git a/cocos/2d/platform/android/CCDevice.cpp b/cocos/2d/platform/android/CCDevice.cpp index 96b1c8e597..2915cf6994 100644 --- a/cocos/2d/platform/android/CCDevice.cpp +++ b/cocos/2d/platform/android/CCDevice.cpp @@ -18,17 +18,17 @@ void Device::setAccelerometerEnabled(bool isEnabled) { if (isEnabled) { - enableAccelerometer(); + enableAccelerometerJni(); } else { - disableAccelerometer(); + disableAccelerometerJni(); } } void Device::setAccelerometerInterval(float interval) { - setAccelerometerInterval(interval); + setAccelerometerIntervalJni(interval); } NS_CC_END diff --git a/cocos/2d/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp index e92d9e5b78..e7eeb1606a 100644 --- a/cocos/2d/platform/android/nativeactivity.cpp +++ b/cocos/2d/platform/android/nativeactivity.cpp @@ -471,8 +471,8 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) return 0; } -void enableAccelerometer(void) { - LOGI("enableAccelerometer()"); +void enableAccelerometerJni(void) { + LOGI("enableAccelerometerJni()"); if (engine.accelerometerSensor != NULL) { ASensorEventQueue_enableSensor(engine.sensorEventQueue, @@ -485,8 +485,8 @@ void enableAccelerometer(void) { } } -void disableAccelerometer(void) { - LOGI("disableAccelerometer()"); +void disableAccelerometerJni(void) { + LOGI("disableAccelerometerJni()"); if (engine.accelerometerSensor != NULL) { ASensorEventQueue_disableSensor(engine.sensorEventQueue, @@ -494,8 +494,8 @@ void disableAccelerometer(void) { } } -void setAccelerometerInterval(float interval) { - LOGI("setAccelerometerInterval(%f)", interval); +void setAccelerometerIntervalJni(float interval) { + LOGI("setAccelerometerIntervalJni(%f)", interval); // We'd like to get 60 events per second (in us). ASensorEventQueue_setEventRate(engine.sensorEventQueue, engine.accelerometerSensor, interval * 1000000L); diff --git a/cocos/2d/platform/android/nativeactivity.h b/cocos/2d/platform/android/nativeactivity.h index 4f263a6032..677fff3adf 100644 --- a/cocos/2d/platform/android/nativeactivity.h +++ b/cocos/2d/platform/android/nativeactivity.h @@ -5,8 +5,8 @@ * This is the interface to the Android native activity */ -void enableAccelerometer(void); -void disableAccelerometer(void); -void setAccelerometerInterval(float interval); +void enableAccelerometerJni(void); +void disableAccelerometerJni(void); +void setAccelerometerIntervalJni(float interval); #endif // __COCOSNATIVEACTIVITY_H__