Catch exception in provision Android client for setDeviceId API.
Change-Id: I19918e47eac9f040d490e3805964c6cc7d5d3fba
Signed-off-by: Sandeep Sharma <sandeep.s9@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13345
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
/**
* Method to set DeviceId.
*/
- public static native void setDeviceId(byte[] deviceId);
+ public static native void setDeviceId(byte[] deviceId) throws OcException;
}
String devId = new String(deviceIdBytes);
Log.d(TAG, "Get Device Id "+devId);
//Set deviceId
- String setId = "adminDeviceUuid1";
- OcPlatform.setDeviceId(setId.getBytes());
- Log.d(TAG, "Set Device Id done");
+ try {
+ String setId = "adminDeviceUuid1";
+ OcPlatform.setDeviceId(setId.getBytes());
+ Log.d(TAG, "Set Device Id done");
+ }
+ catch (OcException e) {
+ Log.d(TAG, e.getMessage());
+ }
try {
/*