Search in sources :

Example 1 with CustomPolicies

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

the class UsbPtpPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disablePTPUsbFileTransferProtocols(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 2 with CustomPolicies

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

the class CustomPhoneStateListener method onCallStateChanged.

public void onCallStateChanged(int state, String incomingNumber) {
    // 0 = CALL_STATE_IDLE (close or no activity)
    // 1 = CALL_STATE_RINGING
    // 2 = CALL_STATE_OFFHOOK (At least one call exists that is dialing, active, or on hold, and no calls are ringing or waiting.)
    FlyveLog.d("Status: " + state);
    final Context context = MDMAgent.getInstance();
    Boolean disable = Boolean.parseBoolean(new PoliciesData(context).getValue(SpeakerphonePolicy.POLICY_NAME).value);
    if (state == 2) {
        // Disable Speaker Phone
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableSpeakerphone(disable);
    }
}
Also used : Context(android.content.Context) PoliciesData(org.flyve.mdm.agent.data.database.PoliciesData) CustomPolicies(org.flyve.policies.manager.CustomPolicies)

Example 3 with CustomPolicies

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

the class RoamingPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableRoaming(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 4 with CustomPolicies

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

the class SpeakerphonePolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableSpeakerphone(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 5 with CustomPolicies

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

the class HostpotTetheringPolicy method process.

@Override
protected boolean process() {
    try {
        boolean disable = Boolean.parseBoolean(this.policyValue.toString());
        CustomPolicies customPolicies = new CustomPolicies(context);
        customPolicies.disableHostpotTethering(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