More native code cleanup.
Don't keep unused global references to classes, don't throw exceptions when an exception is already pending, and fix a (harmless) misunderstanding about how GetStringChars works. Change-Id: Ie445036f057daa8a1c76aceb7bad2a84fb81d820
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, The Android Open Source Project
|
* Copyright 2008, The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -225,9 +225,6 @@ static JNINativeMethod gNetworkUtilMethods[] = {
|
|||||||
|
|
||||||
int register_android_net_NetworkUtils(JNIEnv* env)
|
int register_android_net_NetworkUtils(JNIEnv* env)
|
||||||
{
|
{
|
||||||
jclass netutils = env->FindClass(NETUTILS_PKG_NAME);
|
|
||||||
LOG_FATAL_IF(netutils == NULL, "Unable to find class " NETUTILS_PKG_NAME);
|
|
||||||
|
|
||||||
jclass dhcpInfoInternalClass = env->FindClass("android/net/DhcpInfoInternal");
|
jclass dhcpInfoInternalClass = env->FindClass("android/net/DhcpInfoInternal");
|
||||||
LOG_FATAL_IF(dhcpInfoInternalClass == NULL, "Unable to find class android/net/DhcpInfoInternal");
|
LOG_FATAL_IF(dhcpInfoInternalClass == NULL, "Unable to find class android/net/DhcpInfoInternal");
|
||||||
dhcpInfoInternalFieldIds.constructorId = env->GetMethodID(dhcpInfoInternalClass, "<init>", "()V");
|
dhcpInfoInternalFieldIds.constructorId = env->GetMethodID(dhcpInfoInternalClass, "<init>", "()V");
|
||||||
|
|||||||
Reference in New Issue
Block a user