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 f01769a991..98c10f832d 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 @@ -49,6 +49,7 @@ var androidOperationModule = function () { var androidOperationConstants = { "PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY", "VPN_OPERATION_CODE": "VPN", + "APN_OPERATION_CODE": "APN", "CAMERA_OPERATION_CODE": "CAMERA", "BACKUP_SERVICE_CODE": "BACKUP_SERVICE", "ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE", @@ -67,6 +68,7 @@ var androidOperationModule = function () { "DISALLOW_CONFIG_MOBILE_NETWORKS": "DISALLOW_CONFIG_MOBILE_NETWORKS", "DISALLOW_CONFIG_TETHERING": "DISALLOW_CONFIG_TETHERING", "DISALLOW_CONFIG_VPN": "DISALLOW_CONFIG_VPN", + "DISALLOW_CONFIG_APN": "DISALLOW_CONFIG_APN", "DISALLOW_CONFIG_WIFI": "DISALLOW_CONFIG_WIFI", "DISALLOW_APPS_CONTROL": "DISALLOW_APPS_CONTROL", "DISALLOW_CREATE_WINDOWS": "DISALLOW_CREATE_WINDOWS", @@ -180,6 +182,30 @@ var androidOperationModule = function () { "wifiCaCertName": operationPayload["cacertName"] }; break; + case androidOperationConstants["APN_OPERATION_CODE"]: + payload = { + "apnName": operationPayload["name"], + "apnApn": operationPayload["apn"], + "apnProxyAddress": operationPayload["proxyAddress"], + "apnProxyPort": operationPayload["proxyPort"], + "apnUsername": operationPayload["username"], + "apnPassword": operationPayload["password"], + "apnServer": operationPayload["server"], + "apnMMSC": operationPayload["mMSC"], + "apnMMSProxyAddress": operationPayload["mmsProxyAddress"], + "apnMMSProxyPort": operationPayload["mMSProxyPort"], + "apnMCC": operationPayload["mCC"], + "apnMNC": operationPayload["mNC"], + "apnAuthenticationType": operationPayload["authenticationType"], + "apnType": operationPayload["type"], + "apnProtocol": operationPayload["protocol"], + "apnRoamingProtocol": operationPayload["roamingProtocol"], + "apnIsEnable": operationPayload["isEnable"], + "apnBearer": operationPayload["bearer"], + "apnMVNOType": operationPayload["mVNOType"], + "apnMVNOValue": operationPayload["mVNOValue"] + }; + break; case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]: payload = { "proxyConfigType": operationPayload["proxyConfigType"], @@ -372,6 +398,7 @@ var androidOperationModule = function () { "DISALLOW_CONFIG_MOBILE_NETWORKS": operationData["disallowConfigMobileNetworks"], "DISALLOW_CONFIG_TETHERING": operationData["disallowConfigTethering"], "DISALLOW_CONFIG_VPN": operationData["disallowConfigVpn"], + "DISALLOW_CONFIG_APN": operationData["disallowConfigApn"], "DISALLOW_CONFIG_WIFI": operationData["disallowConfigWifi"], "DISALLOW_APPS_CONTROL": operationData["disallowAppControl"], "DISALLOW_CREATE_WINDOWS": operationData["disallowCreateWindows"], @@ -469,6 +496,33 @@ var androidOperationModule = function () { } }; break; + case androidOperationConstants["APN_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "name": operationData["apnName"], + "apn": operationData["apnApn"], + "proxyAddress": operationData["apnProxyAddress"], + "proxyPort": operationData["apnProxyPort"], + "username": operationData["apnUsername"], + "password": operationData["apnPassword"], + "server": operationData["apnServer"], + "mMSC": operationData["apnMMSC"], + "mmsProxyAddress": operationData["apnMMSProxyAddress"], + "mMSProxyPort": operationData["apnMMSProxyPort"], + "mCC": operationData["apnMCC"], + "mNC": operationData["apnMNC"], + "authenticationType": operationData["apnAuthenticationType"], + "type": operationData["apnType"], + "protocol": operationData["apnProtocol"], + "roamingProtocol": operationData["apnRoamingProtocol"], + "isEnable": operationData["apnIsEnable"], + "bearer": operationData["apnBearer"], + "mVNOType": operationData["apnMVNOType"], + "mVNOValue": operationData["apnMVNOValue"] + } + }; + break; case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]: operationType = operationTypeConstants["PROFILE"]; payload = { @@ -776,6 +830,7 @@ var androidOperationModule = function () { "CAMERA": "control-camera", "BACKUP_SERVICE": "enable-backup", "VPN": "configure-vpn", + "APN": "configure-apn", "DEVICE_LOCK": "lock-devices", "DEVICE_UNLOCK": "unlock-devices", "DEVICE_LOCATION": "location", @@ -1262,6 +1317,9 @@ var androidOperationModule = function () { } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_VPN"]) { restrictions["disallowConfigVpn"] = restriction["enabled"]; continue; + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_APN"]) { + restrictions["disallowConfigApn"] = restriction["enabled"]; + continue; } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_WIFI"]) { restrictions["disallowConfigWifi"] = restriction["enabled"]; continue; @@ -1377,4 +1435,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 819c46ea9a..4b2bc2bf25 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 @@ -49,6 +49,8 @@ var androidOperationConstants = { "GLOBAL_PROXY_OPERATION_CODE": "GLOBAL_PROXY", "VPN_OPERATION": "vpn", "VPN_OPERATION_CODE": "VPN", + "APN_OPERATION": "apn", + "APN_OPERATION_CODE": "APN", "APPLICATION_OPERATION": "app-restriction", "APPLICATION_OPERATION_CODE": "APP-RESTRICTION", "KIOSK_APPS_CODE": "KIOSK_APPS", @@ -953,6 +955,89 @@ var validatePolicyProfile = function () { validationStatusArray.push(validationStatus); } + // Validating APN + if ($.inArray(androidOperationConstants["APN_OPERATION_CODE"], configuredOperations) !== -1) { + // if APN is configured + operation = androidOperationConstants["APN_OPERATION"]; + // initializing continueToCheckNextInputs to true + continueToCheckNextInputs = true; + + var apnName= $("input#apn-name").val(); + var apnProxyPort = $("input#apn-proxy-port").val(); + var apnMMSProxyPort = $("input#apn-mms-proxy-port").val(); + var apnMCC = $("input#apn-mcc").val(); + var apnMNC = $("input#apn-mnc").val(); + + if (!apnName) { + validationStatus = { + "error": true, + "subErrorMsg": "APN name is required.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnProxyPort)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN Proxy port requires a number input.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } else if (!inputIsValidAgainstRange(apnProxyPort, 0, 65535)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN Proxy port is not within the range of valid port numbers.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnMMSProxyPort)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MMS proxy port requires a number input.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } else if (!inputIsValidAgainstRange(apnMMSProxyPort, 0, 65535)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MMS proxy port is not within the range of valid port numbers.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnMCC)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MCC requires a number input.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnMNC)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MNC requires a number input.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + // at-last, if the value of continueToCheckNextInputs is still true + // this means that no error is found + if (continueToCheckNextInputs) { + validationStatus = { + "error": false, + "okFeature": operation + }; + } + validationStatusArray.push(validationStatus); + } + // Validating PROXY if ($.inArray(androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"], configuredOperations) !== -1) { // if PROXY is configured 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 ec1d532b7e..f57a3bd5c0 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 @@ -75,6 +75,15 @@ + + + + + + Access Point Name + + + @@ -1635,6 +1644,321 @@ + +
+
+ +
+
+ Please note that * sign represents required fields of data. +
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ + +
+
+
+
+ +
+ + + + + + Access Point Name + + + + + @@ -1295,6 +1306,318 @@
+ +
+
+ +
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ + +
+
+
+
+ +
+ + +
+
+ +
+
+ Please note that * sign represents required fields of data. +
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ + +
+
+
+
+ +
@@ -2564,7 +2891,6 @@
-