Bug 1203819 - Fix loop condition in BluetoothPbapManager::PackPropertiesMask, r=shuang
authorBen Tian <btian@mozilla.com>
Fri, 11 Sep 2015 11:14:26 +0800
changeset 294272 295432fe36689de5f321914899e21ec3d497ecd4
parent 294271 c4bf8c0c204434c0c83d10caf3e19eeab60a5fd4
child 294273 f3ce28ac55cfe371c919eabb485ae7d893d342e2
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1203819
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203819 - Fix loop condition in BluetoothPbapManager::PackPropertiesMask, r=shuang
dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
--- a/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
@@ -270,24 +270,24 @@ BluetoothPbapManager::ReceiveSocketData(
       ReplyToSetPath();
       break;
     }
     case ObexRequestCode::Get:
       // Section 6.2.2 "OBEX Headers in Multi-Packet Responses", IrOBEX 1.2
       // All OBEX request messages shall be sent as one OBEX packet containing
       // all of the headers. I.e. OBEX GET with opcode 0x83 shall always be
       // used. OBEX GET with opcode 0x03 shall never be used.
-      BT_LOGR("PBAP shall always uses OBEX GetFinal instead of Get.");
+      BT_LOGR("PBAP shall always use OBEX GetFinal instead of Get.");
 
       // no break. Treat 'Get' as 'GetFinal' for error tolerance.
     case ObexRequestCode::GetFinal: {
-      // As long as 'mVCardDataStream' requires multiple response packets to
-      // complete, the client should continue to issue GET requests until the
-      // final body information (in an End-of-Body header) arrives, along with
-      // the response code 0xA0 Success.
+      // When |mVCardDataStream| requires multiple response packets to complete,
+      // the client should continue to issue GET requests until the final body
+      // information (i.e., End-of-Body header) arrives, along with
+      // ObexResponseCode::Success
       if (mVCardDataStream) {
         if (!ReplyToGet()) {
           BT_LOGR("Failed to reply to PBAP GET request.");
           ReplyError(ObexResponseCode::InternalServerError);
         }
         return;
       }
 
@@ -726,17 +726,17 @@ BluetoothPbapManager::PackPropertiesMask
   // the requested vCard objects. We only support bit 0~31 since the rest are
   // reserved for future use or vendor specific properties.
 
   // convert big endian to little endian
   uint32_t x = (aData[7] << 0)  | (aData[6] << 8) |
                (aData[5] << 16) | (aData[4] << 24);
 
   uint32_t count = 0;
-  while (!x) {
+  while (x) {
     if (x & 1) {
       propSelector.AppendElement(count);
     }
 
     ++count;
     x >>= 1;
   }