diff options
author | Andreas Gampe <agampe@google.com> | 2014-09-24 21:39:34 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-09-25 11:45:07 -0700 |
commit | 26872f4b9e634d77ecd78e4eee9d5d070f8553f8 (patch) | |
tree | d2b5f0bdc63b29d017167db77e352a665695034b | |
parent | fa4362982c4e5d07c158c470f957f6ffd2fc7cc9 (diff) | |
download | base-26872f4b9e634d77ecd78e4eee9d5d070f8553f8.tar.gz |
Frameworks/base: Fix services/jni warnings
Update code for unused variables.
Ignore warnings generated by pulling in Skia.
Change-Id: I5b33c9b003c90bcabcea0761304c4c99cf5e39ec
15 files changed, 137 insertions, 121 deletions
diff --git a/services/jni/Android.mk b/services/jni/Android.mk index 83fe910321d5..36107f88a35c 100644 --- a/services/jni/Android.mk +++ b/services/jni/Android.mk @@ -52,7 +52,7 @@ LOCAL_SHARED_LIBRARIES := \ libEGL \ libGLESv2 -LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES +LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -Wall -Werror LOCAL_MODULE:= libandroid_servers diff --git a/services/jni/com_android_server_AssetAtlasService.cpp b/services/jni/com_android_server_AssetAtlasService.cpp index 163692bb33fe..883df9b91c0b 100644 --- a/services/jni/com_android_server_AssetAtlasService.cpp +++ b/services/jni/com_android_server_AssetAtlasService.cpp @@ -28,8 +28,12 @@ #include <EGL/egl.h> #include <EGL/eglext.h> +// Disable warnings for Skia. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include <SkCanvas.h> #include <SkBitmap.h> +#pragma GCC diagnostic pop namespace android { diff --git a/services/jni/com_android_server_ConsumerIrService.cpp b/services/jni/com_android_server_ConsumerIrService.cpp index 3a50ff7a885d..f5121cdf5580 100644 --- a/services/jni/com_android_server_ConsumerIrService.cpp +++ b/services/jni/com_android_server_ConsumerIrService.cpp @@ -29,7 +29,7 @@ namespace android { -static jlong halOpen(JNIEnv *env, jobject obj) { +static jlong halOpen(JNIEnv* /* env */, jobject /* obj */) { hw_module_t const* module; consumerir_device_t *dev; int err; @@ -50,7 +50,7 @@ static jlong halOpen(JNIEnv *env, jobject obj) { 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) { int ret; @@ -66,7 +66,7 @@ static jint halTransmit(JNIEnv *env, jobject obj, jlong halObject, return reinterpret_cast<jint>(ret); } -static jintArray halGetCarrierFrequencies(JNIEnv *env, jobject obj, +static jintArray halGetCarrierFrequencies(JNIEnv *env, jobject /* obj */, jlong halObject) { consumerir_device_t *dev = reinterpret_cast<consumerir_device_t*>(halObject); consumerir_freq_range_t *ranges; diff --git a/services/jni/com_android_server_LightsService.cpp b/services/jni/com_android_server_LightsService.cpp index 69793f7c1af9..572b32415ccb 100644 --- a/services/jni/com_android_server_LightsService.cpp +++ b/services/jni/com_android_server_LightsService.cpp @@ -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; hw_module_t* module; @@ -93,7 +93,7 @@ static jlong init_native(JNIEnv *env, jobject clazz) 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; if (devices == NULL) { @@ -103,7 +103,7 @@ static void finalize_native(JNIEnv *env, jobject clazz, jlong ptr) 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) { Devices* devices = (Devices*)ptr; diff --git a/services/jni/com_android_server_SerialService.cpp b/services/jni/com_android_server_SerialService.cpp index b889b78cc1f9..d48d159b1178 100644 --- a/services/jni/com_android_server_SerialService.cpp +++ b/services/jni/com_android_server_SerialService.cpp @@ -34,7 +34,7 @@ static struct parcel_file_descriptor_offsets_t jmethodID mConstructor; } 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); diff --git a/services/jni/com_android_server_SystemServer.cpp b/services/jni/com_android_server_SystemServer.cpp index 0625544effdc..c50d63c58dd6 100644 --- a/services/jni/com_android_server_SystemServer.cpp +++ b/services/jni/com_android_server_SystemServer.cpp @@ -25,7 +25,7 @@ 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]; property_get("system_init.startsensorservice", propBuf, "1"); if (strcmp(propBuf, "1") == 0) { diff --git a/services/jni/com_android_server_UsbDeviceManager.cpp b/services/jni/com_android_server_UsbDeviceManager.cpp index 355173384892..8d1a3383fdb5 100644 --- a/services/jni/com_android_server_UsbDeviceManager.cpp +++ b/services/jni/com_android_server_UsbDeviceManager.cpp @@ -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); if (fd < 0) { @@ -85,7 +86,7 @@ out: 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); if (fd < 0) { @@ -100,7 +101,8 @@ static jobject android_server_UsbDeviceManager_openAccessory(JNIEnv *env, jobjec 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); if (fd < 0) { @@ -112,7 +114,7 @@ static jboolean android_server_UsbDeviceManager_isStartRequested(JNIEnv *env, jo 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); if (fd < 0) { diff --git a/services/jni/com_android_server_UsbHostManager.cpp b/services/jni/com_android_server_UsbHostManager.cpp index fc6de60dbf5e..e5ee35031098 100644 --- a/services/jni/com_android_server_UsbHostManager.cpp +++ b/services/jni/com_android_server_UsbHostManager.cpp @@ -142,7 +142,7 @@ static int usb_device_removed(const char *devname, void* client_data) { 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(); 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); } -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); struct usb_device* device = usb_device_open(deviceNameStr); diff --git a/services/jni/com_android_server_VibratorService.cpp b/services/jni/com_android_server_VibratorService.cpp index 2b3f74a97184..fb1166b41d41 100644 --- a/services/jni/com_android_server_VibratorService.cpp +++ b/services/jni/com_android_server_VibratorService.cpp @@ -29,18 +29,18 @@ namespace android { -static jboolean vibratorExists(JNIEnv *env, jobject clazz) +static jboolean vibratorExists(JNIEnv* /* env */, jobject /* clazz */) { 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"); vibrator_on(timeout_ms); } -static void vibratorOff(JNIEnv *env, jobject clazz) +static void vibratorOff(JNIEnv* /* env */, jobject /* clazz */) { // ALOGI("vibratorOff\n"); vibrator_off(); diff --git a/services/jni/com_android_server_connectivity_Vpn.cpp b/services/jni/com_android_server_connectivity_Vpn.cpp index bf34a748061d..376d01ba8875 100644 --- a/services/jni/com_android_server_connectivity_Vpn.cpp +++ b/services/jni/com_android_server_connectivity_Vpn.cpp @@ -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); if (tun < 0) { @@ -323,7 +323,7 @@ static jint create(JNIEnv *env, jobject thiz, jint mtu) return tun; } -static jstring getName(JNIEnv *env, jobject thiz, jint tun) +static jstring getName(JNIEnv *env, jobject /* thiz */, jint tun) { char name[IFNAMSIZ]; if (get_interface_name(name, tun) < 0) { @@ -333,7 +333,7 @@ static jstring getName(JNIEnv *env, jobject thiz, jint tun) return env->NewStringUTF(name); } -static jint setAddresses(JNIEnv *env, jobject thiz, jstring jName, +static jint setAddresses(JNIEnv *env, jobject /* thiz */, jstring jName, jstring jAddresses) { const char *name = NULL; @@ -366,7 +366,7 @@ error: return count; } -static jint setRoutes(JNIEnv *env, jobject thiz, jstring jName, +static jint setRoutes(JNIEnv *env, jobject /* thiz */, jstring jName, jstring jRoutes) { const char *name = NULL; @@ -399,7 +399,7 @@ error: 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; if (!name) { @@ -412,7 +412,7 @@ static void reset(JNIEnv *env, jobject thiz, jstring jName) 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; if (!name) { diff --git a/services/jni/com_android_server_input_InputManagerService.cpp b/services/jni/com_android_server_input_InputManagerService.cpp index 10ad278a8e10..facd8df6b478 100644 --- a/services/jni/com_android_server_input_InputManagerService.cpp +++ b/services/jni/com_android_server_input_InputManagerService.cpp @@ -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<InputWindowHandle>& inputWindowHandle, bool monitor) { return mInputManager->getDispatcher()->registerInputChannel( inputChannel, inputWindowHandle, monitor); } -status_t NativeInputManager::unregisterInputChannel(JNIEnv* env, +status_t NativeInputManager::unregisterInputChannel(JNIEnv* /* env */, const sp<InputChannel>& inputChannel) { return mInputManager->getDispatcher()->unregisterInputChannel(inputChannel); } @@ -413,7 +413,7 @@ void NativeInputManager::getReaderConfiguration(InputReaderConfiguration* outCon } // release lock } -sp<PointerControllerInterface> NativeInputManager::obtainPointerController(int32_t deviceId) { +sp<PointerControllerInterface> NativeInputManager::obtainPointerController(int32_t /* deviceId */) { AutoMutex _l(mLock); sp<PointerController> controller = mLocked.pointerController.promote(); @@ -530,7 +530,7 @@ String8 NativeInputManager::getDeviceAlias(const InputDeviceIdentifier& identifi } 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 ALOGD("notifySwitch - when=%lld, switchValues=0x%08x, switchMask=0x%08x, policyFlags=0x%x", 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) { sp<MessageQueue> messageQueue = android_os_MessageQueue_getMessageQueue(env, messageQueueObj); if (messageQueue == NULL) { @@ -991,7 +991,7 @@ static jlong nativeInit(JNIEnv* env, jclass clazz, 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); 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, - jint displayId, jint orientation, +static void nativeSetDisplayViewport(JNIEnv* /* env */, jclass /* clazz */, jlong ptr, + jboolean external, jint displayId, jint orientation, jint logicalLeft, jint logicalTop, jint logicalRight, jint logicalBottom, jint physicalLeft, jint physicalTop, jint physicalRight, jint physicalBottom, jint deviceWidth, jint deviceHeight) { @@ -1023,7 +1023,7 @@ static void nativeSetDisplayViewport(JNIEnv* env, jclass clazz, jlong ptr, jbool 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) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); @@ -1031,7 +1031,7 @@ static jint nativeGetScanCodeState(JNIEnv* env, jclass clazz, 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) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); @@ -1039,7 +1039,7 @@ static jint nativeGetKeyCodeState(JNIEnv* env, jclass clazz, 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) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); @@ -1047,7 +1047,7 @@ static jint nativeGetSwitchState(JNIEnv* env, jclass clazz, 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) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); @@ -1077,7 +1077,7 @@ static void throwInputChannelNotInitialized(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); 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); } -static void nativeRegisterInputChannel(JNIEnv* env, jclass clazz, +static void nativeRegisterInputChannel(JNIEnv* env, jclass /* clazz */, jlong ptr, jobject inputChannelObj, jobject inputWindowHandleObj, jboolean monitor) { 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) { 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) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); 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, jint syncMode, jint timeoutMillis, jint policyFlags) { 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) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->setInputWindows(env, windowHandleObjArray); } -static void nativeSetFocusedApplication(JNIEnv* env, jclass clazz, +static void nativeSetFocusedApplication(JNIEnv* env, jclass /* clazz */, jlong ptr, jobject applicationHandleObj) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->setFocusedApplication(env, applicationHandleObj); } -static void nativeSetInputDispatchMode(JNIEnv* env, - jclass clazz, jlong ptr, jboolean enabled, jboolean frozen) { +static void nativeSetInputDispatchMode(JNIEnv* /* env */, + jclass /* clazz */, jlong ptr, jboolean enabled, jboolean frozen) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->setInputDispatchMode(enabled, frozen); } -static void nativeSetSystemUiVisibility(JNIEnv* env, - jclass clazz, jlong ptr, jint visibility) { +static void nativeSetSystemUiVisibility(JNIEnv* /* env */, + jclass /* clazz */, jlong ptr, jint visibility) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->setSystemUiVisibility(visibility); } 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); sp<InputChannel> fromChannel = @@ -1223,22 +1223,22 @@ static jboolean nativeTransferTouchFocus(JNIEnv* env, } } -static void nativeSetPointerSpeed(JNIEnv* env, - jclass clazz, jlong ptr, jint speed) { +static void nativeSetPointerSpeed(JNIEnv* /* env */, + jclass /* clazz */, jlong ptr, jint speed) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->setPointerSpeed(speed); } -static void nativeSetShowTouches(JNIEnv* env, - jclass clazz, jlong ptr, jboolean enabled) { +static void nativeSetShowTouches(JNIEnv* /* env */, + jclass /* clazz */, jlong ptr, jboolean enabled) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->setShowTouches(enabled); } 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) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); @@ -1262,30 +1262,30 @@ static void nativeVibrate(JNIEnv* env, im->getInputManager()->getReader()->vibrate(deviceId, pattern, patternSize, repeat, token); } -static void nativeCancelVibrate(JNIEnv* env, - jclass clazz, jlong ptr, jint deviceId, jint token) { +static void nativeCancelVibrate(JNIEnv* /* env */, + jclass /* clazz */, jlong ptr, jint deviceId, jint token) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->getInputManager()->getReader()->cancelVibrate(deviceId, token); } -static void nativeReloadKeyboardLayouts(JNIEnv* env, - jclass clazz, jlong ptr) { +static void nativeReloadKeyboardLayouts(JNIEnv* /* env */, + jclass /* clazz */, jlong ptr) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->getInputManager()->getReader()->requestRefreshConfiguration( InputReaderConfiguration::CHANGE_KEYBOARD_LAYOUTS); } -static void nativeReloadDeviceAliases(JNIEnv* env, - jclass clazz, jlong ptr) { +static void nativeReloadDeviceAliases(JNIEnv* /* env */, + jclass /* clazz */, jlong ptr) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); im->getInputManager()->getReader()->requestRefreshConfiguration( 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); String8 dump; @@ -1293,7 +1293,7 @@ static jstring nativeDump(JNIEnv* env, jclass clazz, jlong ptr) { 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); im->getInputManager()->getReader()->monitor(); diff --git a/services/jni/com_android_server_location_FlpHardwareProvider.cpp b/services/jni/com_android_server_location_FlpHardwareProvider.cpp index 6c14887ef627..91bcf5d3a71c 100644 --- a/services/jni/com_android_server_location_FlpHardwareProvider.cpp +++ b/services/jni/com_android_server_location_FlpHardwareProvider.cpp @@ -695,11 +695,11 @@ static void Init(JNIEnv* env, jobject obj) { // 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; } -static jint GetBatchSize(JNIEnv* env, jobject object) { +static jint GetBatchSize(JNIEnv* env, jobject /* object */) { if(sFlpInterface == NULL) { ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); } @@ -709,7 +709,7 @@ static jint GetBatchSize(JNIEnv* env, jobject object) { static void StartBatching( JNIEnv* env, - jobject object, + jobject /* object */, jint id, jobject optionsObject) { if(sFlpInterface == NULL || optionsObject == NULL) { @@ -724,7 +724,7 @@ static void StartBatching( static void UpdateBatchingOptions( JNIEnv* env, - jobject object, + jobject /* object */, jint id, jobject optionsObject) { if(sFlpInterface == NULL || optionsObject == NULL) { @@ -737,7 +737,7 @@ static void UpdateBatchingOptions( 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) { ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); } @@ -745,7 +745,7 @@ static void StopBatching(JNIEnv* env, jobject object, jint id) { sFlpInterface->stop_batching(id); } -static void Cleanup(JNIEnv* env, jobject object) { +static void Cleanup(JNIEnv* env, jobject /* object */) { if(sFlpInterface == NULL) { 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) { ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); } @@ -776,7 +776,7 @@ static void GetBatchedLocation(JNIEnv* env, jobject object, jint 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) { ALOGE("Invalid location for injection: %p", locationObject); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); @@ -800,7 +800,7 @@ static jboolean IsDiagnosticSupported() { return sFlpDiagnosticInterface != NULL; } -static void InjectDiagnosticData(JNIEnv* env, jobject object, jstring stringData) { +static void InjectDiagnosticData(JNIEnv* env, jobject /* object */, jstring stringData) { if(stringData == NULL) { ALOGE("Invalid diagnostic data for injection: %p", stringData); ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); @@ -824,7 +824,7 @@ static jboolean IsDeviceContextSupported() { return sFlpDeviceContextInterface != NULL; } -static void InjectDeviceContext(JNIEnv* env, jobject object, jint enabledMask) { +static void InjectDeviceContext(JNIEnv* env, jobject /* object */, jint enabledMask) { if(sFlpDeviceContextInterface == NULL) { ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); } @@ -839,7 +839,7 @@ static jboolean IsGeofencingSupported() { static void AddGeofences( JNIEnv* env, - jobject object, + jobject /* object */, jobjectArray geofenceRequestsArray) { if(geofenceRequestsArray == NULL) { 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) { ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); } @@ -889,7 +889,7 @@ static void PauseGeofence(JNIEnv* env, jobject object, jint geofenceId) { static void ResumeGeofence( JNIEnv* env, - jobject object, + jobject /* object */, jint geofenceId, jint monitorTransitions) { if(sFlpGeofencingInterface == NULL) { @@ -901,7 +901,7 @@ static void ResumeGeofence( static void ModifyGeofenceOption( JNIEnv* env, - jobject object, + jobject /* object */, jint geofenceId, jint lastTransition, jint monitorTransitions, @@ -925,7 +925,7 @@ static void ModifyGeofenceOption( static void RemoveGeofences( JNIEnv* env, - jobject object, + jobject /* object */, jintArray geofenceIdsArray) { if(sFlpGeofencingInterface == NULL) { ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__); diff --git a/services/jni/com_android_server_location_GpsLocationProvider.cpp b/services/jni/com_android_server_location_GpsLocationProvider.cpp index e9ba116c26bf..1d3ec55e5aa8 100644 --- a/services/jni/com_android_server_location_GpsLocationProvider.cpp +++ b/services/jni/com_android_server_location_GpsLocationProvider.cpp @@ -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) { return JNI_TRUE; } else { @@ -420,14 +421,15 @@ static jboolean android_location_GpsLocationProvider_init(JNIEnv* env, jobject o 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) sGpsInterface->cleanup(); } -static jboolean android_location_GpsLocationProvider_set_position_mode(JNIEnv* env, jobject obj, - jint mode, jint recurrence, jint min_interval, jint preferred_accuracy, jint preferred_time) +static jboolean android_location_GpsLocationProvider_set_position_mode(JNIEnv* /* env */, + jobject /* obj */, jint mode, jint recurrence, jint min_interval, jint preferred_accuracy, + jint preferred_time) { if (sGpsInterface) { 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; } -static jboolean android_location_GpsLocationProvider_start(JNIEnv* env, jobject obj) +static jboolean android_location_GpsLocationProvider_start(JNIEnv* /* env */, jobject /* obj */) { if (sGpsInterface) { if (sGpsInterface->start() == 0) { @@ -454,7 +456,7 @@ static jboolean android_location_GpsLocationProvider_start(JNIEnv* env, jobject 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->stop() == 0) { @@ -467,13 +469,15 @@ static jboolean android_location_GpsLocationProvider_stop(JNIEnv* env, jobject o 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) 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 maskArray) { @@ -504,8 +508,8 @@ static jint android_location_GpsLocationProvider_read_sv_status(JNIEnv* env, job return (jint) num_svs; } -static void android_location_GpsLocationProvider_agps_set_reference_location_cellid(JNIEnv* env, - jobject obj, jint type, jint mcc, jint mnc, jint lac, jint cid) +static void android_location_GpsLocationProvider_agps_set_reference_location_cellid( + JNIEnv* /* env */, jobject /* obj */, jint type, jint mcc, jint mnc, jint lac, jint cid) { 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, - jobject obj, jbyteArray ni_msg, jint size) + jobject /* obj */, jbyteArray ni_msg, jint size) { size_t sz; @@ -548,8 +552,8 @@ static void android_location_GpsLocationProvider_agps_send_ni_message(JNIEnv* en env->ReleaseByteArrayElements(ni_msg,b,0); } -static void android_location_GpsLocationProvider_agps_set_id(JNIEnv *env, - jobject obj, jint type, jstring setid_string) +static void android_location_GpsLocationProvider_agps_set_id(JNIEnv *env, jobject /* obj */, + jint type, jstring setid_string) { if (!sAGpsRilInterface) { 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); } -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) { // 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; } -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) { if (sGpsInterface) sGpsInterface->inject_time(time, timeReference, uncertainty); } -static void android_location_GpsLocationProvider_inject_location(JNIEnv* env, jobject obj, - jdouble latitude, jdouble longitude, jfloat accuracy) +static void android_location_GpsLocationProvider_inject_location(JNIEnv* /* env */, + jobject /* obj */, jdouble latitude, jdouble longitude, jfloat accuracy) { if (sGpsInterface) 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) { 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) { if (!sGpsXtraInterface) { @@ -610,7 +615,8 @@ static void android_location_GpsLocationProvider_inject_xtra_data(JNIEnv* env, j 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) { 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); } -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) { 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(); } -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) { 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(); } -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) { if (!sAGpsInterface) { @@ -655,8 +663,8 @@ static void android_location_GpsLocationProvider_set_agps_server(JNIEnv* env, jo env->ReleaseStringUTFChars(hostname, c_hostname); } -static void android_location_GpsLocationProvider_send_ni_response(JNIEnv* env, jobject obj, - jint notifId, jint response) +static void android_location_GpsLocationProvider_send_ni_response(JNIEnv* /* env */, + jobject /* obj */, jint notifId, jint response) { if (!sGpsNiInterface) { 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); } -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; if (sGpsDebugInterface) { const size_t maxLength = 2047; @@ -680,7 +688,7 @@ static jstring android_location_GpsLocationProvider_get_internal_state(JNIEnv* e 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) { @@ -703,16 +711,17 @@ static void android_location_GpsLocationProvider_update_network_state(JNIEnv* en } } -static jboolean android_location_GpsLocationProvider_is_geofence_supported(JNIEnv* env, - jobject obj) { +static jboolean android_location_GpsLocationProvider_is_geofence_supported(JNIEnv* /* env */, + jobject /* obj */) +{ if (sGpsGeofencingInterface != NULL) { return JNI_TRUE; } return JNI_FALSE; } -static jboolean android_location_GpsLocationProvider_add_geofence(JNIEnv* env, jobject obj, - jint geofence_id, jdouble latitude, jdouble longitude, jdouble radius, +static jboolean android_location_GpsLocationProvider_add_geofence(JNIEnv* /* env */, + jobject /* obj */, jint geofence_id, jdouble latitude, jdouble longitude, jdouble radius, jint last_transition, jint monitor_transition, jint notification_responsiveness, jint unknown_timer) { if (sGpsGeofencingInterface != NULL) { @@ -726,8 +735,8 @@ static jboolean android_location_GpsLocationProvider_add_geofence(JNIEnv* env, j return JNI_FALSE; } -static jboolean android_location_GpsLocationProvider_remove_geofence(JNIEnv* env, jobject obj, - jint geofence_id) { +static jboolean android_location_GpsLocationProvider_remove_geofence(JNIEnv* /* env */, + jobject /* obj */, jint geofence_id) { if (sGpsGeofencingInterface != NULL) { sGpsGeofencingInterface->remove_geofence_area(geofence_id); return JNI_TRUE; @@ -737,8 +746,8 @@ static jboolean android_location_GpsLocationProvider_remove_geofence(JNIEnv* env return JNI_FALSE; } -static jboolean android_location_GpsLocationProvider_pause_geofence(JNIEnv* env, jobject obj, - jint geofence_id) { +static jboolean android_location_GpsLocationProvider_pause_geofence(JNIEnv* /* env */, + jobject /* obj */, jint geofence_id) { if (sGpsGeofencingInterface != NULL) { sGpsGeofencingInterface->pause_geofence(geofence_id); return JNI_TRUE; @@ -748,8 +757,8 @@ static jboolean android_location_GpsLocationProvider_pause_geofence(JNIEnv* env, return JNI_FALSE; } -static jboolean android_location_GpsLocationProvider_resume_geofence(JNIEnv* env, jobject obj, - jint geofence_id, jint monitor_transition) { +static jboolean android_location_GpsLocationProvider_resume_geofence(JNIEnv* /* env */, + jobject /* obj */, jint geofence_id, jint monitor_transition) { if (sGpsGeofencingInterface != NULL) { sGpsGeofencingInterface->resume_geofence(geofence_id, monitor_transition); return JNI_TRUE; diff --git a/services/jni/com_android_server_power_PowerManagerService.cpp b/services/jni/com_android_server_power_PowerManagerService.cpp index 151e134ee3ba..e5f29d9ebfdd 100644 --- a/services/jni/com_android_server_power_PowerManagerService.cpp +++ b/services/jni/com_android_server_power_PowerManagerService.cpp @@ -150,24 +150,24 @@ static void nativeInit(JNIEnv* env, jobject obj) { } } -static void nativeSetPowerState(JNIEnv* env, - jclass clazz, jboolean screenOn, jboolean screenBright) { +static void nativeSetPowerState(JNIEnv* /* env */, + jclass /* clazz */, jboolean screenOn, jboolean screenBright) { AutoMutex _l(gPowerManagerLock); gScreenOn = screenOn; gScreenBright = screenBright; } -static void nativeAcquireSuspendBlocker(JNIEnv *env, jclass clazz, jstring nameStr) { +static void nativeAcquireSuspendBlocker(JNIEnv *env, jclass /* clazz */, jstring nameStr) { ScopedUtfChars name(env, nameStr); 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); 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 (enable) { 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) { ALOGD_IF_SLOW(100, "Excessive delay in autosuspend_enable() while turning screen off"); autosuspend_enable(); diff --git a/services/jni/onload.cpp b/services/jni/onload.cpp index efc34a2aca41..68982a7055d8 100644 --- a/services/jni/onload.cpp +++ b/services/jni/onload.cpp @@ -40,7 +40,7 @@ int register_android_server_AssetAtlasService(JNIEnv* env); using namespace android; -extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) +extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */) { JNIEnv* env = NULL; jint result = -1; |