forked from community/device-mgt-plugins
Create the display-message-configuration policy ## Purpose Need to display a message on the lock screen when the device owner is enabled, Need to display a message on the device administrators apps and the disabled settings ## Goals Need to create a policy to show those messages on the devices ## Approach Create a policy to show those messages on the device ## Screenshots ![Screenshot_from_2019-11-03_15-13-34](/uploads/2864b93e78a88f3f3d895e55450eeab5/Screenshot_from_2019-11-03_15-13-34.png) ![Screenshot_from_2019-11-05_00-32-45](/uploads/26238a9da284ea621db232e2147b8e56/Screenshot_from_2019-11-05_00-32-45.png) ![Screenshot_20191105-003837_Settings](/uploads/54003b98cd443152f3131d33d71d2669/Screenshot_20191105-003837_Settings.jpg) ![Screenshot_20191105-003848_Settings](/uploads/b185c1ae37b3035af0857848bc8e6f9b/Screenshot_20191105-003848_Settings.jpg) ![Screenshot_20191105-003823_Entgra_Device_Management_Agent](/uploads/b4678d3ec70609d74f107538884f5656/Screenshot_20191105-003823_Entgra_Device_Management_Agent.jpg) ![Screenshot_20191105-112022_Settings](/uploads/5f7e39e0272ea4e3e64929573df45afe/Screenshot_20191105-112022_Settings.jpg) ## Documentation Android Developer https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#setDeviceOwnerLockScreenInfo(android.content.ComponentName,%20java.lang.CharSequence) https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setLongSupportMessage(android.content.ComponentName,%20java.lang.CharSequence) https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setShortSupportMessage(android.content.ComponentName,%20java.lang.CharSequence) ## Automation tests - Unit tests N/A - Integration tests N/A ## Security checks - Followed secure coding standards? (yes) - Ran FindSecurityBugs plugin and verified report? (no) - Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? (yes) ## Related MRs N/A ## Test environment Ubuntu 18.04 ## Learning N/A See merge request entgra/carbon-device-mgt-plugins!109revert-dabc3590
commit
c5c4e0a5b9
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Entgra (Pvt) Ltd. 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 configuring display message operation.
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "LockScreenMessage", description = "This class represents the information of configuring wifi operation")
|
||||||
|
public class DisplayMessage extends AndroidOperation implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "lockScreenMessage", value = "The message of the lock screen that you wish to configure",
|
||||||
|
required = true)
|
||||||
|
private String lockScreenMessage;
|
||||||
|
@ApiModelProperty(name = "settingAppSupportMessage", value = "The message of the administrators applications that you wish to configure",
|
||||||
|
required = true)
|
||||||
|
private String settingAppSupportMessage;
|
||||||
|
@ApiModelProperty(name = "disabledSettingSupportMessage", value = "The password to connect to the specified Wifi network",
|
||||||
|
required = true)
|
||||||
|
private String disabledSettingSupportMessage;
|
||||||
|
|
||||||
|
public String getLockScreenMessage() {
|
||||||
|
return lockScreenMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLockScreenMessage(String lockScreenMessage) {
|
||||||
|
this.lockScreenMessage = lockScreenMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSettingAppSupportMessage() {
|
||||||
|
return settingAppSupportMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSettingAppSupportMessage(String settingAppSupportMessage) {
|
||||||
|
this.settingAppSupportMessage = settingAppSupportMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisabledSettingSupportMessage() {
|
||||||
|
return disabledSettingSupportMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisabledSettingSupportMessage(String disabledSettingSupportMessage) {
|
||||||
|
this.disabledSettingSupportMessage = disabledSettingSupportMessage;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Entgra (Pvt) Ltd. 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.DisplayMessage;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is used to wrap the Wifi bean with devices.
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "DisplayMessageBeanWrapper",
|
||||||
|
description = "Mapping between display message operation and device list to be applied.")
|
||||||
|
public class DisplayMessageBeanWrapper {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "operation", value = "Information of configuring display message operation", required = true)
|
||||||
|
private DisplayMessage operation;
|
||||||
|
@ApiModelProperty(name = "deviceIDs", value = "List of device Ids", required = true)
|
||||||
|
private List<String> deviceIDs;
|
||||||
|
|
||||||
|
public DisplayMessage getOperation() {
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperation(DisplayMessage operation) {
|
||||||
|
this.operation = operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getDeviceIDs() {
|
||||||
|
return deviceIDs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceIDs(List<String> deviceIDs) {
|
||||||
|
this.deviceIDs = deviceIDs;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue