Search in sources :

Example 11 with CustomPolicies

use of org.flyve.policies.manager.CustomPolicies in project android-mdm-agent by flyve-mdm.

the class StreamAlarmPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableAlarm(disable);
        return true;
    } catch (Exception ex) {
        FlyveLog.e(this.getClass().getName() + ", process", ex.getMessage());
        return false;
    }
}
Also used : CustomPolicies(org.flyve.policies.manager.CustomPolicies)

Example 12 with CustomPolicies

use of org.flyve.policies.manager.CustomPolicies in project android-mdm-agent by flyve-mdm.

the class StreamMusicPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableSounds(AudioManager.STREAM_MUSIC, disable);
        return true;
    } catch (Exception ex) {
        FlyveLog.e(this.getClass().getName() + ", process", ex.getMessage());
        return false;
    }
}
Also used : CustomPolicies(org.flyve.policies.manager.CustomPolicies)

Example 13 with CustomPolicies

use of org.flyve.policies.manager.CustomPolicies in project android-mdm-agent by flyve-mdm.

the class StreamRingPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableSounds(AudioManager.STREAM_RING, disable);
        return true;
    } catch (Exception ex) {
        FlyveLog.e(this.getClass().getName() + ", process", ex.getMessage());
        return false;
    }
}
Also used : CustomPolicies(org.flyve.policies.manager.CustomPolicies)

Example 14 with CustomPolicies

use of org.flyve.policies.manager.CustomPolicies in project android-mdm-agent by flyve-mdm.

the class UsbAdbPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableADBUsbFileTransferProtocols(disable);
        return true;
    } catch (Exception ex) {
        FlyveLog.e(this.getClass().getName() + ", process", ex.getMessage());
        return false;
    }
}
Also used : CustomPolicies(org.flyve.policies.manager.CustomPolicies)

Example 15 with CustomPolicies

use of org.flyve.policies.manager.CustomPolicies in project android-mdm-agent by flyve-mdm.

the class WifiPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableWifi(disable);
        return true;
    } catch (Exception ex) {
        FlyveLog.e(this.getClass().getName() + ", process", ex.getMessage());
        return false;
    }
}
Also used : CustomPolicies(org.flyve.policies.manager.CustomPolicies)

Aggregations

CustomPolicies (org.flyve.policies.manager.CustomPolicies)22 PoliciesData (org.flyve.mdm.agent.data.database.PoliciesData)3 Context (android.content.Context)1 TelephonyManager (android.telephony.TelephonyManager)1 View (android.view.View)1 Button (android.widget.Button)1 CompoundButton (android.widget.CompoundButton)1 EditText (android.widget.EditText)1 Switch (android.widget.Switch)1 FlyveAdminReceiver (org.flyve.mdm.agent.receivers.FlyveAdminReceiver)1 StorageFolder (org.flyve.mdm.agent.utils.StorageFolder)1 AndroidPolicies (org.flyve.policies.manager.AndroidPolicies)1