Merge "Frameworks/base: Fix services/jni warnings"

This commit is contained in:
Andreas Gampe
2014-09-29 18:10:26 +00:00
committed by Gerrit Code Review
15 changed files with 137 additions and 121 deletions

View File

@ -52,7 +52,7 @@ LOCAL_SHARED_LIBRARIES := \
libEGL \ libEGL \
libGLESv2 libGLESv2
LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -Wall -Werror
LOCAL_MODULE:= libandroid_servers LOCAL_MODULE:= libandroid_servers

View File

@ -28,8 +28,12 @@
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
// Disable warnings for Skia.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <SkCanvas.h> #include <SkCanvas.h>
#include <SkBitmap.h> #include <SkBitmap.h>
#pragma GCC diagnostic pop
namespace android { namespace android {

View File

@ -29,7 +29,7 @@
namespace android { namespace android {
static jlong halOpen(JNIEnv *env, jobject obj) { static jlong halOpen(JNIEnv* /* env */, jobject /* obj */) {
hw_module_t const* module; hw_module_t const* module;
consumerir_device_t *dev; consumerir_device_t *dev;
int err; int err;
@ -50,7 +50,7 @@ static jlong halOpen(JNIEnv *env, jobject obj) {
return reinterpret_cast<jlong>(dev); return reinterpret_cast<jlong>(dev);
} }
static jint halTransmit(JNIEnv *env, jobject obj, jlong halObject, static jint halTransmit(JNIEnv *env, jobject /* obj */, jlong halObject,
jint carrierFrequency, jintArray pattern) { jint carrierFrequency, jintArray pattern) {
int ret; int ret;
@ -66,7 +66,7 @@ static jint halTransmit(JNIEnv *env, jobject obj, jlong halObject,
return reinterpret_cast<jint>(ret); return reinterpret_cast<jint>(ret);
} }
static jintArray halGetCarrierFrequencies(JNIEnv *env, jobject obj, static jintArray halGetCarrierFrequencies(JNIEnv *env, jobject /* obj */,
jlong halObject) { jlong halObject) {
consumerir_device_t *dev = reinterpret_cast<consumerir_device_t*>(halObject); consumerir_device_t *dev = reinterpret_cast<consumerir_device_t*>(halObject);
consumerir_freq_range_t *ranges; consumerir_freq_range_t *ranges;

View File

@ -60,7 +60,7 @@ static light_device_t* get_device(hw_module_t* module, char const* name)
} }
} }
static jlong init_native(JNIEnv *env, jobject clazz) static jlong init_native(JNIEnv* /* env */, jobject /* clazz */)
{ {
int err; int err;
hw_module_t* module; hw_module_t* module;
@ -93,7 +93,7 @@ static jlong init_native(JNIEnv *env, jobject clazz)
return (jlong)devices; return (jlong)devices;
} }
static void finalize_native(JNIEnv *env, jobject clazz, jlong ptr) static void finalize_native(JNIEnv* /* env */, jobject /* clazz */, jlong ptr)
{ {
Devices* devices = (Devices*)ptr; Devices* devices = (Devices*)ptr;
if (devices == NULL) { if (devices == NULL) {
@ -103,7 +103,7 @@ static void finalize_native(JNIEnv *env, jobject clazz, jlong ptr)
free(devices); free(devices);
} }
static void setLight_native(JNIEnv *env, jobject clazz, jlong ptr, static void setLight_native(JNIEnv* /* env */, jobject /* clazz */, jlong ptr,
jint light, jint colorARGB, jint flashMode, jint onMS, jint offMS, jint brightnessMode) jint light, jint colorARGB, jint flashMode, jint onMS, jint offMS, jint brightnessMode)
{ {
Devices* devices = (Devices*)ptr; Devices* devices = (Devices*)ptr;

View File

@ -34,7 +34,7 @@ static struct parcel_file_descriptor_offsets_t
jmethodID mConstructor; jmethodID mConstructor;
} gParcelFileDescriptorOffsets; } gParcelFileDescriptorOffsets;
static jobject android_server_SerialService_open(JNIEnv *env, jobject thiz, jstring path) static jobject android_server_SerialService_open(JNIEnv *env, jobject /* thiz */, jstring path)
{ {
const char *pathStr = env->GetStringUTFChars(path, NULL); const char *pathStr = env->GetStringUTFChars(path, NULL);

View File

@ -25,7 +25,7 @@
namespace android { namespace android {
static void android_server_SystemServer_nativeInit(JNIEnv* env, jobject clazz) { static void android_server_SystemServer_nativeInit(JNIEnv* /* env */, jobject /* clazz */) {
char propBuf[PROPERTY_VALUE_MAX]; char propBuf[PROPERTY_VALUE_MAX];
property_get("system_init.startsensorservice", propBuf, "1"); property_get("system_init.startsensorservice", propBuf, "1");
if (strcmp(propBuf, "1") == 0) { if (strcmp(propBuf, "1") == 0) {

View File

@ -63,7 +63,8 @@ static void set_accessory_string(JNIEnv *env, int fd, int cmd, jobjectArray strA
} }
static jobjectArray android_server_UsbDeviceManager_getAccessoryStrings(JNIEnv *env, jobject thiz) static jobjectArray android_server_UsbDeviceManager_getAccessoryStrings(JNIEnv *env,
jobject /* thiz */)
{ {
int fd = open(DRIVER_NAME, O_RDWR); int fd = open(DRIVER_NAME, O_RDWR);
if (fd < 0) { if (fd < 0) {
@ -85,7 +86,7 @@ out:
return strArray; return strArray;
} }
static jobject android_server_UsbDeviceManager_openAccessory(JNIEnv *env, jobject thiz) static jobject android_server_UsbDeviceManager_openAccessory(JNIEnv *env, jobject /* thiz */)
{ {
int fd = open(DRIVER_NAME, O_RDWR); int fd = open(DRIVER_NAME, O_RDWR);
if (fd < 0) { if (fd < 0) {
@ -100,7 +101,8 @@ static jobject android_server_UsbDeviceManager_openAccessory(JNIEnv *env, jobjec
gParcelFileDescriptorOffsets.mConstructor, fileDescriptor); gParcelFileDescriptorOffsets.mConstructor, fileDescriptor);
} }
static jboolean android_server_UsbDeviceManager_isStartRequested(JNIEnv *env, jobject thiz) static jboolean android_server_UsbDeviceManager_isStartRequested(JNIEnv* /* env */,
jobject /* thiz */)
{ {
int fd = open(DRIVER_NAME, O_RDWR); int fd = open(DRIVER_NAME, O_RDWR);
if (fd < 0) { if (fd < 0) {
@ -112,7 +114,7 @@ static jboolean android_server_UsbDeviceManager_isStartRequested(JNIEnv *env, jo
return (result == 1); return (result == 1);
} }
static jint android_server_UsbDeviceManager_getAudioMode(JNIEnv *env, jobject thiz) static jint android_server_UsbDeviceManager_getAudioMode(JNIEnv* /* env */, jobject /* thiz */)
{ {
int fd = open(DRIVER_NAME, O_RDWR); int fd = open(DRIVER_NAME, O_RDWR);
if (fd < 0) { if (fd < 0) {

View File

@ -142,7 +142,7 @@ static int usb_device_removed(const char *devname, void* client_data) {
return 0; return 0;
} }
static void android_server_UsbHostManager_monitorUsbHostBus(JNIEnv *env, jobject thiz) static void android_server_UsbHostManager_monitorUsbHostBus(JNIEnv* /* env */, jobject thiz)
{ {
struct usb_host_context* context = usb_host_init(); struct usb_host_context* context = usb_host_init();
if (!context) { if (!context) {
@ -153,7 +153,8 @@ static void android_server_UsbHostManager_monitorUsbHostBus(JNIEnv *env, jobject
usb_host_run(context, usb_device_added, usb_device_removed, NULL, (void *)thiz); usb_host_run(context, usb_device_added, usb_device_removed, NULL, (void *)thiz);
} }
static jobject android_server_UsbHostManager_openDevice(JNIEnv *env, jobject thiz, jstring deviceName) static jobject android_server_UsbHostManager_openDevice(JNIEnv *env, jobject /* thiz */,
jstring deviceName)
{ {
const char *deviceNameStr = env->GetStringUTFChars(deviceName, NULL); const char *deviceNameStr = env->GetStringUTFChars(deviceName, NULL);
struct usb_device* device = usb_device_open(deviceNameStr); struct usb_device* device = usb_device_open(deviceNameStr);

View File

@ -29,18 +29,18 @@
namespace android namespace android
{ {
static jboolean vibratorExists(JNIEnv *env, jobject clazz) static jboolean vibratorExists(JNIEnv* /* env */, jobject /* clazz */)
{ {
return vibrator_exists() > 0 ? JNI_TRUE : JNI_FALSE; return vibrator_exists() > 0 ? JNI_TRUE : JNI_FALSE;
} }
static void vibratorOn(JNIEnv *env, jobject clazz, jlong timeout_ms) static void vibratorOn(JNIEnv* /* env */, jobject /* clazz */, jlong timeout_ms)
{ {
// ALOGI("vibratorOn\n"); // ALOGI("vibratorOn\n");
vibrator_on(timeout_ms); vibrator_on(timeout_ms);
} }
static void vibratorOff(JNIEnv *env, jobject clazz) static void vibratorOff(JNIEnv* /* env */, jobject /* clazz */)
{ {
// ALOGI("vibratorOff\n"); // ALOGI("vibratorOff\n");
vibrator_off(); vibrator_off();

View File

@ -313,7 +313,7 @@ static void throwException(JNIEnv *env, int error, const char *message)
} }
} }
static jint create(JNIEnv *env, jobject thiz, jint mtu) static jint create(JNIEnv *env, jobject /* thiz */, jint mtu)
{ {
int tun = create_interface(mtu); int tun = create_interface(mtu);
if (tun < 0) { if (tun < 0) {
@ -323,7 +323,7 @@ static jint create(JNIEnv *env, jobject thiz, jint mtu)
return tun; return tun;
} }
static jstring getName(JNIEnv *env, jobject thiz, jint tun) static jstring getName(JNIEnv *env, jobject /* thiz */, jint tun)
{ {
char name[IFNAMSIZ]; char name[IFNAMSIZ];
if (get_interface_name(name, tun) < 0) { if (get_interface_name(name, tun) < 0) {
@ -333,7 +333,7 @@ static jstring getName(JNIEnv *env, jobject thiz, jint tun)
return env->NewStringUTF(name); return env->NewStringUTF(name);
} }
static jint setAddresses(JNIEnv *env, jobject thiz, jstring jName, static jint setAddresses(JNIEnv *env, jobject /* thiz */, jstring jName,
jstring jAddresses) jstring jAddresses)
{ {
const char *name = NULL; const char *name = NULL;
@ -366,7 +366,7 @@ error:
return count; return count;
} }
static jint setRoutes(JNIEnv *env, jobject thiz, jstring jName, static jint setRoutes(JNIEnv *env, jobject /* thiz */, jstring jName,
jstring jRoutes) jstring jRoutes)
{ {
const char *name = NULL; const char *name = NULL;
@ -399,7 +399,7 @@ error:
return count; return count;
} }
static void reset(JNIEnv *env, jobject thiz, jstring jName) static void reset(JNIEnv *env, jobject /* thiz */, jstring jName)
{ {
const char *name = jName ? env->GetStringUTFChars(jName, NULL) : NULL; const char *name = jName ? env->GetStringUTFChars(jName, NULL) : NULL;
if (!name) { if (!name) {
@ -412,7 +412,7 @@ static void reset(JNIEnv *env, jobject thiz, jstring jName)
env->ReleaseStringUTFChars(jName, name); env->ReleaseStringUTFChars(jName, name);
} }
static jint check(JNIEnv *env, jobject thiz, jstring jName) static jint check(JNIEnv *env, jobject /* thiz */, jstring jName)
{ {
const char *name = jName ? env->GetStringUTFChars(jName, NULL) : NULL; const char *name = jName ? env->GetStringUTFChars(jName, NULL) : NULL;
if (!name) { if (!name) {

View File

@ -335,14 +335,14 @@ void NativeInputManager::setDisplayViewport(bool external, const DisplayViewport
} }
} }
status_t NativeInputManager::registerInputChannel(JNIEnv* env, status_t NativeInputManager::registerInputChannel(JNIEnv* /* env */,
const sp<InputChannel>& inputChannel, const sp<InputChannel>& inputChannel,
const sp<InputWindowHandle>& inputWindowHandle, bool monitor) { const sp<InputWindowHandle>& inputWindowHandle, bool monitor) {
return mInputManager->getDispatcher()->registerInputChannel( return mInputManager->getDispatcher()->registerInputChannel(
inputChannel, inputWindowHandle, monitor); inputChannel, inputWindowHandle, monitor);
} }
status_t NativeInputManager::unregisterInputChannel(JNIEnv* env, status_t NativeInputManager::unregisterInputChannel(JNIEnv* /* env */,
const sp<InputChannel>& inputChannel) { const sp<InputChannel>& inputChannel) {
return mInputManager->getDispatcher()->unregisterInputChannel(inputChannel); return mInputManager->getDispatcher()->unregisterInputChannel(inputChannel);
} }
@ -413,7 +413,7 @@ void NativeInputManager::getReaderConfiguration(InputReaderConfiguration* outCon
} // release lock } // release lock
} }
sp<PointerControllerInterface> NativeInputManager::obtainPointerController(int32_t deviceId) { sp<PointerControllerInterface> NativeInputManager::obtainPointerController(int32_t /* deviceId */) {
AutoMutex _l(mLock); AutoMutex _l(mLock);
sp<PointerController> controller = mLocked.pointerController.promote(); sp<PointerController> controller = mLocked.pointerController.promote();
@ -530,7 +530,7 @@ String8 NativeInputManager::getDeviceAlias(const InputDeviceIdentifier& identifi
} }
void NativeInputManager::notifySwitch(nsecs_t when, void NativeInputManager::notifySwitch(nsecs_t when,
uint32_t switchValues, uint32_t switchMask, uint32_t policyFlags) { uint32_t switchValues, uint32_t switchMask, uint32_t /* policyFlags */) {
#if DEBUG_INPUT_DISPATCHER_POLICY #if DEBUG_INPUT_DISPATCHER_POLICY
ALOGD("notifySwitch - when=%lld, switchValues=0x%08x, switchMask=0x%08x, policyFlags=0x%x", ALOGD("notifySwitch - when=%lld, switchValues=0x%08x, switchMask=0x%08x, policyFlags=0x%x",
when, switchValues, switchMask, policyFlags); when, switchValues, switchMask, policyFlags);
@ -977,7 +977,7 @@ void NativeInputManager::loadPointerResources(PointerResources* outResources) {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static jlong nativeInit(JNIEnv* env, jclass clazz, static jlong nativeInit(JNIEnv* env, jclass /* clazz */,
jobject serviceObj, jobject contextObj, jobject messageQueueObj) { jobject serviceObj, jobject contextObj, jobject messageQueueObj) {
sp<MessageQueue> messageQueue = android_os_MessageQueue_getMessageQueue(env, messageQueueObj); sp<MessageQueue> messageQueue = android_os_MessageQueue_getMessageQueue(env, messageQueueObj);
if (messageQueue == NULL) { if (messageQueue == NULL) {
@ -991,7 +991,7 @@ static jlong nativeInit(JNIEnv* env, jclass clazz,
return reinterpret_cast<jlong>(im); return reinterpret_cast<jlong>(im);
} }
static void nativeStart(JNIEnv* env, jclass clazz, jlong ptr) { static void nativeStart(JNIEnv* env, jclass /* clazz */, jlong ptr) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
status_t result = im->getInputManager()->start(); status_t result = im->getInputManager()->start();
@ -1000,8 +1000,8 @@ static void nativeStart(JNIEnv* env, jclass clazz, jlong ptr) {
} }
} }
static void nativeSetDisplayViewport(JNIEnv* env, jclass clazz, jlong ptr, jboolean external, static void nativeSetDisplayViewport(JNIEnv* /* env */, jclass /* clazz */, jlong ptr,
jint displayId, jint orientation, jboolean external, jint displayId, jint orientation,
jint logicalLeft, jint logicalTop, jint logicalRight, jint logicalBottom, jint logicalLeft, jint logicalTop, jint logicalRight, jint logicalBottom,
jint physicalLeft, jint physicalTop, jint physicalRight, jint physicalBottom, jint physicalLeft, jint physicalTop, jint physicalRight, jint physicalBottom,
jint deviceWidth, jint deviceHeight) { jint deviceWidth, jint deviceHeight) {
@ -1023,7 +1023,7 @@ static void nativeSetDisplayViewport(JNIEnv* env, jclass clazz, jlong ptr, jbool
im->setDisplayViewport(external, v); im->setDisplayViewport(external, v);
} }
static jint nativeGetScanCodeState(JNIEnv* env, jclass clazz, static jint nativeGetScanCodeState(JNIEnv* /* env */, jclass /* clazz */,
jlong ptr, jint deviceId, jint sourceMask, jint scanCode) { jlong ptr, jint deviceId, jint sourceMask, jint scanCode) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1031,7 +1031,7 @@ static jint nativeGetScanCodeState(JNIEnv* env, jclass clazz,
deviceId, uint32_t(sourceMask), scanCode); deviceId, uint32_t(sourceMask), scanCode);
} }
static jint nativeGetKeyCodeState(JNIEnv* env, jclass clazz, static jint nativeGetKeyCodeState(JNIEnv* /* env */, jclass /* clazz */,
jlong ptr, jint deviceId, jint sourceMask, jint keyCode) { jlong ptr, jint deviceId, jint sourceMask, jint keyCode) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1039,7 +1039,7 @@ static jint nativeGetKeyCodeState(JNIEnv* env, jclass clazz,
deviceId, uint32_t(sourceMask), keyCode); deviceId, uint32_t(sourceMask), keyCode);
} }
static jint nativeGetSwitchState(JNIEnv* env, jclass clazz, static jint nativeGetSwitchState(JNIEnv* /* env */, jclass /* clazz */,
jlong ptr, jint deviceId, jint sourceMask, jint sw) { jlong ptr, jint deviceId, jint sourceMask, jint sw) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1047,7 +1047,7 @@ static jint nativeGetSwitchState(JNIEnv* env, jclass clazz,
deviceId, uint32_t(sourceMask), sw); deviceId, uint32_t(sourceMask), sw);
} }
static jboolean nativeHasKeys(JNIEnv* env, jclass clazz, static jboolean nativeHasKeys(JNIEnv* env, jclass /* clazz */,
jlong ptr, jint deviceId, jint sourceMask, jintArray keyCodes, jbooleanArray outFlags) { jlong ptr, jint deviceId, jint sourceMask, jintArray keyCodes, jbooleanArray outFlags) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1077,7 +1077,7 @@ static void throwInputChannelNotInitialized(JNIEnv* env) {
} }
static void handleInputChannelDisposed(JNIEnv* env, static void handleInputChannelDisposed(JNIEnv* env,
jobject inputChannelObj, const sp<InputChannel>& inputChannel, void* data) { jobject /* inputChannelObj */, const sp<InputChannel>& inputChannel, void* data) {
NativeInputManager* im = static_cast<NativeInputManager*>(data); NativeInputManager* im = static_cast<NativeInputManager*>(data);
ALOGW("Input channel object '%s' was disposed without first being unregistered with " ALOGW("Input channel object '%s' was disposed without first being unregistered with "
@ -1085,7 +1085,7 @@ static void handleInputChannelDisposed(JNIEnv* env,
im->unregisterInputChannel(env, inputChannel); im->unregisterInputChannel(env, inputChannel);
} }
static void nativeRegisterInputChannel(JNIEnv* env, jclass clazz, static void nativeRegisterInputChannel(JNIEnv* env, jclass /* clazz */,
jlong ptr, jobject inputChannelObj, jobject inputWindowHandleObj, jboolean monitor) { jlong ptr, jobject inputChannelObj, jobject inputWindowHandleObj, jboolean monitor) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1114,7 +1114,7 @@ static void nativeRegisterInputChannel(JNIEnv* env, jclass clazz,
} }
} }
static void nativeUnregisterInputChannel(JNIEnv* env, jclass clazz, static void nativeUnregisterInputChannel(JNIEnv* env, jclass /* clazz */,
jlong ptr, jobject inputChannelObj) { jlong ptr, jobject inputChannelObj) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1135,14 +1135,14 @@ static void nativeUnregisterInputChannel(JNIEnv* env, jclass clazz,
} }
} }
static void nativeSetInputFilterEnabled(JNIEnv* env, jclass clazz, static void nativeSetInputFilterEnabled(JNIEnv* /* env */, jclass /* clazz */,
jlong ptr, jboolean enabled) { jlong ptr, jboolean enabled) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->getInputManager()->getDispatcher()->setInputFilterEnabled(enabled); im->getInputManager()->getDispatcher()->setInputFilterEnabled(enabled);
} }
static jint nativeInjectInputEvent(JNIEnv* env, jclass clazz, static jint nativeInjectInputEvent(JNIEnv* env, jclass /* clazz */,
jlong ptr, jobject inputEventObj, jint injectorPid, jint injectorUid, jlong ptr, jobject inputEventObj, jint injectorPid, jint injectorUid,
jint syncMode, jint timeoutMillis, jint policyFlags) { jint syncMode, jint timeoutMillis, jint policyFlags) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1174,36 +1174,36 @@ static jint nativeInjectInputEvent(JNIEnv* env, jclass clazz,
} }
} }
static void nativeSetInputWindows(JNIEnv* env, jclass clazz, static void nativeSetInputWindows(JNIEnv* env, jclass /* clazz */,
jlong ptr, jobjectArray windowHandleObjArray) { jlong ptr, jobjectArray windowHandleObjArray) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->setInputWindows(env, windowHandleObjArray); im->setInputWindows(env, windowHandleObjArray);
} }
static void nativeSetFocusedApplication(JNIEnv* env, jclass clazz, static void nativeSetFocusedApplication(JNIEnv* env, jclass /* clazz */,
jlong ptr, jobject applicationHandleObj) { jlong ptr, jobject applicationHandleObj) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->setFocusedApplication(env, applicationHandleObj); im->setFocusedApplication(env, applicationHandleObj);
} }
static void nativeSetInputDispatchMode(JNIEnv* env, static void nativeSetInputDispatchMode(JNIEnv* /* env */,
jclass clazz, jlong ptr, jboolean enabled, jboolean frozen) { jclass /* clazz */, jlong ptr, jboolean enabled, jboolean frozen) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->setInputDispatchMode(enabled, frozen); im->setInputDispatchMode(enabled, frozen);
} }
static void nativeSetSystemUiVisibility(JNIEnv* env, static void nativeSetSystemUiVisibility(JNIEnv* /* env */,
jclass clazz, jlong ptr, jint visibility) { jclass /* clazz */, jlong ptr, jint visibility) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->setSystemUiVisibility(visibility); im->setSystemUiVisibility(visibility);
} }
static jboolean nativeTransferTouchFocus(JNIEnv* env, static jboolean nativeTransferTouchFocus(JNIEnv* env,
jclass clazz, jlong ptr, jobject fromChannelObj, jobject toChannelObj) { jclass /* clazz */, jlong ptr, jobject fromChannelObj, jobject toChannelObj) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
sp<InputChannel> fromChannel = sp<InputChannel> fromChannel =
@ -1223,22 +1223,22 @@ static jboolean nativeTransferTouchFocus(JNIEnv* env,
} }
} }
static void nativeSetPointerSpeed(JNIEnv* env, static void nativeSetPointerSpeed(JNIEnv* /* env */,
jclass clazz, jlong ptr, jint speed) { jclass /* clazz */, jlong ptr, jint speed) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->setPointerSpeed(speed); im->setPointerSpeed(speed);
} }
static void nativeSetShowTouches(JNIEnv* env, static void nativeSetShowTouches(JNIEnv* /* env */,
jclass clazz, jlong ptr, jboolean enabled) { jclass /* clazz */, jlong ptr, jboolean enabled) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->setShowTouches(enabled); im->setShowTouches(enabled);
} }
static void nativeVibrate(JNIEnv* env, static void nativeVibrate(JNIEnv* env,
jclass clazz, jlong ptr, jint deviceId, jlongArray patternObj, jclass /* clazz */, jlong ptr, jint deviceId, jlongArray patternObj,
jint repeat, jint token) { jint repeat, jint token) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@ -1262,30 +1262,30 @@ static void nativeVibrate(JNIEnv* env,
im->getInputManager()->getReader()->vibrate(deviceId, pattern, patternSize, repeat, token); im->getInputManager()->getReader()->vibrate(deviceId, pattern, patternSize, repeat, token);
} }
static void nativeCancelVibrate(JNIEnv* env, static void nativeCancelVibrate(JNIEnv* /* env */,
jclass clazz, jlong ptr, jint deviceId, jint token) { jclass /* clazz */, jlong ptr, jint deviceId, jint token) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->getInputManager()->getReader()->cancelVibrate(deviceId, token); im->getInputManager()->getReader()->cancelVibrate(deviceId, token);
} }
static void nativeReloadKeyboardLayouts(JNIEnv* env, static void nativeReloadKeyboardLayouts(JNIEnv* /* env */,
jclass clazz, jlong ptr) { jclass /* clazz */, jlong ptr) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->getInputManager()->getReader()->requestRefreshConfiguration( im->getInputManager()->getReader()->requestRefreshConfiguration(
InputReaderConfiguration::CHANGE_KEYBOARD_LAYOUTS); InputReaderConfiguration::CHANGE_KEYBOARD_LAYOUTS);
} }
static void nativeReloadDeviceAliases(JNIEnv* env, static void nativeReloadDeviceAliases(JNIEnv* /* env */,
jclass clazz, jlong ptr) { jclass /* clazz */, jlong ptr) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->getInputManager()->getReader()->requestRefreshConfiguration( im->getInputManager()->getReader()->requestRefreshConfiguration(
InputReaderConfiguration::CHANGE_DEVICE_ALIAS); InputReaderConfiguration::CHANGE_DEVICE_ALIAS);
} }
static jstring nativeDump(JNIEnv* env, jclass clazz, jlong ptr) { static jstring nativeDump(JNIEnv* env, jclass /* clazz */, jlong ptr) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
String8 dump; String8 dump;
@ -1293,7 +1293,7 @@ static jstring nativeDump(JNIEnv* env, jclass clazz, jlong ptr) {
return env->NewStringUTF(dump.string()); return env->NewStringUTF(dump.string());
} }
static void nativeMonitor(JNIEnv* env, jclass clazz, jlong ptr) { static void nativeMonitor(JNIEnv* /* env */, jclass /* clazz */, jlong ptr) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
im->getInputManager()->getReader()->monitor(); im->getInputManager()->getReader()->monitor();

View File

@ -695,11 +695,11 @@ static void Init(JNIEnv* env, jobject obj) {
// TODO: inject any device context if when needed // TODO: inject any device context if when needed
} }
static jboolean IsSupported(JNIEnv* env, jclass clazz) { static jboolean IsSupported(JNIEnv* /* env */, jclass /* clazz */) {
return sFlpInterface != NULL; return sFlpInterface != NULL;
} }
static jint GetBatchSize(JNIEnv* env, jobject object) { static jint GetBatchSize(JNIEnv* env, jobject /* object */) {
if(sFlpInterface == NULL) { if(sFlpInterface == NULL) {
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
} }
@ -709,7 +709,7 @@ static jint GetBatchSize(JNIEnv* env, jobject object) {
static void StartBatching( static void StartBatching(
JNIEnv* env, JNIEnv* env,
jobject object, jobject /* object */,
jint id, jint id,
jobject optionsObject) { jobject optionsObject) {
if(sFlpInterface == NULL || optionsObject == NULL) { if(sFlpInterface == NULL || optionsObject == NULL) {
@ -724,7 +724,7 @@ static void StartBatching(
static void UpdateBatchingOptions( static void UpdateBatchingOptions(
JNIEnv* env, JNIEnv* env,
jobject object, jobject /* object */,
jint id, jint id,
jobject optionsObject) { jobject optionsObject) {
if(sFlpInterface == NULL || optionsObject == NULL) { if(sFlpInterface == NULL || optionsObject == NULL) {
@ -737,7 +737,7 @@ static void UpdateBatchingOptions(
ThrowOnError(env, result, __FUNCTION__); ThrowOnError(env, result, __FUNCTION__);
} }
static void StopBatching(JNIEnv* env, jobject object, jint id) { static void StopBatching(JNIEnv* env, jobject /* object */, jint id) {
if(sFlpInterface == NULL) { if(sFlpInterface == NULL) {
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
} }
@ -745,7 +745,7 @@ static void StopBatching(JNIEnv* env, jobject object, jint id) {
sFlpInterface->stop_batching(id); sFlpInterface->stop_batching(id);
} }
static void Cleanup(JNIEnv* env, jobject object) { static void Cleanup(JNIEnv* env, jobject /* object */) {
if(sFlpInterface == NULL) { if(sFlpInterface == NULL) {
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
} }
@ -768,7 +768,7 @@ static void Cleanup(JNIEnv* env, jobject object) {
} }
} }
static void GetBatchedLocation(JNIEnv* env, jobject object, jint lastNLocations) { static void GetBatchedLocation(JNIEnv* env, jobject /* object */, jint lastNLocations) {
if(sFlpInterface == NULL) { if(sFlpInterface == NULL) {
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
} }
@ -776,7 +776,7 @@ static void GetBatchedLocation(JNIEnv* env, jobject object, jint lastNLocations)
sFlpInterface->get_batched_location(lastNLocations); sFlpInterface->get_batched_location(lastNLocations);
} }
static void InjectLocation(JNIEnv* env, jobject object, jobject locationObject) { static void InjectLocation(JNIEnv* env, jobject /* object */, jobject locationObject) {
if(locationObject == NULL) { if(locationObject == NULL) {
ALOGE("Invalid location for injection: %p", locationObject); ALOGE("Invalid location for injection: %p", locationObject);
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
@ -800,7 +800,7 @@ static jboolean IsDiagnosticSupported() {
return sFlpDiagnosticInterface != NULL; return sFlpDiagnosticInterface != NULL;
} }
static void InjectDiagnosticData(JNIEnv* env, jobject object, jstring stringData) { static void InjectDiagnosticData(JNIEnv* env, jobject /* object */, jstring stringData) {
if(stringData == NULL) { if(stringData == NULL) {
ALOGE("Invalid diagnostic data for injection: %p", stringData); ALOGE("Invalid diagnostic data for injection: %p", stringData);
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
@ -824,7 +824,7 @@ static jboolean IsDeviceContextSupported() {
return sFlpDeviceContextInterface != NULL; return sFlpDeviceContextInterface != NULL;
} }
static void InjectDeviceContext(JNIEnv* env, jobject object, jint enabledMask) { static void InjectDeviceContext(JNIEnv* env, jobject /* object */, jint enabledMask) {
if(sFlpDeviceContextInterface == NULL) { if(sFlpDeviceContextInterface == NULL) {
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
} }
@ -839,7 +839,7 @@ static jboolean IsGeofencingSupported() {
static void AddGeofences( static void AddGeofences(
JNIEnv* env, JNIEnv* env,
jobject object, jobject /* object */,
jobjectArray geofenceRequestsArray) { jobjectArray geofenceRequestsArray) {
if(geofenceRequestsArray == NULL) { if(geofenceRequestsArray == NULL) {
ALOGE("Invalid Geofences to add: %p", geofenceRequestsArray); ALOGE("Invalid Geofences to add: %p", geofenceRequestsArray);
@ -879,7 +879,7 @@ static void AddGeofences(
} }
} }
static void PauseGeofence(JNIEnv* env, jobject object, jint geofenceId) { static void PauseGeofence(JNIEnv* env, jobject /* object */, jint geofenceId) {
if(sFlpGeofencingInterface == NULL) { if(sFlpGeofencingInterface == NULL) {
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
} }
@ -889,7 +889,7 @@ static void PauseGeofence(JNIEnv* env, jobject object, jint geofenceId) {
static void ResumeGeofence( static void ResumeGeofence(
JNIEnv* env, JNIEnv* env,
jobject object, jobject /* object */,
jint geofenceId, jint geofenceId,
jint monitorTransitions) { jint monitorTransitions) {
if(sFlpGeofencingInterface == NULL) { if(sFlpGeofencingInterface == NULL) {
@ -901,7 +901,7 @@ static void ResumeGeofence(
static void ModifyGeofenceOption( static void ModifyGeofenceOption(
JNIEnv* env, JNIEnv* env,
jobject object, jobject /* object */,
jint geofenceId, jint geofenceId,
jint lastTransition, jint lastTransition,
jint monitorTransitions, jint monitorTransitions,
@ -925,7 +925,7 @@ static void ModifyGeofenceOption(
static void RemoveGeofences( static void RemoveGeofences(
JNIEnv* env, JNIEnv* env,
jobject object, jobject /* object */,
jintArray geofenceIdsArray) { jintArray geofenceIdsArray) {
if(sFlpGeofencingInterface == NULL) { if(sFlpGeofencingInterface == NULL) {
ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);

View File

@ -386,7 +386,8 @@ static void android_location_GpsLocationProvider_class_init_native(JNIEnv* env,
} }
} }
static jboolean android_location_GpsLocationProvider_is_supported(JNIEnv* env, jclass clazz) { static jboolean android_location_GpsLocationProvider_is_supported(JNIEnv* /* env */,
jclass /* clazz */) {
if (sGpsInterface != NULL) { if (sGpsInterface != NULL) {
return JNI_TRUE; return JNI_TRUE;
} else { } else {
@ -420,14 +421,15 @@ static jboolean android_location_GpsLocationProvider_init(JNIEnv* env, jobject o
return JNI_TRUE; return JNI_TRUE;
} }
static void android_location_GpsLocationProvider_cleanup(JNIEnv* env, jobject obj) static void android_location_GpsLocationProvider_cleanup(JNIEnv* /* env */, jobject /* obj */)
{ {
if (sGpsInterface) if (sGpsInterface)
sGpsInterface->cleanup(); sGpsInterface->cleanup();
} }
static jboolean android_location_GpsLocationProvider_set_position_mode(JNIEnv* env, jobject obj, static jboolean android_location_GpsLocationProvider_set_position_mode(JNIEnv* /* env */,
jint mode, jint recurrence, jint min_interval, jint preferred_accuracy, jint preferred_time) jobject /* obj */, jint mode, jint recurrence, jint min_interval, jint preferred_accuracy,
jint preferred_time)
{ {
if (sGpsInterface) { if (sGpsInterface) {
if (sGpsInterface->set_position_mode(mode, recurrence, min_interval, preferred_accuracy, if (sGpsInterface->set_position_mode(mode, recurrence, min_interval, preferred_accuracy,
@ -441,7 +443,7 @@ static jboolean android_location_GpsLocationProvider_set_position_mode(JNIEnv* e
return JNI_FALSE; return JNI_FALSE;
} }
static jboolean android_location_GpsLocationProvider_start(JNIEnv* env, jobject obj) static jboolean android_location_GpsLocationProvider_start(JNIEnv* /* env */, jobject /* obj */)
{ {
if (sGpsInterface) { if (sGpsInterface) {
if (sGpsInterface->start() == 0) { if (sGpsInterface->start() == 0) {
@ -454,7 +456,7 @@ static jboolean android_location_GpsLocationProvider_start(JNIEnv* env, jobject
return JNI_FALSE; return JNI_FALSE;
} }
static jboolean android_location_GpsLocationProvider_stop(JNIEnv* env, jobject obj) static jboolean android_location_GpsLocationProvider_stop(JNIEnv* /* env */, jobject /* obj */)
{ {
if (sGpsInterface) { if (sGpsInterface) {
if (sGpsInterface->stop() == 0) { if (sGpsInterface->stop() == 0) {
@ -467,13 +469,15 @@ static jboolean android_location_GpsLocationProvider_stop(JNIEnv* env, jobject o
return JNI_FALSE; return JNI_FALSE;
} }
static void android_location_GpsLocationProvider_delete_aiding_data(JNIEnv* env, jobject obj, jint flags) static void android_location_GpsLocationProvider_delete_aiding_data(JNIEnv* /* env */,
jobject /* obj */,
jint flags)
{ {
if (sGpsInterface) if (sGpsInterface)
sGpsInterface->delete_aiding_data(flags); sGpsInterface->delete_aiding_data(flags);
} }
static jint android_location_GpsLocationProvider_read_sv_status(JNIEnv* env, jobject obj, static jint android_location_GpsLocationProvider_read_sv_status(JNIEnv* env, jobject /* obj */,
jintArray prnArray, jfloatArray snrArray, jfloatArray elevArray, jfloatArray azumArray, jintArray prnArray, jfloatArray snrArray, jfloatArray elevArray, jfloatArray azumArray,
jintArray maskArray) jintArray maskArray)
{ {
@ -504,8 +508,8 @@ static jint android_location_GpsLocationProvider_read_sv_status(JNIEnv* env, job
return (jint) num_svs; return (jint) num_svs;
} }
static void android_location_GpsLocationProvider_agps_set_reference_location_cellid(JNIEnv* env, static void android_location_GpsLocationProvider_agps_set_reference_location_cellid(
jobject obj, jint type, jint mcc, jint mnc, jint lac, jint cid) JNIEnv* /* env */, jobject /* obj */, jint type, jint mcc, jint mnc, jint lac, jint cid)
{ {
AGpsRefLocation location; AGpsRefLocation location;
@ -532,7 +536,7 @@ static void android_location_GpsLocationProvider_agps_set_reference_location_cel
} }
static void android_location_GpsLocationProvider_agps_send_ni_message(JNIEnv* env, static void android_location_GpsLocationProvider_agps_send_ni_message(JNIEnv* env,
jobject obj, jbyteArray ni_msg, jint size) jobject /* obj */, jbyteArray ni_msg, jint size)
{ {
size_t sz; size_t sz;
@ -548,8 +552,8 @@ static void android_location_GpsLocationProvider_agps_send_ni_message(JNIEnv* en
env->ReleaseByteArrayElements(ni_msg,b,0); env->ReleaseByteArrayElements(ni_msg,b,0);
} }
static void android_location_GpsLocationProvider_agps_set_id(JNIEnv *env, static void android_location_GpsLocationProvider_agps_set_id(JNIEnv *env, jobject /* obj */,
jobject obj, jint type, jstring setid_string) jint type, jstring setid_string)
{ {
if (!sAGpsRilInterface) { if (!sAGpsRilInterface) {
ALOGE("no AGPS RIL interface in agps_set_id"); ALOGE("no AGPS RIL interface in agps_set_id");
@ -561,7 +565,7 @@ static void android_location_GpsLocationProvider_agps_set_id(JNIEnv *env,
env->ReleaseStringUTFChars(setid_string, setid); env->ReleaseStringUTFChars(setid_string, setid);
} }
static jint android_location_GpsLocationProvider_read_nmea(JNIEnv* env, jobject obj, static jint android_location_GpsLocationProvider_read_nmea(JNIEnv* env, jobject /* obj */,
jbyteArray nmeaArray, jint buffer_size) jbyteArray nmeaArray, jint buffer_size)
{ {
// this should only be called from within a call to reportNmea // this should only be called from within a call to reportNmea
@ -574,21 +578,22 @@ static jint android_location_GpsLocationProvider_read_nmea(JNIEnv* env, jobject
return (jint) length; return (jint) length;
} }
static void android_location_GpsLocationProvider_inject_time(JNIEnv* env, jobject obj, static void android_location_GpsLocationProvider_inject_time(JNIEnv* /* env */, jobject /* obj */,
jlong time, jlong timeReference, jint uncertainty) jlong time, jlong timeReference, jint uncertainty)
{ {
if (sGpsInterface) if (sGpsInterface)
sGpsInterface->inject_time(time, timeReference, uncertainty); sGpsInterface->inject_time(time, timeReference, uncertainty);
} }
static void android_location_GpsLocationProvider_inject_location(JNIEnv* env, jobject obj, static void android_location_GpsLocationProvider_inject_location(JNIEnv* /* env */,
jdouble latitude, jdouble longitude, jfloat accuracy) jobject /* obj */, jdouble latitude, jdouble longitude, jfloat accuracy)
{ {
if (sGpsInterface) if (sGpsInterface)
sGpsInterface->inject_location(latitude, longitude, accuracy); sGpsInterface->inject_location(latitude, longitude, accuracy);
} }
static jboolean android_location_GpsLocationProvider_supports_xtra(JNIEnv* env, jobject obj) static jboolean android_location_GpsLocationProvider_supports_xtra(JNIEnv* /* env */,
jobject /* obj */)
{ {
if (sGpsXtraInterface != NULL) { if (sGpsXtraInterface != NULL) {
return JNI_TRUE; return JNI_TRUE;
@ -597,7 +602,7 @@ static jboolean android_location_GpsLocationProvider_supports_xtra(JNIEnv* env,
} }
} }
static void android_location_GpsLocationProvider_inject_xtra_data(JNIEnv* env, jobject obj, static void android_location_GpsLocationProvider_inject_xtra_data(JNIEnv* env, jobject /* obj */,
jbyteArray data, jint length) jbyteArray data, jint length)
{ {
if (!sGpsXtraInterface) { if (!sGpsXtraInterface) {
@ -610,7 +615,8 @@ static void android_location_GpsLocationProvider_inject_xtra_data(JNIEnv* env, j
env->ReleasePrimitiveArrayCritical(data, bytes, JNI_ABORT); env->ReleasePrimitiveArrayCritical(data, bytes, JNI_ABORT);
} }
static void android_location_GpsLocationProvider_agps_data_conn_open(JNIEnv* env, jobject obj, jstring apn) static void android_location_GpsLocationProvider_agps_data_conn_open(JNIEnv* env,
jobject /* obj */, jstring apn)
{ {
if (!sAGpsInterface) { if (!sAGpsInterface) {
ALOGE("no AGPS interface in agps_data_conn_open"); ALOGE("no AGPS interface in agps_data_conn_open");
@ -625,7 +631,8 @@ static void android_location_GpsLocationProvider_agps_data_conn_open(JNIEnv* env
env->ReleaseStringUTFChars(apn, apnStr); env->ReleaseStringUTFChars(apn, apnStr);
} }
static void android_location_GpsLocationProvider_agps_data_conn_closed(JNIEnv* env, jobject obj) static void android_location_GpsLocationProvider_agps_data_conn_closed(JNIEnv* /* env */,
jobject /* obj */)
{ {
if (!sAGpsInterface) { if (!sAGpsInterface) {
ALOGE("no AGPS interface in agps_data_conn_closed"); ALOGE("no AGPS interface in agps_data_conn_closed");
@ -634,7 +641,8 @@ static void android_location_GpsLocationProvider_agps_data_conn_closed(JNIEnv* e
sAGpsInterface->data_conn_closed(); sAGpsInterface->data_conn_closed();
} }
static void android_location_GpsLocationProvider_agps_data_conn_failed(JNIEnv* env, jobject obj) static void android_location_GpsLocationProvider_agps_data_conn_failed(JNIEnv* /* env */,
jobject /* obj */)
{ {
if (!sAGpsInterface) { if (!sAGpsInterface) {
ALOGE("no AGPS interface in agps_data_conn_failed"); ALOGE("no AGPS interface in agps_data_conn_failed");
@ -643,7 +651,7 @@ static void android_location_GpsLocationProvider_agps_data_conn_failed(JNIEnv* e
sAGpsInterface->data_conn_failed(); sAGpsInterface->data_conn_failed();
} }
static void android_location_GpsLocationProvider_set_agps_server(JNIEnv* env, jobject obj, static void android_location_GpsLocationProvider_set_agps_server(JNIEnv* env, jobject /* obj */,
jint type, jstring hostname, jint port) jint type, jstring hostname, jint port)
{ {
if (!sAGpsInterface) { if (!sAGpsInterface) {
@ -655,8 +663,8 @@ static void android_location_GpsLocationProvider_set_agps_server(JNIEnv* env, jo
env->ReleaseStringUTFChars(hostname, c_hostname); env->ReleaseStringUTFChars(hostname, c_hostname);
} }
static void android_location_GpsLocationProvider_send_ni_response(JNIEnv* env, jobject obj, static void android_location_GpsLocationProvider_send_ni_response(JNIEnv* /* env */,
jint notifId, jint response) jobject /* obj */, jint notifId, jint response)
{ {
if (!sGpsNiInterface) { if (!sGpsNiInterface) {
ALOGE("no NI interface in send_ni_response"); ALOGE("no NI interface in send_ni_response");
@ -666,8 +674,8 @@ static void android_location_GpsLocationProvider_send_ni_response(JNIEnv* env, j
sGpsNiInterface->respond(notifId, response); sGpsNiInterface->respond(notifId, response);
} }
static jstring android_location_GpsLocationProvider_get_internal_state(JNIEnv* env, jobject obj) static jstring android_location_GpsLocationProvider_get_internal_state(JNIEnv* env,
{ jobject /* obj */) {
jstring result = NULL; jstring result = NULL;
if (sGpsDebugInterface) { if (sGpsDebugInterface) {
const size_t maxLength = 2047; const size_t maxLength = 2047;
@ -680,7 +688,7 @@ static jstring android_location_GpsLocationProvider_get_internal_state(JNIEnv* e
return result; return result;
} }
static void android_location_GpsLocationProvider_update_network_state(JNIEnv* env, jobject obj, static void android_location_GpsLocationProvider_update_network_state(JNIEnv* env, jobject /* obj */,
jboolean connected, jint type, jboolean roaming, jboolean available, jstring extraInfo, jstring apn) jboolean connected, jint type, jboolean roaming, jboolean available, jstring extraInfo, jstring apn)
{ {
@ -703,16 +711,17 @@ static void android_location_GpsLocationProvider_update_network_state(JNIEnv* en
} }
} }
static jboolean android_location_GpsLocationProvider_is_geofence_supported(JNIEnv* env, static jboolean android_location_GpsLocationProvider_is_geofence_supported(JNIEnv* /* env */,
jobject obj) { jobject /* obj */)
{
if (sGpsGeofencingInterface != NULL) { if (sGpsGeofencingInterface != NULL) {
return JNI_TRUE; return JNI_TRUE;
} }
return JNI_FALSE; return JNI_FALSE;
} }
static jboolean android_location_GpsLocationProvider_add_geofence(JNIEnv* env, jobject obj, static jboolean android_location_GpsLocationProvider_add_geofence(JNIEnv* /* env */,
jint geofence_id, jdouble latitude, jdouble longitude, jdouble radius, jobject /* obj */, jint geofence_id, jdouble latitude, jdouble longitude, jdouble radius,
jint last_transition, jint monitor_transition, jint notification_responsiveness, jint last_transition, jint monitor_transition, jint notification_responsiveness,
jint unknown_timer) { jint unknown_timer) {
if (sGpsGeofencingInterface != NULL) { if (sGpsGeofencingInterface != NULL) {
@ -726,8 +735,8 @@ static jboolean android_location_GpsLocationProvider_add_geofence(JNIEnv* env, j
return JNI_FALSE; return JNI_FALSE;
} }
static jboolean android_location_GpsLocationProvider_remove_geofence(JNIEnv* env, jobject obj, static jboolean android_location_GpsLocationProvider_remove_geofence(JNIEnv* /* env */,
jint geofence_id) { jobject /* obj */, jint geofence_id) {
if (sGpsGeofencingInterface != NULL) { if (sGpsGeofencingInterface != NULL) {
sGpsGeofencingInterface->remove_geofence_area(geofence_id); sGpsGeofencingInterface->remove_geofence_area(geofence_id);
return JNI_TRUE; return JNI_TRUE;
@ -737,8 +746,8 @@ static jboolean android_location_GpsLocationProvider_remove_geofence(JNIEnv* env
return JNI_FALSE; return JNI_FALSE;
} }
static jboolean android_location_GpsLocationProvider_pause_geofence(JNIEnv* env, jobject obj, static jboolean android_location_GpsLocationProvider_pause_geofence(JNIEnv* /* env */,
jint geofence_id) { jobject /* obj */, jint geofence_id) {
if (sGpsGeofencingInterface != NULL) { if (sGpsGeofencingInterface != NULL) {
sGpsGeofencingInterface->pause_geofence(geofence_id); sGpsGeofencingInterface->pause_geofence(geofence_id);
return JNI_TRUE; return JNI_TRUE;
@ -748,8 +757,8 @@ static jboolean android_location_GpsLocationProvider_pause_geofence(JNIEnv* env,
return JNI_FALSE; return JNI_FALSE;
} }
static jboolean android_location_GpsLocationProvider_resume_geofence(JNIEnv* env, jobject obj, static jboolean android_location_GpsLocationProvider_resume_geofence(JNIEnv* /* env */,
jint geofence_id, jint monitor_transition) { jobject /* obj */, jint geofence_id, jint monitor_transition) {
if (sGpsGeofencingInterface != NULL) { if (sGpsGeofencingInterface != NULL) {
sGpsGeofencingInterface->resume_geofence(geofence_id, monitor_transition); sGpsGeofencingInterface->resume_geofence(geofence_id, monitor_transition);
return JNI_TRUE; return JNI_TRUE;

View File

@ -150,24 +150,24 @@ static void nativeInit(JNIEnv* env, jobject obj) {
} }
} }
static void nativeSetPowerState(JNIEnv* env, static void nativeSetPowerState(JNIEnv* /* env */,
jclass clazz, jboolean screenOn, jboolean screenBright) { jclass /* clazz */, jboolean screenOn, jboolean screenBright) {
AutoMutex _l(gPowerManagerLock); AutoMutex _l(gPowerManagerLock);
gScreenOn = screenOn; gScreenOn = screenOn;
gScreenBright = screenBright; gScreenBright = screenBright;
} }
static void nativeAcquireSuspendBlocker(JNIEnv *env, jclass clazz, jstring nameStr) { static void nativeAcquireSuspendBlocker(JNIEnv *env, jclass /* clazz */, jstring nameStr) {
ScopedUtfChars name(env, nameStr); ScopedUtfChars name(env, nameStr);
acquire_wake_lock(PARTIAL_WAKE_LOCK, name.c_str()); acquire_wake_lock(PARTIAL_WAKE_LOCK, name.c_str());
} }
static void nativeReleaseSuspendBlocker(JNIEnv *env, jclass clazz, jstring nameStr) { static void nativeReleaseSuspendBlocker(JNIEnv *env, jclass /* clazz */, jstring nameStr) {
ScopedUtfChars name(env, nameStr); ScopedUtfChars name(env, nameStr);
release_wake_lock(name.c_str()); release_wake_lock(name.c_str());
} }
static void nativeSetInteractive(JNIEnv *env, jclass clazz, jboolean enable) { static void nativeSetInteractive(JNIEnv* /* env */, jclass /* clazz */, jboolean enable) {
if (gPowerModule) { if (gPowerModule) {
if (enable) { if (enable) {
ALOGD_IF_SLOW(20, "Excessive delay in setInteractive(true) while turning screen on"); ALOGD_IF_SLOW(20, "Excessive delay in setInteractive(true) while turning screen on");
@ -179,7 +179,7 @@ static void nativeSetInteractive(JNIEnv *env, jclass clazz, jboolean enable) {
} }
} }
static void nativeSetAutoSuspend(JNIEnv *env, jclass clazz, jboolean enable) { static void nativeSetAutoSuspend(JNIEnv* /* env */, jclass /* clazz */, jboolean enable) {
if (enable) { if (enable) {
ALOGD_IF_SLOW(100, "Excessive delay in autosuspend_enable() while turning screen off"); ALOGD_IF_SLOW(100, "Excessive delay in autosuspend_enable() while turning screen off");
autosuspend_enable(); autosuspend_enable();

View File

@ -40,7 +40,7 @@ int register_android_server_AssetAtlasService(JNIEnv* env);
using namespace android; using namespace android;
extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
{ {
JNIEnv* env = NULL; JNIEnv* env = NULL;
jint result = -1; jint result = -1;