Android sense device name change and device analytics image added

Menaka Madushanka 9 years ago
parent 5013702aab
commit b07f427f4d

@ -211,7 +211,8 @@ public class AndroidSenseService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Feature(code = "readbattery", name = "Battery", description = "Read Battery data from the device", type = "monitor")
@Feature(code = "readbattery", name = "Battery", description = "Read Battery data from the device",
type = "monitor")
public SensorRecord readBattery(
@HeaderParam("owner") String owner, @HeaderParam("deviceId") String deviceId,
@Context HttpServletResponse response) {
@ -251,7 +252,8 @@ public class AndroidSenseService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Feature(code = "readmagnetic", name = "Magnetic", description = "Read Magnetic data from the device", type = "monitor")
@Feature(code = "readmagnetic", name = "Magnetic", description = "Read Magnetic data from the device",
type = "monitor")
public SensorRecord readMagnetic(
@HeaderParam("owner") String owner, @HeaderParam("deviceId") String deviceId,
@Context HttpServletResponse response) {
@ -271,7 +273,8 @@ public class AndroidSenseService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Feature(code = "readaccelerometer", name = "Accelerometer", description = "Read Accelerometer data from the device", type = "monitor")
@Feature(code = "readaccelerometer", name = "Accelerometer", description = "Read Accelerometer data from the " +
"device", type = "monitor")
public SensorRecord readAccelerometer(
@HeaderParam("owner") String owner, @HeaderParam("deviceId") String deviceId,
@Context HttpServletResponse response) {
@ -291,7 +294,8 @@ public class AndroidSenseService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Feature(code = "readrotation", name = "Rotation", description = "Read Rotational Vector data from the device", type = "monitor")
@Feature(code = "readrotation", name = "Rotation", description = "Read Rotational Vector data from the device",
type = "monitor")
public SensorRecord readRotation(
@HeaderParam("owner") String owner, @HeaderParam("deviceId") String deviceId,
@Context HttpServletResponse response) {
@ -311,7 +315,8 @@ public class AndroidSenseService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Feature(code = "readproximity", name = "Proximity", description = "Read Proximity data from the device", type = "monitor")
@Feature(code = "readproximity", name = "Proximity", description = "Read Proximity data from the device",
type = "monitor")
public SensorRecord readProximity(
@HeaderParam("owner") String owner, @HeaderParam("deviceId") String deviceId,
@Context HttpServletResponse response) {
@ -331,7 +336,8 @@ public class AndroidSenseService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Feature(code = "readgyroscope", name = "Gyroscope", description = "Read Gyroscope data from the device", type = "monitor")
@Feature(code = "readgyroscope", name = "Gyroscope", description = "Read Gyroscope data from the device",
type = "monitor")
public SensorRecord readGyroscope(
@HeaderParam("owner") String owner, @HeaderParam("deviceId") String deviceId,
@Context HttpServletResponse response) {

@ -71,7 +71,8 @@ public class AndroidSenseService {
public boolean register(@FormParam("username") String username,
@FormParam("password") String password,
@FormParam("deviceId") String deviceId,
@FormParam("owner") String owner) {
@FormParam("owner") String owner,
@FormParam("deviceName") String deviceName) {
DeviceManagement deviceManagement = new DeviceManagement(SUPER_TENANT);
@ -114,8 +115,7 @@ public class AndroidSenseService {
enrolmentInfo.setDateOfLastUpdate(new Date().getTime());
enrolmentInfo.setStatus(EnrolmentInfo.Status.ACTIVE);
enrolmentInfo.setOwnership(EnrolmentInfo.OwnerShip.BYOD);
String name = owner + " android " + deviceId;
device.setName(name);
device.setName(deviceName);
device.setType(AndroidSenseConstants.DEVICE_TYPE);
enrolmentInfo.setOwner(owner);
device.setEnrolmentInfo(enrolmentInfo);

Loading…
Cancel
Save