Implement enable device backup service restriction in android plugins

revert-dabc3590
achala piyarathna 6 years ago committed by Charitha Goonetilleke
parent b899c2a499
commit 033067fa8f

@ -323,6 +323,7 @@ var generatePayload = function (operationCode, operationData, deviceList) {
payload = {
"operation": {
"CAMERA": operationData["cameraEnabled"],
"BACKUP_SERVICE": operationData["enableBackupService"],
"DISALLOW_ADJUST_VOLUME": operationData["disallowAdjustVolumeEnabled"],
"DISALLOW_CONFIG_BLUETOOTH": operationData["disallowConfigBluetooth"],
"DISALLOW_CONFIG_CELL_BROADCASTS": operationData["disallowConfigCellBroadcasts"],
@ -546,6 +547,7 @@ var androidOperationConstants = {
"PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY",
"VPN_OPERATION_CODE": "VPN",
"CAMERA_OPERATION_CODE": "CAMERA",
"BACKUP_SERVICE_CODE": "BACKUP_SERVICE",
"ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE",
"WIFI_OPERATION_CODE": "WIFI",
"WIPE_OPERATION_CODE": "WIPE_DATA",

@ -50,6 +50,7 @@ var androidOperationModule = function () {
"PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY",
"VPN_OPERATION_CODE": "VPN",
"CAMERA_OPERATION_CODE": "CAMERA",
"BACKUP_SERVICE_CODE": "BACKUP_SERVICE",
"ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE",
"WIFI_OPERATION_CODE": "WIFI",
"GLOBAL_PROXY_OPERATION_CODE": "GLOBAL_PROXY",
@ -333,6 +334,7 @@ var androidOperationModule = function () {
payload = {
"operation": {
"CAMERA": operationData["cameraEnabled"],
"BACKUP_SERVICE": operationData["enableBackupService"],
"DISALLOW_ADJUST_VOLUME": operationData["disallowAdjustVolumeEnabled"],
"DISALLOW_CONFIG_BLUETOOTH": operationData["disallowConfigBluetooth"],
"DISALLOW_CONFIG_CELL_BROADCASTS": operationData["disallowConfigCellBroadcasts"],
@ -707,6 +709,7 @@ var androidOperationModule = function () {
"WIFI": "configure-wifi",
"GLOBAL_PROXY": "configure-global-proxy",
"CAMERA": "control-camera",
"BACKUP_SERVICE": "enable-backup",
"VPN": "configure-vpn",
"DEVICE_LOCK": "lock-devices",
"DEVICE_UNLOCK": "unlock-devices",
@ -1141,6 +1144,9 @@ var androidOperationModule = function () {
} else if (featureCode == androidOperationConstants["DISALLOW_ADJUST_VOLUME"]) {
restrictions["disallowAdjustVolumeEnabled"] = restriction["enabled"];
continue;
} else if (featureCode == androidOperationConstants["BACKUP_SERVICE_CODE"]) {
restrictions["enableBackupService"] = restriction["enabled"];
continue;
} else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_BLUETOOTH"]) {
restrictions["disallowConfigBluetooth"] = restriction["enabled"];
continue;

@ -862,6 +862,17 @@
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="backup-service-enabled" type="checkbox" class="operationDataKeys"
data-key="enableBackupService"/>
<span class="helper" title="Device backup service will be enabled.">
Enable device backup service
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
{{/unless}}
</div>
</div>

@ -866,6 +866,18 @@
</span>
</label>
</div>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="backup-service-enabled" type="checkbox" class="operationDataKeys"
data-key="enableBackupService" disabled/>
<span class="helper" title="Having this checked would enable backup service.">
Enable device backup service
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
{{/unless}}
</div>
</div>

@ -880,6 +880,17 @@
</label>
</div>
<br>
<div class="wr-input-control device-owner">
<label class="wr-input-control checkbox">
<input id="backup-service-enabled" type="checkbox" class="operationDataKeys"
data-key="enableBackupService"/>
<span class="helper" title="Device backup service will be enabled">
Enable device backup service
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
{{/unless}}
</div>
</div>

@ -209,11 +209,19 @@ public class AndroidFeatureManager implements FeatureManager {
feature.setName("wifi");
feature.setDescription("Setting up wifi configuration");
supportedFeatures.add(feature);
feature = new Feature();
feature.setCode("CAMERA");
feature.setName("camera");
feature.setDescription("Enable or disable camera");
supportedFeatures.add(feature);
feature = new Feature();
feature.setCode("BACKUP_SERVICE");
feature.setName("Set Backup Service");
feature.setDescription("set backup service");
supportedFeatures.add(feature);
feature = new Feature();
feature.setCode("EMAIL");
feature.setName("Email");

@ -605,6 +605,10 @@
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature type="policy" code="BACKUP_SERVICE">
<Name>Enable Backup Service</Name>
<Description>Enable or disable backup service</Description>
</Feature>
<Feature type="operation" hidden="false" code="DEVICE_UNLOCK">
<Name>Unlock the device</Name>
<Description>Unlock the device</Description>

Loading…
Cancel
Save