summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorNick Pelly <>2009-03-31 12:05:46 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-31 12:05:46 -0700
commit3f46f0a0cd16186219d501199b59be64d00f3cdc (patch)
tree1641dcdf3c9568ff64c5e0858f14ecfdf89219db /core/jni
parent41ac221de74793c0de5e253327d5d4c002229952 (diff)
downloadframeworks_base-3f46f0a0cd16186219d501199b59be64d00f3cdc.zip
frameworks_base-3f46f0a0cd16186219d501199b59be64d00f3cdc.tar.gz
frameworks_base-3f46f0a0cd16186219d501199b59be64d00f3cdc.tar.bz2
AI 143740: Don't clear supported profiles in settings app if getRemoteClass returns error.
Also clean up the error codes returned by the framework, so that the settings app can properly detect an error. BUG=1748881 Automated import of CL 143740
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_server_BluetoothDeviceService.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/jni/android_server_BluetoothDeviceService.cpp b/core/jni/android_server_BluetoothDeviceService.cpp
index 796da15..a0e0b84 100644
--- a/core/jni/android_server_BluetoothDeviceService.cpp
+++ b/core/jni/android_server_BluetoothDeviceService.cpp
@@ -44,6 +44,8 @@
namespace android {
+#define BLUETOOTH_CLASS_ERROR 0xFF000000
+
#ifdef HAVE_BLUETOOTH
// We initialize these variables when we load class
// android.server.BluetoothDeviceService
@@ -724,11 +726,11 @@ static jstring lastUsedNative(JNIEnv *env, jobject obj, jstring address) {
}
static jint getRemoteClassNative(JNIEnv *env, jobject object, jstring address) {
+ jint result = BLUETOOTH_CLASS_ERROR;
#ifdef HAVE_BLUETOOTH
LOGV(__FUNCTION__);
native_data_t *nat = get_native_data(env, object);
if (nat) {
- jint ret = 0;
const char *c_address = env->GetStringUTFChars(address, NULL);
LOGV("... address = %s", c_address);
@@ -744,17 +746,15 @@ static jint getRemoteClassNative(JNIEnv *env, jobject object, jstring address) {
DBusError err;
dbus_error_init(&err);
if (!dbus_message_get_args(reply, &err,
- DBUS_TYPE_UINT32, &ret,
+ DBUS_TYPE_UINT32, &result,
DBUS_TYPE_INVALID)) {
LOG_AND_FREE_DBUS_ERROR_WITH_MSG(&err, reply);
}
dbus_message_unref(reply);
}
-
- return ret;
}
#endif
- return 0;
+ return result;
}
static jbyteArray getRemoteFeaturesNative(JNIEnv *env, jobject object,