OSDN Git Service

check device.mAlias null case before copying to it
authorMatthew Xie <mattx@google.com>
Wed, 4 Apr 2012 08:03:50 +0000 (01:03 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 17 Jul 2012 04:55:41 +0000 (21:55 -0700)
Change-Id: I705126ce11272d9c3a5577c0266982a6478e8a87

src/com/android/bluetooth/btservice/RemoteDevices.java

index 6295e39..4d31751 100755 (executable)
@@ -225,7 +225,10 @@ final class RemoteDevices {
                         debugLog("Remote Device ame is: " + device.mName);
                         break;
                     case AbstractionLayer.BT_PROPERTY_REMOTE_FRIENDLY_NAME:
-                        System.arraycopy(val, 0, device.mAlias, 0, val.length);
+                        // TODO(BT) is null device.mAlias a valid senario?
+                        if (device.mAlias != null) {
+                            System.arraycopy(val, 0, device.mAlias, 0, val.length);
+                        }
                         break;
                     case AbstractionLayer.BT_PROPERTY_BDADDR:
                         device.mAddress = val;