Cleanup Bluetooth Facades

Add a bit more documentation
Remove old todos

Bug: 26257616
Change-Id: I37557b72e80c65159ee2bceec919263e07056108
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java
index 0020764..4a98d71 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java
@@ -80,11 +80,23 @@
     return sA2dpProfile.disconnect(device);
   }
 
+  /**
+   * Checks to see if the A2DP profile is ready for use.
+   *
+   * @return Returns true if the A2DP Profile is ready.
+   */
   @Rpc(description = "Is A2dp profile ready.")
   public Boolean bluetoothA2dpIsReady() {
     return sIsA2dpReady;
   }
 
+  /**
+   * Connect to remote device using the A2DP profile.
+   *
+   * @param deviceId the name or mac address of the remote Bluetooth device.
+   * @return True if connected successfully.
+   * @throws Exception
+   */
   @Rpc(description = "Connect to an A2DP device.")
   public Boolean bluetoothA2dpConnect(
       @RpcParameter(name = "deviceID", description = "Name or MAC address of a bluetooth device.")
@@ -98,6 +110,13 @@
     return a2dpConnect(mDevice);
   }
 
+  /**
+   * Disconnect a remote device using the A2DP profile.
+   *
+   * @param deviceId the name or mac address of the remote Bluetooth device.
+   * @return True if connected successfully.
+   * @throws Exception
+   */
   @Rpc(description = "Disconnect an A2DP device.")
   public Boolean bluetoothA2dpDisconnect(
       @RpcParameter(name = "deviceID", description = "Name or MAC address of a device.")
@@ -111,6 +130,12 @@
     return a2dpDisconnect(mDevice);
   }
 
+  /**
+   * Get the list of devices connected through the A2DP profile.
+   *
+   * @return List of bluetooth devices that are in one of the following states:
+   *   connected, connecting, and disconnecting.
+   */
   @Rpc(description = "Get all the devices connected through A2DP.")
   public List<BluetoothDevice> bluetoothA2dpGetConnectedDevices() {
     while (!sIsA2dpReady);
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothFacade.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothFacade.java
index 798c323..df5a177 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothFacade.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothFacade.java
@@ -107,7 +107,6 @@
         @Override
         public void onReceive(Context context, Intent intent) {
             String action = intent.getAction();
-            // TODO: Keep track of the separate states be a separate method.
             if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
                 final int state = mBluetoothAdapter.getState();
                 Bundle msg = new Bundle();
@@ -284,11 +283,8 @@
             enabled = !bluetoothCheckState();
         }
         if (enabled) {
-            // TODO(damonkohler): Make this synchronous as well.
             mBluetoothAdapter.enable();
         } else {
-            // TODO(damonkohler): Add support for prompting on disable.
-            // TODO(damonkohler): Make this synchronous as well.
             shutdown();
             mBluetoothAdapter.disable();
         }
@@ -307,8 +303,6 @@
     @Rpc(description = "Cancel the current device discovery process.",
          returns = "true on success, false on error")
     public Boolean bluetoothCancelDiscovery() {
-        //TODO (tturney): Figure out why bluetoothStartDiscovery sometimes
-        //doesn't register the reiever.
         try {
             mService.unregisterReceiver(mDiscoveryReceiver);
         } catch (IllegalArgumentException e) {
@@ -345,7 +339,6 @@
             ) {
         BluetoothActivityEnergyInfo energyInfo = mBluetoothAdapter
             .getControllerActivityEnergyInfo(value);
-        //TODO (tturney): Fix when method dosn't return null... cosmic issue.
         while (energyInfo == null) {
           energyInfo = mBluetoothAdapter.getControllerActivityEnergyInfo(value);
         }
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothRfcommFacade.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothRfcommFacade.java
index 7920523..34685e9 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothRfcommFacade.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothRfcommFacade.java
@@ -263,7 +263,6 @@
     try {
       conn = getConnection(connID);
     } catch (IOException e) {
-      // TODO Auto-generated catch block
       e.printStackTrace();
       return;
     }
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattClientFacade.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattClientFacade.java
index 16e2fc4..0a96cd9 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattClientFacade.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattClientFacade.java
@@ -660,7 +660,6 @@
             @RpcParameter(name = "enable")
             Boolean enable
             ) throws Exception {
-        //TODO: (tturney) Implement setCharacteristicNotification for the characteristic discovered
         if (mBluetoothGattList.get(gattIndex) != null) {
             if(mBluetoothGattDiscoveredServicesList.get(discoveredServiceListIndex) != null) {
                 List<BluetoothGattService> discoveredServiceList =
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattServerFacade.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattServerFacade.java
index 910b11c..df03fe2 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattServerFacade.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/bluetooth/GattServerFacade.java
@@ -196,19 +196,6 @@
     return index;
   }
 
-  // TODO: Finish this for bluetooth device, need to create a bt device list.
-  /*
-   * @Rpc(description = "cancel gatt server connection by device") public void
-   * gattServerCancelConnection(
-   *
-   * @RpcParameter(name = "index") Integer index,
-   *
-   * @RpcParameter(name = "deviceIndex") Integer bluetoothDevice ) throws Exception { if
-   * (mBluetoothGattServerList.get(index) != null) {
-   * mBluetoothGattServerList.get(index).cancelConnection(bluetoothDevice); } else { throw new
-   * Exception("Invalid index input:" + Integer.toString(index)); } }
-   */
-
   /**
    * Add a characteristic to a bluetooth gatt service
    *