mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt-plugins
Some changes in android plugin for runtime permission is included.
This commit is contained in:
commit
f49ecb2539
@ -1646,67 +1646,7 @@ public interface DeviceManagementAdminService {
|
|||||||
"If a passcode policy has been set in EMM, the lock code should comply to the passcode policy.\t",
|
"If a passcode policy has been set in EMM, the lock code should comply to the passcode policy.\t",
|
||||||
required = true)
|
required = true)
|
||||||
LockCodeBeanWrapper lockCodeBeanWrapper);
|
LockCodeBeanWrapper lockCodeBeanWrapper);
|
||||||
/*
|
|
||||||
@POST
|
|
||||||
@Path("/set-runtime-permission-policy")
|
|
||||||
@ApiOperation(
|
|
||||||
consumes = MediaType.APPLICATION_JSON,
|
|
||||||
httpMethod = "POST",
|
|
||||||
value = "Setting a Runtime Permission Policy on Android Devices",
|
|
||||||
notes = "Set a runtime permission policy on Android devices.",
|
|
||||||
response = Activity.class,
|
|
||||||
tags = "Android Device Management Administrative Service",
|
|
||||||
extensions = {
|
|
||||||
@Extension(properties = {
|
|
||||||
@ExtensionProperty(name = AndroidConstants.SCOPE, value = "perm:android:set-runtime-permission-policy")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(
|
|
||||||
code = 201,
|
|
||||||
message = "Created. \n Successfully scheduled the set runtime permission policy operation.",
|
|
||||||
response = Activity.class,
|
|
||||||
responseHeaders = {
|
|
||||||
@ResponseHeader(
|
|
||||||
name = "Content-Location",
|
|
||||||
description = "URL of the activity instance that refers to the scheduled operation."),
|
|
||||||
@ResponseHeader(
|
|
||||||
name = "Content-Type",
|
|
||||||
description = "Content type of the body"),
|
|
||||||
@ResponseHeader(
|
|
||||||
name = "ETag",
|
|
||||||
description = "Entity Tag of the response resource.\n" +
|
|
||||||
"Used by caches, or in conditional requests."),
|
|
||||||
@ResponseHeader(
|
|
||||||
name = "Last-Modified",
|
|
||||||
description = "Date and time the resource was last modified.\n" +
|
|
||||||
"Used by caches, or in conditional requests.")}),
|
|
||||||
@ApiResponse(
|
|
||||||
code = 303,
|
|
||||||
message = "See Other. \n The source can be retrieved from the URL specified in the location header.",
|
|
||||||
responseHeaders = {
|
|
||||||
@ResponseHeader(
|
|
||||||
name = "Content-Location",
|
|
||||||
description = "The Source URL of the document.")}),
|
|
||||||
@ApiResponse(
|
|
||||||
code = 400,
|
|
||||||
message = "Bad Request. \n Invalid request or validation error."),
|
|
||||||
@ApiResponse(
|
|
||||||
code = 415,
|
|
||||||
message = "Unsupported media type. \n The entity of the request was in a not supported format."),
|
|
||||||
@ApiResponse(
|
|
||||||
code = 500,
|
|
||||||
message = "Internal Server Error. \n " +
|
|
||||||
"Server error occurred while adding a new set runtime permission policy operation.")
|
|
||||||
})
|
|
||||||
Response setRuntimePermissionPolicy(
|
|
||||||
@ApiParam(
|
|
||||||
name = "runtimePermissionPolicy",
|
|
||||||
value = "The properties required to set a runtime permission policy.",
|
|
||||||
required = true)
|
|
||||||
RuntimePermissionPolicyBeanWrapper runtimePermissionPolicyBeanWrapper);
|
|
||||||
*/
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/set-password-policy")
|
@Path("/set-password-policy")
|
||||||
@ApiOperation(
|
@ApiOperation(
|
||||||
|
|||||||
@ -817,49 +817,6 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
@POST
|
|
||||||
@Path("/set-runtime-permission-policy")
|
|
||||||
@Override
|
|
||||||
public Response setRuntimePermissionPolicy(RuntimePermissionPolicyBeanWrapper runtimePermissionPolicyBeanWrapper){
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.debug("Invoking 'runtime permission policy' operation");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (runtimePermissionPolicyBeanWrapper == null || runtimePermissionPolicyBeanWrapper.getOperation() == null) {
|
|
||||||
String errorMessage = "The payload of the change runtime permission policy operation is incorrect";
|
|
||||||
log.error(errorMessage);
|
|
||||||
throw new BadRequestException(
|
|
||||||
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build());
|
|
||||||
}
|
|
||||||
RuntimePermissionPolicy runtimePermissionPolicy = runtimePermissionPolicyBeanWrapper.getOperation();
|
|
||||||
ProfileOperation operation = new ProfileOperation();
|
|
||||||
operation.setCode(AndroidConstants.OperationCodes.RUNTIME_PERMISSION_POLICY);
|
|
||||||
operation.setType(Operation.Type.PROFILE);
|
|
||||||
operation.setPayLoad(runtimePermissionPolicy.toJSON());
|
|
||||||
|
|
||||||
return AndroidAPIUtils.getOperationResponse(runtimePermissionPolicyBeanWrapper.getDeviceIDs(),
|
|
||||||
operation);
|
|
||||||
} catch (InvalidDeviceException e) {
|
|
||||||
String errorMessage = "Invalid Device Identifiers found.";
|
|
||||||
log.error(errorMessage, e);
|
|
||||||
throw new BadRequestException(
|
|
||||||
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build());
|
|
||||||
} catch (OperationManagementException e) {
|
|
||||||
String errorMessage = "Issue in retrieving operation management service instance";
|
|
||||||
log.error(errorMessage, e);
|
|
||||||
throw new UnexpectedServerErrorException(
|
|
||||||
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(errorMessage).build());
|
|
||||||
} catch (DeviceManagementException e) {
|
|
||||||
String errorMessage = "Issue in retrieving device management service instance";
|
|
||||||
log.error(errorMessage, e);
|
|
||||||
throw new UnexpectedServerErrorException(
|
|
||||||
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(errorMessage).build());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/configure-wifi")
|
@Path("/configure-wifi")
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Binary file not shown.
@ -36,7 +36,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{{#each controlOperations}}
|
{{#each controlOperations}}
|
||||||
<a href="javascript:operationSelect('{{operation}}')">
|
<a {{#unless isDisabled}} href="javascript:operationSelect('{{operation}}')" {{else}} href="javascript:void(0)" class="op-disabled"{{/unless}}>
|
||||||
{{#if iconFont}}
|
{{#if iconFont}}
|
||||||
<i class="fw {{iconFont}}"></i>
|
<i class="fw {{iconFont}}"></i>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|||||||
@ -160,7 +160,7 @@ var androidOperationModule = function () {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case androidOperationConstants["RUNTIME_PERMISSION_POLICY_OPERATION_CODE"]:
|
case androidOperationConstants["RUNTIME_PERMISSION_POLICY_OPERATION_CODE"]:
|
||||||
payload ={"runtimePermissionType": operationPayload["type"]
|
payload ={"defaultRuntimePermissionType": operationPayload["defaultType"]
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case androidOperationConstants["KIOSK_APPS_CODE"]:
|
case androidOperationConstants["KIOSK_APPS_CODE"]:
|
||||||
|
|||||||
@ -1337,7 +1337,7 @@
|
|||||||
<td data-title="Runtime Permission">
|
<td data-title="Runtime Permission">
|
||||||
<select id="runtime-permission-policy-permission-type"
|
<select id="runtime-permission-policy-permission-type"
|
||||||
class="form-control operationDataKeys"
|
class="form-control operationDataKeys"
|
||||||
data-key="permissionType" data-default="0">
|
data-key="defaultPermissionType" data-default="0">
|
||||||
<option value="1" selected="selected">PROMPT USER</option>
|
<option value="1" selected="selected">PROMPT USER</option>
|
||||||
<option value="2">AUTO GRANT</option>
|
<option value="2">AUTO GRANT</option>
|
||||||
<option value="3">AUTO DENY</option>
|
<option value="3">AUTO DENY</option>
|
||||||
|
|||||||
@ -68,10 +68,12 @@
|
|||||||
},
|
},
|
||||||
"DEVICE_REBOOT": {
|
"DEVICE_REBOOT": {
|
||||||
"icon": "fw-refresh",
|
"icon": "fw-refresh",
|
||||||
|
"isDisabled" : true,
|
||||||
"permission": "/device-mgt/devices/owning-device/operations/android/reboot"
|
"permission": "/device-mgt/devices/owning-device/operations/android/reboot"
|
||||||
},
|
},
|
||||||
"UPGRADE_FIRMWARE": {
|
"UPGRADE_FIRMWARE": {
|
||||||
"icon": "fw-hardware",
|
"icon": "fw-hardware",
|
||||||
|
"isDisabled" : true,
|
||||||
"formParams": [
|
"formParams": [
|
||||||
{
|
{
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
|
|||||||
3
pom.xml
3
pom.xml
@ -1128,7 +1128,8 @@
|
|||||||
<javax.ws.rs.version>1.1.1</javax.ws.rs.version>
|
<javax.ws.rs.version>1.1.1</javax.ws.rs.version>
|
||||||
|
|
||||||
<!-- Carbon Device Management -->
|
<!-- Carbon Device Management -->
|
||||||
<carbon.devicemgt.version>2.0.65-SNAPSHOT</carbon.devicemgt.version>
|
<carbon.devicemgt.version>2.0.68</carbon.devicemgt.version>
|
||||||
|
|
||||||
<carbon.devicemgt.version.range>[2.0.0, 3.0.0)</carbon.devicemgt.version.range>
|
<carbon.devicemgt.version.range>[2.0.0, 3.0.0)</carbon.devicemgt.version.range>
|
||||||
|
|
||||||
<!-- Carbon App Management -->
|
<!-- Carbon App Management -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user