// Path: OpenVPN-Client/main/src/main/java/com/openvpn/Durai/core/OpenVPNManagement.java
// enum pauseReason {
//     noNetwork,
//     userPause,
//     screenOff
// }


import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
import android.preference.PreferenceManager;
import java.util.LinkedList;
import static com.openvpn.Durai.core.OpenVPNManagement.pauseReason;


                // Set screen state to be disconnected if disconnect pending
                if (screen == connectState.PENDINGDISCONNECT)
                    screen = connectState.DISCONNECTED;

                mManagement.pause(getPauseReason());
            }
        }


        if (!netstatestring.equals(lastStateMsg))
            VpnStatus.logInfo(com.openvpn.Durai.R.string.netstatus, netstatestring);
        lastStateMsg = netstatestring;

    }

    public boolean isUserPaused() {
        return userpause == connectState.DISCONNECTED;
    }

    private boolean shouldBeConnected() {
        return (screen == connectState.SHOULDBECONNECTED && userpause == connectState.SHOULDBECONNECTED &&
                network == connectState.SHOULDBECONNECTED);
    }

    private pauseReason getPauseReason() {
        if (userpause == connectState.DISCONNECTED)
            return pauseReason.userPause;

        if (screen == connectState.DISCONNECTED)

// Path: OpenVPN-Client/main/src/main/java/com/openvpn/Durai/core/OpenVPNManagement.java
// enum pauseReason {
//     noNetwork,
//     userPause,
//     screenOff
// }


// Path: OpenVPN-Client/main/src/main/java/com/openvpn/Durai/core/DeviceStateReceiver.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
import android.preference.PreferenceManager;
import java.util.LinkedList;
import static com.openvpn.Durai.core.OpenVPNManagement.pauseReason;


                // Set screen state to be disconnected if disconnect pending
                if (screen == connectState.PENDINGDISCONNECT)
                    screen = connectState.DISCONNECTED;

                mManagement.pause(getPauseReason());
            }
        }


        if (!netstatestring.equals(lastStateMsg))
            VpnStatus.logInfo(com.openvpn.Durai.R.string.netstatus, netstatestring);
        lastStateMsg = netstatestring;

    }

    public boolean isUserPaused() {
        return userpause == connectState.DISCONNECTED;
    }

    private boolean shouldBeConnected() {
        return (screen == connectState.SHOULDBECONNECTED && userpause == connectState.SHOULDBECONNECTED &&
                network == connectState.SHOULDBECONNECTED);
    }

    private pauseReason getPauseReason() {
        if (userpause == connectState.DISCONNECTED)
            return pauseReason.userPause;

        if (screen == connectState.DISCONNECTED)

            return pauseReason.screenOff;
