Commits

Eric Chou  committed a28241a Draft

Bug 799452 - Patch 1: Send a system message to notify 'receiving file confirmation', r=qdot

  • Participants
  • Parent commits 77181a4

Comments (0)

Files changed (2)

File dom/bluetooth/BluetoothOppManager.cpp

 BluetoothOppManager::OnDisconnect()
 {
 }
+
+void
+BluetoothOppManager::ReceivingFileConfirmation(const nsString& aAddress,
+                                               const nsString& aFileName,
+                                               uint32_t aFileLength,
+                                               const nsString& aContentType)
+{
+  nsString type, name;
+  BluetoothValue v;
+  InfallibleTArray<BluetoothNamedValue> parameters;
+  type.AssignLiteral("bluetooth-opp-receiving-file-confirmation");
+
+  name.AssignLiteral("address");
+  v = aAddress;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  name.AssignLiteral("fileName");
+  v = aFileName;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  name.AssignLiteral("fileLength");
+  v = aFileLength;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  name.AssignLiteral("contentType");
+  v = aContentType;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  if (!BroadcastSystemMessage(type, parameters)) {
+    NS_WARNING("Failed to broadcast [bluetooth-opp-receiving-file-confirmation]");
+    return;
+  }
+}

File dom/bluetooth/BluetoothOppManager.h

                       bool aReceived,
                       uint32_t aProcessedLength,
                       uint32_t aFileLength);
+  void ReceivingFileConfirmation(const nsString& aAddress,
+                                 const nsString& aFileName,
+                                 uint32_t aFileLength,
+                                 const nsString& aContentType);
   void ReplyToConnect();
   void ReplyToDisconnect();
   void ReplyToPut(bool aFinal);