Fixed build errors with Media Session Facade
Made modifications to Ble Advertise facade to accomadate api changes
Made modifications to Ble Scan facade to accomadate api changes
Made modifications to Json Builder to accomadate api changes

Change-Id: Ic7b7a5384e5b09ac2f85ad5912719cbaaff52388
diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeAdvertiseFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeAdvertiseFacade.java
index bbed27c..9d5db59 100644
--- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeAdvertiseFacade.java
+++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeAdvertiseFacade.java
@@ -403,20 +403,20 @@
     }
 
     /**
-     * Get ble advertisement settings type
+     * Get ble advertisement settings isConnectable value
      *
      * @param index the advertise settings object to use
-     * @return the type of the advertise settings object
+     * @return the boolean value whether the advertisement will indicate
+     * connectable.
      * @throws Exception
      */
-    @Rpc(description = "Get ble advertisement settings type")
-    public int getAdvertisementSettingsType(
+    @Rpc(description = "Get ble advertisement settings isConnectable value")
+    public boolean getAdvertisementSettingsIsConnectable(
             @RpcParameter(name = "index")
             Integer index) throws Exception {
         if (mAdvertiseSettingsList.get(index) != null) {
             AdvertiseSettings mSettings = mAdvertiseSettingsList.get(index);
-            // TODO: Fix this rpc to match the API.
-            return mSettings.getIsConnectable() ? 1 : 0;
+            return mSettings.getIsConnectable();
         } else {
             throw new Exception("Invalid index input:" + Integer.toString(index));
         }
@@ -626,18 +626,17 @@
     }
 
     /**
-     * Set ble advertise settings the setting type
+     * Set ble advertise settings the isConnectable value
      *
-     * @param type the setting type
+     * @param type the isConnectable value
      * @throws Exception
      */
-    @Rpc(description = "Set ble advertise settings the setting type")
+    @Rpc(description = "Set ble advertise settings isConnectable value")
     public void setAdvertisementSettingType(
-            @RpcParameter(name = "type")
-            Integer type
+            @RpcParameter(name = "value")
+            Boolean value
             ) {
-        // TODO: FIx this rpc to match the updated API.
-        mAdvertiseSettingsBuilder.setIsConnectable(true);
+        mAdvertiseSettingsBuilder.setIsConnectable(value);
     }
 
     private class myAdvertiseCallback extends AdvertiseCallback {
diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeScanFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeScanFacade.java
index ff2f695..22c0e52 100644
--- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeScanFacade.java
+++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothLeScanFacade.java
@@ -280,7 +280,7 @@
      * Set scanSettings for ble scan. Note: You have to set all variables at once.
      *
      * @param callbackType Bluetooth LE scan callback type
-     * @param reportDelayNanos Time of delay for reporting the scan result
+     * @param reportDelaySeconds Time of delay for reporting the scan result
      * @param scanMode Bluetooth LE scan mode.
      * @param scanResultType Bluetooth LE scan result type
      * @throws Exception
@@ -289,8 +289,8 @@
     public void setScanSettings(
             @RpcParameter(name = "callbackType")
             Integer callbackType,
-            @RpcParameter(name = "reportDelayNanos")
-            Integer reportDelayNanos,
+            @RpcParameter(name = "reportDelaySeconds")
+            Integer reportDelaySeconds,
             @RpcParameter(name = "scanMode")
             Integer scanMode,
             @RpcParameter(name = "scanResultType")
@@ -298,7 +298,7 @@
         mScanSettingsBuilder.setCallbackType(callbackType);
         mScanSettingsBuilder.setScanMode(scanMode);
         mScanSettingsBuilder.setScanResultType(scanResultType);
-        mScanSettingsBuilder.setReportDelaySeconds(reportDelayNanos);
+        mScanSettingsBuilder.setReportDelaySeconds(reportDelaySeconds);
     }
 
     /**
@@ -322,19 +322,18 @@
     }
 
     /**
-     * Get ScanSetting's report delay nanos
+     * Get ScanSetting's report delay Seconds
      *
      * @param index the ScanSetting object to use
-     * @return the ScanSetting's report delay in nanoseconds
+     * @return the ScanSetting's report delay in seconds
      * @throws Exception
      */
-    @Rpc(description = "Get ScanSetting's report delay nanos")
-    public Long getScanSettingsReportDelayNanos(
+    @Rpc(description = "Get ScanSetting's report delay seconds")
+    public Long getScanSettingsReportDelaySeconds(
             @RpcParameter(name = "index")
             Integer index) throws Exception {
         if (mScanSettingsList.get(index) != null) {
             ScanSettings mScanSettings = mScanSettingsList.get(index);
-            // TODO: fix the rpc to match API.
             return mScanSettings.getReportDelaySeconds();
         } else {
             throw new Exception("Invalid index input:" + Integer.toString(index));
diff --git a/Common/src/com/googlecode/android_scripting/jsonrpc/JsonBuilder.java b/Common/src/com/googlecode/android_scripting/jsonrpc/JsonBuilder.java
index 3b585b9..cae57b2 100644
--- a/Common/src/com/googlecode/android_scripting/jsonrpc/JsonBuilder.java
+++ b/Common/src/com/googlecode/android_scripting/jsonrpc/JsonBuilder.java
@@ -300,8 +300,7 @@
         JSONObject result = new JSONObject();
         result.put("mode", advertiseSettings.getMode());
         result.put("txPowerLevel", advertiseSettings.getTxPowerLevel());
-        // TODO: fix this test setup.
-        result.put("type", advertiseSettings.getIsConnectable());
+        result.put("isConnectable", advertiseSettings.getIsConnectable());
         return result;
     }