From 67d82ab4c1e8ab4e502bb3b50da12793d2dda689 Mon Sep 17 00:00:00 2001 From: sandarudr Date: Mon, 20 May 2019 11:04:26 +0530 Subject: [PATCH 1/5] Add new device restriction policies to the android plugins --- .../device-view.hbs | 2 +- .../public/js/operation-bar.js | 22 ++- .../public/js/operation-mod.js | 47 ++++++- .../public/templates/android-policy-edit.hbs | 127 +++++++++++++++++- .../public/templates/android-policy-view.hbs | 116 ++++++++++++++++ .../templates/android-policy-operations.hbs | 117 ++++++++++++++++ .../android/impl/AndroidFeatureManager.java | 54 ++++++++ .../main/resources/devicetypes/android.xml | 37 +++++ 8 files changed, 515 insertions(+), 7 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs index b814fc2a7f..09c6fe7e40 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs @@ -16,7 +16,7 @@ data-type="{{device.type}}" data-ownership="{{device.ownership}}" data-owner="{{device.owner}}" - data-status="{{device.status}}" + data-status="{{devicamera-enabledce.status}}" data-deviceinfoservice="{{device.deviceInfoServiceAPI}}" data-devicelocationservice="{{device.deviceLocationServiceAPI}}"> {{device.owner}}'s {{device.name}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index 854a2eaee1..d5303db9af 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -337,7 +337,16 @@ var generatePayload = function (operationCode, operationData, deviceList) { "ENSURE_VERIFY_APPS": operationData["ensureVerifyApps"], "AUTO_TIME": operationData["enableAutoTime"], "SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"], - "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"] + "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"], + "KEY_RESTRICTIONS_PENDING": operationData["keyRestrictionsPending"], + "DISALLOW_SET_WALLPAPER": operationData["disallowSetWallpaper"], + "DISALLOW_SET_USER_ICON": operationData["disallowSetUserIcon"], + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": operationData["disallowRemoveManagedProfile"], + "DISALLOW_AUTOFILL": operationData["disallowAutoFill"], + "DISALLOW_BLUETOOTH": operationData["disallowBluetooth"], + "DISALLOW_BLUETOOTH_SHARING": operationData["disallowBluetoothSharing"], + "DISALLOW_REMOVE_USER": operationData["disallowRemoveUser"], + "DISALLOW_DATA_ROAMING": operationData["disallowDataRoaming"] } }; break; @@ -554,5 +563,14 @@ var androidOperationConstants = { "APPLICATION_OPERATION_CODE": "APP-RESTRICTION", "SYSTEM_UPDATE_POLICY_CODE": "SYSTEM_UPDATE_POLICY", "KIOSK_APPS_CODE": "KIOSK_APPS", - "FILE_TRANSFER": "FILE_TRANSFER" + "FILE_TRANSFER": "FILE_TRANSFER", + "KEY_RESTRICTIONS_PENDING": "KEY_RESTRICTIONS_PENDING", + "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", + "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": "DISALLOW_REMOVE_MANAGEMENT_PROFILE", + "DISALLOW_AUTOFILL": "DISALLOW_AUTOFILL", + "DISALLOW_BLUETOOTH": "DISALLOW_BLUETOOTH", + "DISALLOW_BLUETOOTH_SHARING": "DISALLOW_BLUETOOTH_SHARING", + "DISALLOW_REMOVE_USER": "DISALLOW_REMOVE_USER", + "DISALLOW_DATA_ROAMING": "DISALLOW_DATA_ROAMING" }; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js index fe820ecc38..9a7309233c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js @@ -100,7 +100,15 @@ var androidOperationModule = function () { "COSU_PROFILE_CONFIGURATION_OPERATION": "cosu-profile-configuration", "COSU_PROFILE_CONFIGURATION_OPERATION_CODE": "COSU_PROFILE", "ENROLLMENT_APP_INSTALL": "enrollment-app-install", - "ENROLLMENT_APP_INSTALL_CODE": "ENROLLMENT_APP_INSTALL" + "KEY_RESTRICTIONS_PENDING": "KEY_RESTRICTIONS_PENDING", + "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", + "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": "DISALLOW_REMOVE_MANAGEMENT_PROFILE", + "DISALLOW_AUTOFILL": "DISALLOW_AUTOFILL", + "DISALLOW_BLUETOOTH": "DISALLOW_BLUETOOTH", + "DISALLOW_BLUETOOTH_SHARING": "DISALLOW_BLUETOOTH_SHARING", + "DISALLOW_REMOVE_USER": "DISALLOW_REMOVE_USER", + "DISALLOW_DATA_ROAMING": "DISALLOW_DATA_ROAMING" }; /** @@ -344,7 +352,15 @@ var androidOperationModule = function () { "ENSURE_VERIFY_APPS": operationData["ensureVerifyApps"], "AUTO_TIME": operationData["enableAutoTime"], "SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"], - "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"] + "KEY_RESTRICTIONS_PENDING": operationData["keyRestrictionsPending"], + "DISALLOW_SET_WALLPAPER": operationData["disallowSetWallpaper"], + "DISALLOW_SET_USER_ICON": operationData["disallowSetWallpaper"], + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": operationData["disallowRemoveManagedProfile"], + "DISALLOW_AUTOFILL": operationData["disallowAutoFill"], + "DISALLOW_BLUETOOTH": operationData["disallowBluetooth"], + "DISALLOW_BLUETOOTH_SHARING": operationData["disallowBluetoothSharing"], + "DISALLOW_REMOVE_USER": operationData["disallowRemoveUser"], + "DISALLOW_DATA_ROAMING": operationData["disallowDataRoaming"] } }; break; @@ -1200,6 +1216,33 @@ var androidOperationModule = function () { } else if (featureCode == androidOperationConstants["SET_STATUS_BAR_DISABLED"]) { restrictions["disableStatusBar"] = restriction["enabled"]; continue; + }else if (featureCode == androidOperationConstants["KEY_RESTRICTIONS_PENDING"]) { + restrictions["keyRestrictionsPending"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_SET_WALLPAPER"]) { + restrictions["disallowSetWallpaper"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_SET_USER_ICON"]) { + restrictions["disallowSetUserIcon"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_REMOVE_MANAGEMENT_PROFILE"]) { + restrictions["disallowRemoveManagedProfile"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_AUTOFILL"]) { + restrictions["disallowAutoFill"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_BLUETOOTH"]) { + restrictions["disallowBluetooth"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_BLUETOOTH_SHARING"]) { + restrictions["disallowBluetoothSharing"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_REMOVE_USER"]) { + restrictions["disallowRemoveUser"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_DATA_ROAMING"]) { + restrictions["disallowDataRoaming"] = restriction["enabled"]; + continue; } //push the feature-code to the configuration array configuredOperations.push(featureCode); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs index c2e2cb227b..8550778a81 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs @@ -356,6 +356,7 @@ work-profile owner or device owner. +
-
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
-
+
+
+ +
+
{{/unless}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs index 8d8f78d00f..587ae79e28 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs @@ -729,6 +729,19 @@ +
+ +
+ +


@@ -747,6 +760,109 @@
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
{{/unless}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs index 79bb6d4027..41d8243029 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs @@ -505,6 +505,110 @@ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +

    @@ -558,6 +662,7 @@
+

+
+ +
+
{{/unless}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java index a9f28bf92e..70ff5d4e06 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java @@ -469,6 +469,60 @@ public class AndroidFeatureManager implements FeatureManager { feature.setDescription("Unlock the device"); supportedFeatures.add(feature); + feature = new Feature(); + feature.setCode("KEY_RESTRICTIONS_PENDING"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_SET_WALLPAPER"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_SET_USER_ICON"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_REMOVE_MANAGEMENT_PROFILE"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_AUTOFILL"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_BLUETOOTH"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_BLUETOOTH_SHARING"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_REMOVE_USER"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_DATA_ROAMING"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + return supportedFeatures; } } \ No newline at end of file diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml index 30fc71bd64..68e66b36b0 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml @@ -343,6 +343,43 @@ Fetch device logcat Fetch device logcat + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + Unlock the device Unlock the device From fc54dde720763d8ff02c355608569e8aa3f82758 Mon Sep 17 00:00:00 2001 From: sandarudr Date: Fri, 24 May 2019 12:28:13 +0530 Subject: [PATCH 2/5] Fixes and improvements --- .../android/bean/ApplicationRestriction.java | 54 +++++++++++++++ .../ApplicationRestrictionBeanWrapper.java | 55 +++++++++++++++ .../DeviceManagementAdminService.java | 68 +++++++++++++++++++ .../DeviceManagementAdminServiceImpl.java | 56 ++++++++++++--- .../android/util/AndroidAPIUtils.java | 35 ++++++++++ .../android/util/AndroidConstants.java | 1 + .../public/js/operation-bar.js | 10 +++ .../public/templates/android-policy-edit.hbs | 27 ++++---- .../public/templates/android-policy-view.hbs | 26 +++---- .../templates/android-policy-operations.hbs | 24 +++---- .../private/config.json | 21 +++++- .../main/resources/devicetypes/android.xml | 7 ++ 12 files changed, 337 insertions(+), 47 deletions(-) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java new file mode 100644 index 0000000000..b3773376df --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.mdm.services.android.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + +/** + * This class represents the information of sending application config operation. + */ +@ApiModel(value = "ApplicationRestriction", + description = "Details related to application config passed to device.") +public class ApplicationRestriction extends AndroidOperation implements Serializable { + private static final long serialVersionUID = 1995401458L; + + @ApiModelProperty(name = "appIdentifier", value = "The application identifier to be sent.", required = true) + private String appIdentifier; + + @ApiModelProperty(name = "restrictionPayload", value = "The restriction payload to be sent.", required = true) + private String restrictionPayload; + + public String getAppIdentifier() { + return appIdentifier; + } + + public void setAppIdentifier(String appIdentifier) { + this.appIdentifier = appIdentifier; + } + + public String getRestrictionPayload() { + return restrictionPayload; + } + + public void setRestrictionPayload(String restrictionPayload) { + this.restrictionPayload = restrictionPayload; + } +} \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java new file mode 100644 index 0000000000..147a577da5 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java @@ -0,0 +1,55 @@ + +/* + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.mdm.services.android.bean.wrapper; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.wso2.carbon.mdm.services.android.bean.ApplicationRestriction; + +import java.util.List; + +/** + * This class is used to wrap the Notification bean with devices. + */ +@ApiModel(value = "ApplicationRestrictionBeanWrapper", + description = "Mapping between application restriction operation and device list to be applied.") +public class ApplicationRestrictionBeanWrapper { + + @ApiModelProperty(name = "deviceIDs", value = "List of device Ids", required = true) + private List deviceIDs; + @ApiModelProperty(name = "operation", value = "The information of application restriction operation", + required = true) + private ApplicationRestriction operation; + + public List getDeviceIDs() { + return deviceIDs; + } + + public void setDeviceIDs(List deviceIDs) { + this.deviceIDs = deviceIDs; + } + + public ApplicationRestriction getOperation() { + return operation; + } + + public void setOperation(ApplicationRestriction operation) { + this.operation = operation; + } +} \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java index 998503b13b..beebf032c5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java @@ -245,6 +245,12 @@ import java.util.List; description = "Transferring a file to android devices", key = "perm:android:file-transfer", permissions = {"/device-mgt/devices/owning-device/operations/android/file-transfer"} + ), + @Scope( + name = "Send app restrictions", + description = "Send app restrictions to an application in the device", + key = "perm:android:send-app-restrictions", + permissions = {"/device-mgt/devices/owning-device/operations/android/send-app-conf"} ) } ) @@ -1856,6 +1862,68 @@ public interface DeviceManagementAdminService { value = "The properties to set the web clip.", required = true) WebClipBeanWrapper webClipBeanWrapper); + @POST + @Path("/send-app-conf") + @ApiOperation( + consumes = MediaType.APPLICATION_JSON, + httpMethod = "POST", + value = "Sending an app restrictions to Android Devices", + notes = "Send application restrictions to Android devices.", + response = Activity.class, + tags = "Android Device Management Administrative Service", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = AndroidConstants.SCOPE, + value = "perm:android:send-app-restrictions") + }) + } + ) + @ApiResponses(value = { + @ApiResponse( + code = 201, + message = "Created. \n Successfully sent the application configuration.", + 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 format of the requested entity was not supported."), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n " + + "Server error occurred while adding a new send application config operation.") + }) + Response sendApplicationConfiguration( + @ApiParam( + name = "notification", + value = "The properties required to send application restrictions. Provide the restriction you " + + "wish to send and the ID of the Android device. Multiple device IDs can be added by using" + + " comma separated values.", + required = true) + ApplicationRestrictionBeanWrapper applicationRestrictionBeanWrapper); @POST @Path("/configure-global-proxy") diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java index 0941a66a97..efddc87647 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java @@ -37,7 +37,7 @@ package org.wso2.carbon.mdm.services.android.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.json.JSONException; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; @@ -45,6 +45,7 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementExcept import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation; import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; +import org.wso2.carbon.mdm.services.android.bean.ApplicationRestriction; import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; @@ -63,6 +64,7 @@ import org.wso2.carbon.mdm.services.android.bean.WebClip; import org.wso2.carbon.mdm.services.android.bean.Wifi; import org.wso2.carbon.mdm.services.android.bean.WipeData; import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationRestrictionBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUninstallationBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUpdateBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBeanWrapper; @@ -82,6 +84,7 @@ import org.wso2.carbon.mdm.services.android.bean.wrapper.WipeDataBeanWrapper; import org.wso2.carbon.mdm.services.android.exception.BadRequestException; import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; import org.wso2.carbon.mdm.services.android.services.DeviceManagementAdminService; +import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; import org.wso2.carbon.mdm.services.android.util.AndroidConstants; import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; @@ -528,7 +531,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe @POST @Path("/install-application") @Override - public Response installApplication(ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper) { + public Response installApplication( + ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper) { if (log.isDebugEnabled()) { log.debug("Invoking 'InstallApplication' operation"); } @@ -554,11 +558,6 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe Activity activity = AndroidDeviceUtils .getOperationResponse(applicationInstallationBeanWrapper.getDeviceIDs(), operation); return Response.status(Response.Status.CREATED).entity(activity).build(); - } catch (JSONException e) { - String errorMessage = "Invalid payload for the operation."; - log.error(errorMessage); - throw new BadRequestException( - new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } catch (InvalidDeviceException e) { String errorMessage = "Invalid Device Identifiers found."; log.error(errorMessage, e); @@ -616,7 +615,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe @POST @Path("/uninstall-application") @Override - public Response uninstallApplication(ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper) { + public Response uninstallApplication( + ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper) { if (log.isDebugEnabled()) { log.debug("Invoking 'UninstallApplication' operation"); } @@ -1022,6 +1022,46 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe new ErrorResponse.ErrorResponseBuilder().setCode(500L).setMessage(errorMessage).build()); } } + @POST + @Path("/send-app-conf") + @Override + public Response sendApplicationConfiguration( + ApplicationRestrictionBeanWrapper applicationRestrictionBeanWrapper) { + if (log.isDebugEnabled()) { + log.debug("Invoking 'send application configuration' operation"); + } + + try { + if (applicationRestrictionBeanWrapper == null || applicationRestrictionBeanWrapper.getOperation() == null) { + String errorMessage = "The payload of the application configuration operation is incorrect"; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + ApplicationRestriction applicationRestriction = applicationRestrictionBeanWrapper.getOperation(); + ProfileOperation operation = new ProfileOperation(); + operation.setCode(AndroidConstants.OperationCodes.REMOTE_APP_CONFIG); + operation.setType(Operation.Type.PROFILE); + operation.setPayLoad(applicationRestriction.toJSON()); + return (Response) AndroidAPIUtils.getOperationResponse(applicationRestrictionBeanWrapper.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()); + } + } private static void validateApplicationUrl(String apkUrl) { try { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java index f8c37fe5ff..318c23d83d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java @@ -23,12 +23,26 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.analytics.api.AnalyticsDataAPI; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService; +import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService; import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; +import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; +import org.wso2.carbon.mdm.services.android.exception.BadRequestException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; + +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; + /** * AndroidAPIUtil class provides utility functions used by Android REST-API classes. */ @@ -135,4 +149,25 @@ public class AndroidAPIUtils { return analyticsDataAPI; } + public static Response getOperationResponse(List deviceIDs, Operation operation) + throws DeviceManagementException, OperationManagementException, InvalidDeviceException { + if (deviceIDs == null || deviceIDs.size() == 0) { + String errorMessage = "Device identifier list is empty"; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + DeviceIdentifier deviceIdentifier; + List deviceIdentifiers = new ArrayList<>(); + for (String deviceId : deviceIDs) { + deviceIdentifier = new DeviceIdentifier(); + deviceIdentifier.setId(deviceId); + deviceIdentifier.setType(AndroidConstants.DEVICE_TYPE_ANDROID); + deviceIdentifiers.add(deviceIdentifier); + } + Activity activity = getDeviceManagementService().addOperation( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, operation, deviceIdentifiers); + return Response.status(Response.Status.CREATED).entity(activity).build(); + } + } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java index 96842c956a..9db77c7f4f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java @@ -140,6 +140,7 @@ public final class AndroidConstants { public static final String WORK_PROFILE = "WORK_PROFILE"; public static final String NOTIFIER_FREQUENCY = "NOTIFIER_FREQUENCY"; public static final String GLOBAL_PROXY = "SET_GLOBAL_PROXY"; + public static final String REMOTE_APP_CONFIG = "REMOTE_APP_CONFIG"; } public final class StatusCodes { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index d5303db9af..03ea85da5c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -500,6 +500,15 @@ var generatePayload = function (operationCode, operationData, deviceList) { } }; break; + case androidOperationConstants["APP_RESTRICTION_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "appIdentifier": operationData["app-id"], + "restrictionPayload": operationData["payload"] + } + }; + break; default: // If the operation is neither of above, it is a command operation operationType = operationTypeConstants["COMMAND"]; @@ -564,6 +573,7 @@ var androidOperationConstants = { "SYSTEM_UPDATE_POLICY_CODE": "SYSTEM_UPDATE_POLICY", "KIOSK_APPS_CODE": "KIOSK_APPS", "FILE_TRANSFER": "FILE_TRANSFER", + "APP_RESTRICTION_OPERATION_CODE": "REMOTE_APP_CONFIG", "KEY_RESTRICTIONS_PENDING": "KEY_RESTRICTIONS_PENDING", "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs index 8550778a81..ac49af29e6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs @@ -495,19 +495,19 @@ -
-
- -
+ + + + + + + + + + + + +
    @@ -654,6 +654,7 @@
+
-
- -
- -
+ + + + + + + + + + + + +

diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs index 41d8243029..ad289d9fa6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs @@ -505,18 +505,18 @@ -
-
- -
+ + + + + + + + + + + +
    diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json index 1f8a820102..82394b2583 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json @@ -36,7 +36,8 @@ "perm:android:unlock-devices", "perm:android:control-camera", "perm:android:reboot", - "perm:android:logcat" + "perm:android:logcat", + "perm:android:send-app-restrictions" ], "features": { "DEVICE_RING": { @@ -214,6 +215,24 @@ } ], "permission": "/device-mgt/devices/owning-device/operations/android/wipe" + }, + "REMOTE_APP_CONFIG": { + "icon": "fw-lock", + "formParams": [ + { + "type": "text", + "id": "app-id", + "optional": false, + "label": "Application identifier" + }, + { + "type": "text", + "id": "payload", + "optional": false, + "label": "Application restriction payload" + } + ], + "permission": "/device-mgt/devices/owning-device/operations/android/send-app-conf" } } } diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml index 68e66b36b0..002546d336 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml @@ -384,6 +384,13 @@ Unlock the device Unlock the device + + Send app restriction + Send remote configurations to app + + + true From 582005f3f6e000a3b35960723eb9d3f6acb9dc7a Mon Sep 17 00:00:00 2001 From: sandarudr Date: Fri, 24 May 2019 14:55:54 +0530 Subject: [PATCH 3/5] Remove unnecessary policies --- .../public/js/operation-bar.js | 2 -- .../public/js/operation-mod.js | 5 ----- .../public/templates/android-policy-edit.hbs | 13 ------------- .../public/templates/android-policy-view.hbs | 14 +------------- .../public/templates/android-policy-operations.hbs | 12 ------------ .../mobile/android/impl/AndroidFeatureManager.java | 6 ------ .../src/main/resources/devicetypes/android.xml | 4 ---- 7 files changed, 1 insertion(+), 55 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index 03ea85da5c..e8a99b80e4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -338,7 +338,6 @@ var generatePayload = function (operationCode, operationData, deviceList) { "AUTO_TIME": operationData["enableAutoTime"], "SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"], "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"], - "KEY_RESTRICTIONS_PENDING": operationData["keyRestrictionsPending"], "DISALLOW_SET_WALLPAPER": operationData["disallowSetWallpaper"], "DISALLOW_SET_USER_ICON": operationData["disallowSetUserIcon"], "DISALLOW_REMOVE_MANAGEMENT_PROFILE": operationData["disallowRemoveManagedProfile"], @@ -574,7 +573,6 @@ var androidOperationConstants = { "KIOSK_APPS_CODE": "KIOSK_APPS", "FILE_TRANSFER": "FILE_TRANSFER", "APP_RESTRICTION_OPERATION_CODE": "REMOTE_APP_CONFIG", - "KEY_RESTRICTIONS_PENDING": "KEY_RESTRICTIONS_PENDING", "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", "DISALLOW_REMOVE_MANAGEMENT_PROFILE": "DISALLOW_REMOVE_MANAGEMENT_PROFILE", diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js index 9a7309233c..291e71d40f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js @@ -100,7 +100,6 @@ var androidOperationModule = function () { "COSU_PROFILE_CONFIGURATION_OPERATION": "cosu-profile-configuration", "COSU_PROFILE_CONFIGURATION_OPERATION_CODE": "COSU_PROFILE", "ENROLLMENT_APP_INSTALL": "enrollment-app-install", - "KEY_RESTRICTIONS_PENDING": "KEY_RESTRICTIONS_PENDING", "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", "DISALLOW_REMOVE_MANAGEMENT_PROFILE": "DISALLOW_REMOVE_MANAGEMENT_PROFILE", @@ -352,7 +351,6 @@ var androidOperationModule = function () { "ENSURE_VERIFY_APPS": operationData["ensureVerifyApps"], "AUTO_TIME": operationData["enableAutoTime"], "SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"], - "KEY_RESTRICTIONS_PENDING": operationData["keyRestrictionsPending"], "DISALLOW_SET_WALLPAPER": operationData["disallowSetWallpaper"], "DISALLOW_SET_USER_ICON": operationData["disallowSetWallpaper"], "DISALLOW_REMOVE_MANAGEMENT_PROFILE": operationData["disallowRemoveManagedProfile"], @@ -1216,9 +1214,6 @@ var androidOperationModule = function () { } else if (featureCode == androidOperationConstants["SET_STATUS_BAR_DISABLED"]) { restrictions["disableStatusBar"] = restriction["enabled"]; continue; - }else if (featureCode == androidOperationConstants["KEY_RESTRICTIONS_PENDING"]) { - restrictions["keyRestrictionsPending"] = restriction["enabled"]; - continue; }else if (featureCode == androidOperationConstants["DISALLOW_SET_WALLPAPER"]) { restrictions["disallowSetWallpaper"] = restriction["enabled"]; continue; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs index ac49af29e6..7a65d49f21 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs @@ -495,19 +495,6 @@
- - - - - - - - - - - - -
    diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs index 6b1c66e177..9a92054a72 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs @@ -729,19 +729,7 @@
- - - - - - - - - - - - - +

diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs index ad289d9fa6..212f334b9c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs @@ -505,18 +505,6 @@ - - - - - - - - - - - -
    diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java index 70ff5d4e06..6af4e16ab6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java @@ -469,12 +469,6 @@ public class AndroidFeatureManager implements FeatureManager { feature.setDescription("Unlock the device"); supportedFeatures.add(feature); - feature = new Feature(); - feature.setCode("KEY_RESTRICTIONS_PENDING"); - feature.setName("Device Unlock"); - feature.setDescription("Unlock the device"); - supportedFeatures.add(feature); - feature = new Feature(); feature.setCode("DISALLOW_SET_WALLPAPER"); feature.setName("Device Unlock"); diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml index 002546d336..6fccf219f7 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml @@ -343,10 +343,6 @@ Fetch device logcat Fetch device logcat - - Fetch device logcat - Fetch device logcat - Fetch device logcat Fetch device logcat From 3c368d94a63fd27a8e7d16249ec22a7b2e61f5b3 Mon Sep 17 00:00:00 2001 From: Milan Perera Date: Fri, 17 May 2019 11:33:40 +0530 Subject: [PATCH 4/5] Add always on VPN policy --- .../public/js/operation-bar.js | 3 +- .../public/js/operation-mod.js | 8 ++- .../public/js/android-policy-edit.js | 38 +++++++++--- .../public/templates/android-policy-edit.hbs | 56 +++++++++++++++++ .../public/templates/android-policy-view.hbs | 58 ++++++++++++++++- .../public/js/android-policy-operations.js | 36 ++++++++--- .../templates/android-policy-operations.hbs | 62 ++++++++++++++++++- 7 files changed, 237 insertions(+), 24 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index e8a99b80e4..de213aebb5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -426,7 +426,8 @@ var generatePayload = function (operationCode, operationData, deviceList) { payload = { "operation": { "type": operationData["type"], - "openvpn_config": operationData["openvpn_config"] + "openvpn_config": operationData["openvpn_config"], + "packageName": operationData["packageName"] } }; break; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js index 291e71d40f..dbea0923c2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js @@ -174,7 +174,8 @@ var androidOperationModule = function () { case androidOperationConstants["VPN_OPERATION_CODE"]: payload = { "type": operationPayload["type"], - "openvpn_config": operationPayload["openvpn_config"] + "openvpn_config": operationPayload["openvpn_config"], + "packageName": operationPayload["packageName"] }; break; case androidOperationConstants["APPLICATION_OPERATION_CODE"]: @@ -439,7 +440,8 @@ var androidOperationModule = function () { payload = { "operation": { "type": operationData["type"], - "openvpn_config": operationData["openvpn_config"] + "openvpn_config": operationData["openvpn_config"], + "packageName": operationData["packageName"] } }; break; @@ -1251,4 +1253,4 @@ var androidOperationModule = function () { }; return publicMethods; -}(); \ No newline at end of file +}(); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js index f00f61f306..f5b6fc4f44 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js @@ -590,14 +590,34 @@ var validatePolicyProfile = function () { // initializing continueToCheckNextInputs to true continueToCheckNextInputs = true; - var openvpnConfig = $("#openvpn-config").val(); - if (!openvpnConfig || openvpnConfig === '') { - validationStatus = { - "error": true, - "subErrorMsg": "ovpn config required. You cannot proceed.", - "erroneousFeature": operation - }; - continueToCheckNextInputs = false; + let openVpnConfigEnabled = document.getElementById('vpn-body').classList.contains('in'); + if (openVpnConfigEnabled) { + var openvpnConfig = $("textarea#openvpn-config").val(); + if (!openvpnConfig || openvpnConfig === '') { + validationStatus = { + "error": true, + "subErrorMsg": "ovpn config file is required. You cannot proceed.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + } + + if (validationStatus) { + validationStatusArray.push(validationStatus); + } + + let alwaysOnVpnEnabled = document.getElementById('always-on-vpn-body').classList.contains('in'); + if (alwaysOnVpnEnabled) { + var alwaysOnConfig = $("input#vpn-client-app").val(); + if (!alwaysOnConfig || alwaysOnConfig === '') { + validationStatus = { + "error": true, + "subErrorMsg": "Add a valid package name for the VPN client", + "erroneousFeature": "always-on-vpn" + }; + continueToCheckNextInputs = false; + } } // at-last, if the value of continueToCheckNextInputs is still true @@ -1317,4 +1337,4 @@ $(document).ready(function () { $(this).removeClass("child-input"); }); }); -}); \ No newline at end of file +}); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs index 7a65d49f21..4d8d7a21e7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs @@ -1357,6 +1357,62 @@
+ + + + + +
+
+ + +
+ +
+ + +
+ + + + + + + + + + + + + +
+ + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs index 9a92054a72..a743f5793e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs @@ -2246,6 +2246,62 @@ data-key="openvpn_config" style="height: 400px;" disabled> + + + + + +
+
+ + +
+ +
+ + +
+ + + + + + + + + + + + + +
+ + @@ -2914,4 +2970,4 @@ - \ No newline at end of file + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js index 5554413f2a..5ae4076b3a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js @@ -524,17 +524,35 @@ var validatePolicyProfile = function () { operation = androidOperationConstants["VPN_OPERATION"]; // initializing continueToCheckNextInputs to true continueToCheckNextInputs = true; + let openVpnConfigEnabled = document.getElementById('vpn-body').classList.contains('in'); + if (openVpnConfigEnabled) { + var openvpnConfig = $("input#openvpn-config").val(); + if (!openvpnConfig || openvpnConfig === '') { + validationStatus = { + "error": true, + "subErrorMsg": "ovpn config file is required. You cannot proceed.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + } - var openvpnConfig = $("input#openvpn-config").val(); - if (!openvpnConfig || openvpnConfig === '') { - validationStatus = { - "error": true, - "subErrorMsg": "ovpn config file is required. You cannot proceed.", - "erroneousFeature": operation - }; - continueToCheckNextInputs = false; + if (validationStatus) { + validationStatusArray.push(validationStatus); } + let alwaysOnVpnEnabled = document.getElementById('always-on-vpn-body').classList.contains('in'); + if (alwaysOnVpnEnabled) { + var alwaysOnConfig = $("input#vpn-client-app").val(); + if (!alwaysOnConfig || alwaysOnConfig === '') { + validationStatus = { + "error": true, + "subErrorMsg": "Add a valid package name for the VPN client", + "erroneousFeature": "always-on-vpn" + }; + continueToCheckNextInputs = false; + } + } // at-last, if the value of continueToCheckNextInputs is still true // this means that no error is found if (continueToCheckNextInputs) { @@ -1294,4 +1312,4 @@ $(document).ready(function () { $(this).removeClass("child-input"); }); }); -}); \ No newline at end of file +}); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs index 212f334b9c..00fbf2794b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs @@ -2265,7 +2265,67 @@ +
+ + + + + + + +
+
+ + +
+ +
+ + +
+ + + + + + + + + + + + +
+ + @@ -2868,4 +2928,4 @@ - \ No newline at end of file + From 8fe0dd01d9a2b3234120d20ac1a3f1ec185c2c6d Mon Sep 17 00:00:00 2001 From: sandarudr Date: Fri, 24 May 2019 17:12:24 +0530 Subject: [PATCH 5/5] Add missing lines --- .../public/js/operation-mod.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js index dbea0923c2..01a609a14b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js @@ -100,6 +100,7 @@ var androidOperationModule = function () { "COSU_PROFILE_CONFIGURATION_OPERATION": "cosu-profile-configuration", "COSU_PROFILE_CONFIGURATION_OPERATION_CODE": "COSU_PROFILE", "ENROLLMENT_APP_INSTALL": "enrollment-app-install", + "ENROLLMENT_APP_INSTALL_CODE": "ENROLLMENT_APP_INSTALL", "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", "DISALLOW_REMOVE_MANAGEMENT_PROFILE": "DISALLOW_REMOVE_MANAGEMENT_PROFILE",