diff options
author | Anil Dahiya <anil_dahiya@infosys.com> | 2018-07-19 11:43:58 +0530 |
---|---|---|
committer | Anil Dahiya <anil_dahiya@infosys.com> | 2018-07-19 11:43:58 +0530 |
commit | a8c6ff8775fb09b0c754d7cf09e878846aead5fe (patch) | |
tree | 71e2525632b88019731e3f5e8d9d59b38b6c14cf | |
parent | 14d97d125608f1a9823fa9cab68e53d0ebae0b32 (diff) | |
download | sdl_android-a8c6ff8775fb09b0c754d7cf09e878846aead5fe.tar.gz |
Adding documentation for the newly added methods.
3 files changed, 25 insertions, 13 deletions
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java index 09c50ce86..e1bcdaf22 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java @@ -1,7 +1,6 @@ package com.smartdevicelink.test.proxy; import android.content.Context; -import android.os.Bundle; import android.telephony.TelephonyManager; import android.test.AndroidTestCase; import android.util.Log; @@ -623,7 +622,6 @@ public class SdlProxyBaseTests extends AndroidTestCase{ @Override public void onOnRCStatus(OnRCStatus notification) { - } } } diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java index 9f360beec..5fbd48b91 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java @@ -17,7 +17,7 @@ import java.util.List; public class OnRCStatusTests extends BaseRpcTests { @Override - protected RPCMessage createMessage(){ + protected RPCMessage createMessage() { OnRCStatus msg = new OnRCStatus(); List<ModuleData> listAllocatedModules = new ArrayList<>(); @@ -34,17 +34,17 @@ public class OnRCStatusTests extends BaseRpcTests { } @Override - protected String getMessageType(){ - return RPCMessage.KEY_NOTIFICATION; - } + protected String getMessageType() { + return RPCMessage.KEY_NOTIFICATION; + } @Override - protected String getCommandType(){ - return FunctionID.ON_RC_STATUS.toString(); - } + protected String getCommandType() { + return FunctionID.ON_RC_STATUS.toString(); + } @Override - protected JSONObject getExpectedParameters(int sdlVersion){ + protected JSONObject getExpectedParameters(int sdlVersion) { JSONObject result = new JSONObject(); JSONArray jsonArrayAllocatedModules = new JSONArray(); @@ -70,11 +70,11 @@ public class OnRCStatusTests extends BaseRpcTests { /** * Tests the expected values of the RPC message. */ - public void testRpcValues () { + public void testRpcValues() { // Test Values List<ModuleData> listAllocatedModules = ((OnRCStatus) msg).getAllocatedModules(); List<ModuleData> listFreeModules = ((OnRCStatus) msg).getFreeModules(); - Boolean allowed = ( (OnRCStatus) msg ).getAllowed(); + Boolean allowed = ((OnRCStatus) msg).getAllowed(); // Valid Tests assertEquals(Test.MATCH, Test.GENERAL_MODULEDATA, listAllocatedModules.get(0)); diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java index 8dc55a7c4..8be1e0007 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java @@ -13,21 +13,35 @@ public class OnRCStatus extends RPCNotification { public static final String KEY_FREE_MODULES = "freeModules"; public static final String KEY_ALLOWED = "allowed"; + /** + * Constructs a new OnRCStatus object + */ public OnRCStatus() { super(FunctionID.ON_RC_STATUS.toString()); } + /** + * Constructs a new OnRCStatus object indicated by the Hashtable + * parameter + * @param hash The Hashtable to use + */ public OnRCStatus(Hashtable<String, Object> hash) { super(hash); } + /** + * Constructs a newly allocated OnRCStatus object + * + * @param allocatedModules Contains a list (zero or more) of module types that are allocated to the application. + * @param freeModules Contains a list (zero or more) of module types that are free to access for the application. + */ public OnRCStatus(@NonNull List<ModuleData> allocatedModules, @NonNull List<ModuleData> freeModules) { this(); setAllocatedModules(allocatedModules); setFreeModules(freeModules); } - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") public List<ModuleData> getAllocatedModules() { return (List<ModuleData>) getObject(ModuleData.class, KEY_ALLOCATED_MODULES); } |