mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Fixing formatting issues and reusing variables
This commit is contained in:
parent
8f6b65946a
commit
ed2781cecd
@ -44,6 +44,7 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
||||
import org.wso2.carbon.appmgt.mobile.utils.User;
|
||||
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||
import org.wso2.carbon.registry.api.Resource;
|
||||
import org.wso2.carbon.registry.core.exceptions.RegistryException;
|
||||
import org.wso2.carbon.registry.core.session.UserRegistry;
|
||||
@ -250,19 +251,19 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
|
||||
List<Device> devices;
|
||||
List<org.wso2.carbon.device.mgt.common.Device> deviceList = null;
|
||||
try {
|
||||
DeviceManagementProviderService deviceManagementService = MDMServiceAPIUtils
|
||||
.getDeviceManagementService(applicationOperationDevice.getTenantId());
|
||||
final String username = applicationOperationDevice.getCurrentUser().getUsername();
|
||||
if (MDMAppConstants.WEBAPP.equals
|
||||
(applicationOperationDevice.getPlatform())) {
|
||||
deviceList = MDMServiceAPIUtils
|
||||
.getDeviceManagementService(applicationOperationDevice.getTenantId()).
|
||||
getDevicesOfUser(applicationOperationDevice.getCurrentUser().getUsername());
|
||||
deviceList = deviceManagementService.
|
||||
getDevicesOfUser(username);
|
||||
} else {
|
||||
deviceList = MDMServiceAPIUtils
|
||||
.getDeviceManagementService(applicationOperationDevice.getTenantId()).
|
||||
getDevicesOfUser(applicationOperationDevice.getCurrentUser().getUsername(),
|
||||
deviceList = deviceManagementService.
|
||||
getDevicesOfUser(username,
|
||||
MDMAppConstants.ANDROID);
|
||||
deviceList.addAll(MDMServiceAPIUtils
|
||||
.getDeviceManagementService(applicationOperationDevice.getTenantId()).
|
||||
getDevicesOfUser(applicationOperationDevice.getCurrentUser().getUsername(),
|
||||
deviceList.addAll(deviceManagementService.
|
||||
getDevicesOfUser(username,
|
||||
MDMAppConstants.IOS));
|
||||
}
|
||||
devices = new ArrayList<>(deviceList.size());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user