From 9d7ff99a07daaf9af89b87ceb2e5232a33968ab0 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Thu, 30 Jul 2020 23:47:48 +0000 Subject: [PATCH] Update language to comply with Android's inclusive language guidance See https://source.android.com/setup/contribute/respectful-code for reference Bug: 162536543 Test: Treehugger Change-Id: I971050a2665c177870ff257bd0f41343db702892 --- core/jni/android_media_AudioSystem.cpp | 2 +- core/jni/android_net_NetUtils.cpp | 6 +++--- core/jni/android_os_Debug.cpp | 2 +- core/jni/android_os_Parcel.cpp | 2 +- core/jni/android_util_Binder.cpp | 2 +- core/jni/android_view_InputQueue.cpp | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp index 22bb2102a6e1a..1f625443c96eb 100644 --- a/core/jni/android_media_AudioSystem.cpp +++ b/core/jni/android_media_AudioSystem.cpp @@ -974,7 +974,7 @@ static jint convertAudioPortConfigFromNative(JNIEnv *env, if (jHandle == NULL) { return (jint)AUDIO_JAVA_ERROR; } - // create dummy port and port config objects with just the correct handle + // create placeholder port and port config objects with just the correct handle // and configuration data. The actual AudioPortConfig objects will be // constructed by java code with correct class type (device, mix etc...) // and reference to AudioPort instance in this client diff --git a/core/jni/android_net_NetUtils.cpp b/core/jni/android_net_NetUtils.cpp index e56809f66dc71..8d4c4e5311f8e 100644 --- a/core/jni/android_net_NetUtils.cpp +++ b/core/jni/android_net_NetUtils.cpp @@ -93,13 +93,13 @@ static void android_net_utils_attachDropAllBPFFilter(JNIEnv *env, jobject clazz, static void android_net_utils_detachBPFFilter(JNIEnv *env, jobject clazz, jobject javaFd) { - int dummy = 0; + int optval_ignored = 0; int fd = jniGetFDFromFileDescriptor(env, javaFd); - if (setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, &dummy, sizeof(dummy)) != 0) { + if (setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, &optval_ignored, sizeof(optval_ignored)) != + 0) { jniThrowExceptionFmt(env, "java/net/SocketException", "setsockopt(SO_DETACH_FILTER): %s", strerror(errno)); } - } static jboolean android_net_utils_bindProcessToNetwork(JNIEnv *env, jobject thiz, jint netId) diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index d6e8531fa6cac..ef0eeec2c7af0 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -920,7 +920,7 @@ int register_android_os_Debug(JNIEnv *env) { jclass clazz = env->FindClass("android/os/Debug$MemoryInfo"); - // Sanity check the number of other statistics expected in Java matches here. + // Check the number of other statistics expected in Java matches here. jfieldID numOtherStats_field = env->GetStaticFieldID(clazz, "NUM_OTHER_STATS", "I"); jint numOtherStats = env->GetStaticIntField(clazz, numOtherStats_field); jfieldID numDvkStats_field = env->GetStaticFieldID(clazz, "NUM_DVK_STATS", "I"); diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp index 6ec5bce224fca..9ae3d160be981 100644 --- a/core/jni/android_os_Parcel.cpp +++ b/core/jni/android_os_Parcel.cpp @@ -349,7 +349,7 @@ static jbyteArray android_os_Parcel_createByteArray(JNIEnv* env, jclass clazz, j if (parcel != NULL) { int32_t len = parcel->readInt32(); - // sanity check the stored length against the true data size + // Validate the stored length against the true data size if (len >= 0 && len <= (int32_t)parcel->dataAvail()) { ret = env->NewByteArray(len); diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp index 4c9d7abeb5a1a..9643b64c68f85 100644 --- a/core/jni/android_util_Binder.cpp +++ b/core/jni/android_util_Binder.cpp @@ -961,7 +961,7 @@ static jlong android_os_Binder_clearCallingIdentity() static void android_os_Binder_restoreCallingIdentity(JNIEnv* env, jobject clazz, jlong token) { - // XXX temporary sanity check to debug crashes. + // XXX temporary validation check to debug crashes. int uid = (int)(token>>32); if (uid > 0 && uid < 999) { // In Android currently there are no uids in this range. diff --git a/core/jni/android_view_InputQueue.cpp b/core/jni/android_view_InputQueue.cpp index 24c3ff80badd1..70a9be740810b 100644 --- a/core/jni/android_view_InputQueue.cpp +++ b/core/jni/android_view_InputQueue.cpp @@ -176,8 +176,8 @@ void InputQueue::enqueueEvent(InputEvent* event) { Mutex::Autolock _l(mLock); mPendingEvents.push(event); if (mPendingEvents.size() == 1) { - char dummy = 0; - int res = TEMP_FAILURE_RETRY(write(mDispatchWriteFd, &dummy, sizeof(dummy))); + char payload = '\0'; + int res = TEMP_FAILURE_RETRY(write(mDispatchWriteFd, &payload, sizeof(payload))); if (res < 0 && errno != EAGAIN) { ALOGW("Failed writing to dispatch fd: %s", strerror(errno)); }