FileDocCategorySizeDatePackage
PacNative.javaAPI DocAndroid 5.1 API2440Thu Mar 12 22:22:42 GMT 2015com.android.pacprocessor

PacNative

public class PacNative extends Object
hide

Fields Summary
private static final String
TAG
private String
mCurrentPac
private boolean
mIsActive
Constructors Summary
PacNative()


    // Only make native calls from inside synchronized blocks.
       
       

        

          

     
        System.loadLibrary("jni_pacprocessor");
    

    
Methods Summary
private native booleancreateV8ParserNativeLocked()

private native booleandestroyV8ParserNativeLocked()

public synchronized booleanisActive()

        return mIsActive;
    
public synchronized java.lang.StringmakeProxyRequest(java.lang.String url, java.lang.String host)

        String ret = makeProxyRequestNativeLocked(url, host);
        if ((ret == null) || (ret.length() == 0)) {
            Log.e(TAG, "v8 Proxy request failed.");
            ret = null;
        }
        return ret;
    
private native java.lang.StringmakeProxyRequestNativeLocked(java.lang.String url, java.lang.String host)

public synchronized booleansetCurrentProxyScript(java.lang.String script)

        if (setProxyScriptNativeLocked(script)) {
            Log.e(TAG, "Unable to parse proxy script.");
            return true;
        }
        return false;
    
private native booleansetProxyScriptNativeLocked(java.lang.String script)

public synchronized booleanstartPacSupport()

        if (createV8ParserNativeLocked()) {
            Log.e(TAG, "Unable to Create v8 Proxy Parser.");
            return true;
        }
        mIsActive = true;
        return false;
    
public synchronized booleanstopPacSupport()

        if (mIsActive) {
            if (destroyV8ParserNativeLocked()) {
                Log.e(TAG, "Unable to Destroy v8 Proxy Parser.");
                return true;
            }
            mIsActive = false;
        }
        return false;