Merge branch 'addRes' into 'master'

Add new device restriction policies to the android plugins

See merge request entgra/carbon-device-mgt-plugins!42
revert-dabc3590
Inosh Perara 6 years ago
commit c42019a5db

@ -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}}

@ -337,7 +337,15 @@ 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"],
"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;
@ -565,5 +573,13 @@ 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"
"APP_RESTRICTION_OPERATION_CODE": "REMOTE_APP_CONFIG",
"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"
};

@ -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"
"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",
"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"
};
/**
@ -345,7 +353,14 @@ var androidOperationModule = function () {
"ENSURE_VERIFY_APPS": operationData["ensureVerifyApps"],
"AUTO_TIME": operationData["enableAutoTime"],
"SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"],
"SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"]
"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;
@ -1202,6 +1217,30 @@ var androidOperationModule = function () {
} else if (featureCode == androidOperationConstants["SET_STATUS_BAR_DISABLED"]) {
restrictions["disableStatusBar"] = 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);

@ -356,6 +356,7 @@
<b>work-profile owner</b> or <b>device owner</b>.</a>
</ul>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-credentials-enabled" type="checkbox"
@ -495,6 +496,100 @@
</label>
</div>
<br>
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="policy-listing-status-msg">Below restrictions will be applied on devices with
Android
version 6.0 Marshmallow onwards only.</a>
</ul>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-set-wallpeper" type="checkbox"
class="operationDataKeys"
data-key="disallowSetWallpaper"/>
<span class="helper" title="Users are restricted from setting wallpapers.">
Disallow set wallpaper
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-set-user-icon" type="checkbox"
class="operationDataKeys"
data-key="disallowSetUserIcon"/>
<span class="helper" title="Users are restricted from changing their icon.">
Disallow set user icon
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-remove-managed-profile" type="checkbox"
class="operationDataKeys"
data-key="disallowRemoveManagedProfile"/>
<span class="helper" title="Users are restricted from removing the managed profile.">
Disallow remove managed profile
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-autofill" type="checkbox"
class="operationDataKeys"
data-key="disallowAutoFill"/>
<span class="helper" title="Users are restricted from using Autofill services.">
Disallow autofill
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-bluetooth" type="checkbox"
class="operationDataKeys"
data-key="disallowBluetooth"/>
<span class="helper" title="Bluetooth is disallowed on the device">
Disallow bluetooth
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-bluetooth-sharing" type="checkbox"
class="operationDataKeys"
data-key="disallowBluetoothSharing"/>
<span class="helper" title="Users are restricted from Bluetooth sharing on the device.">
Disallow bluetooth sharing
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-remove-user" type="checkbox"
class="operationDataKeys"
data-key="disallowRemoveUser"/>
<span class="helper" title="Users are restricted from removing user itself.">
Disallow remove user
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<br>
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
@ -502,6 +597,7 @@
<b>device owner</b>.</a>
</ul>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-SMS-enabled" type="checkbox" class="operationDataKeys"
@ -545,6 +641,7 @@
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="volume-adjust-enabled" type="checkbox" class="operationDataKeys"
@ -732,6 +829,7 @@
version 6.0 Marshmallow onwards only.</a>
</ul>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disable-status-bar-enabled" type="checkbox" class="operationDataKeys"
@ -743,6 +841,19 @@
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-data-roaming" type="checkbox"
class="operationDataKeys"
data-key="disallowDataRoaming"/>
<span class="helper"
title="Users are restricted from using cellular data when roaming.">
Disallow data roaming
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
{{/unless}}
</div>
</div>

@ -729,6 +729,7 @@
</span>
</label>
</div>
<br>
<br>
<b>
@ -747,6 +748,109 @@
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-set-wallpeper" type="checkbox"
class="operationDataKeys"
data-key="disallowSetWallpaper" disabled/>
<span class="helper" title="Users are restricted from setting wallpapers.">
Disallow set wallpaper
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-set-user-icon" type="checkbox"
class="operationDataKeys"
data-key="disallowSetUserIcon" disabled/>
<span class="helper" title="Users are restricted from changing their icon.">
Disallow set user icon
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-remove-managed-profile" type="checkbox"
class="operationDataKeys"
data-key="disallowRemoveManagedProfile" disabled/>
<span class="helper" title="Users are restricted from removing the managed profile.">
Disallow Remove Managed Profile
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-autofill" type="checkbox"
class="operationDataKeys"
data-key="disallowAutoFill" disabled/>
<span class="helper" title="Users are restricted from using Autofill services.">
Disallow autofill
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-bluetooth" type="checkbox"
class="operationDataKeys"
data-key="disallowBluetooth" disabled/>
<span class="helper" title="Bluetooth is disallowed on the device">
Disallow bluetooth
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-bluetooth-sharing" type="checkbox"
class="operationDataKeys"
data-key="disallowBluetoothSharing" disabled/>
<span class="helper" title="Users are restricted from Bluetooth sharing on the device.">
Disallow bluetooth sharing
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-remove-user" type="checkbox"
class="operationDataKeys"
data-key="disallowRemoveUser" disabled/>
<span class="helper" title="Users are restricted from removing user itself.">
Disallow remove user
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-data-roaming" type="checkbox"
class="operationDataKeys"
data-key="disallowDataRoaming" disabled/>
<span class="helper" title="Users are restricted from using cellular data when roaming.">
Disallow data roaming
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
{{/unless}}
</div>
</div>

@ -506,6 +506,98 @@
</label>
</div>
<br>
<div class="">
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="policy-listing-status-msg">Below restrictions will be applied on devices with
Android version 6.0 Marshmallow onwards only.</a>
</ul>
</div>
<br>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-set-wallpeper" type="checkbox"
class="operationDataKeys"
data-key="disallowSetWallpaper"/>
<span class="helper" title="Users are restricted from setting wallpapers.">
Disallow set wallpaper
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-set-user-icon" type="checkbox"
class="operationDataKeys"
data-key="disallowSetUserIcon"/>
<span class="helper" title="Users are restricted from changing their icon.">
Disallow set user icon
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-remove-managed-profile" type="checkbox"
class="operationDataKeys"
data-key="disallowRemoveManagedProfile"/>
<span class="helper" title="Users are restricted from removing the managed profile.">
Disallow Remove Managed Profile
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-autofill" type="checkbox"
class="operationDataKeys"
data-key="disallowAutoFill"/>
<span class="helper" title="Users are restricted from using Autofill services.">
Disallow autofill
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-bluetooth" type="checkbox"
class="operationDataKeys"
data-key="disallowBluetooth"/>
<span class="helper" title="Bluetooth is disallowed on the device">
Disallow bluetooth
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-bluetooth-sharing" type="checkbox"
class="operationDataKeys"
data-key="disallowBluetoothSharing"/>
<span class="helper" title="Users are restricted from Bluetooth sharing on the device.">
Disallow bluetooth sharing
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-remove-user" type="checkbox"
class="operationDataKeys"
data-key="disallowRemoveUser"/>
<span class="helper" title="Users are restricted from removing user itself.">
Disallow remove user
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="device-owner">
<ul class="message message-info device-owner">
<i class="icon fw fw-info"></i>
@ -558,6 +650,7 @@
</span>
</label>
</div>
<br>
<div class="wr-input-control device-owner">
<label class="wr-input-control checkbox">
<input id="volume-adjust-enabled" type="checkbox" class="operationDataKeys"
@ -766,6 +859,18 @@
</label>
</div>
<br>
<div class="wr-input-control device-owner">
<label class="wr-input-control checkbox">
<input id="disallow-data-roaming" type="checkbox"
class="operationDataKeys"
data-key="disallowDataRoaming"/>
<span class="helper" title="Users are restricted from using cellular data when roaming.">
Disallow data roaming
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
{{/unless}}
</div>
</div>

@ -469,6 +469,54 @@ public class AndroidFeatureManager implements FeatureManager {
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;
}
}

@ -343,6 +343,39 @@
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_SET_WALLPAPER">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_SET_USER_ICON">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_REMOVE_MANAGEMENT_PROFILE">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_AUTOFILL">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_BLUETOOTH">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_BLUETOOTH_SHARING">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_REMOVE_USER">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DISALLOW_DATA_ROAMING">
<Name>Fetch device logcat</Name>
<Description>Fetch device logcat</Description>
</Feature>
<Feature code="DEVICE_UNLOCK">
<Name>Unlock the device</Name>
<Description>Unlock the device</Description>

Loading…
Cancel
Save