Java 类org.apache.cordova.api.PluginManager 实例源码

项目:12306-android-Decompile    文件:ExposedJsApi.java   
public ExposedJsApi(PluginManager paramPluginManager, NativeToJsMessageQueue paramNativeToJsMessageQueue)
{
  this.pluginManager = paramPluginManager;
  this.jsMessageQueue = paramNativeToJsMessageQueue;
}
项目:12306-android-Decompile    文件:CordovaWebView.java   
@SuppressLint({"NewApi"})
private void setup()
{
  setInitialScale(0);
  setVerticalScrollBarEnabled(false);
  requestFocusFromTouch();
  WebSettings localWebSettings = getSettings();
  localWebSettings.setJavaScriptEnabled(true);
  localWebSettings.setJavaScriptCanOpenWindowsAutomatically(true);
  localWebSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
  try
  {
    Class[] arrayOfClass = new Class[1];
    arrayOfClass[0] = Boolean.TYPE;
    Method localMethod = WebSettings.class.getMethod("setNavDump", arrayOfClass);
    if (Build.VERSION.SDK_INT < 11)
    {
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Boolean.valueOf(true);
      localMethod.invoke(localWebSettings, arrayOfObject);
    }
    localWebSettings.setSaveFormData(false);
    localWebSettings.setSavePassword(false);
    if (Build.VERSION.SDK_INT > 15)
      Level16Apis.enableUniversalAccess(localWebSettings);
    String str = this.cordova.getActivity().getApplicationContext().getDir("database", 0).getPath();
    if (Build.VERSION.SDK_INT < 11)
    {
      localWebSettings.setDatabaseEnabled(true);
      localWebSettings.setDatabasePath(str);
    }
    localWebSettings.setGeolocationDatabasePath(str);
    localWebSettings.setDomStorageEnabled(true);
    localWebSettings.setGeolocationEnabled(true);
    localWebSettings.setAppCacheMaxSize(5242880L);
    localWebSettings.setAppCachePath(this.cordova.getActivity().getApplicationContext().getDir("database", 0).getPath());
    localWebSettings.setAppCacheEnabled(true);
    updateUserAgentString();
    IntentFilter localIntentFilter = new IntentFilter();
    localIntentFilter.addAction("android.intent.action.CONFIGURATION_CHANGED");
    if (this.receiver == null)
    {
      this.receiver = new BroadcastReceiver()
      {
        public void onReceive(Context paramContext, Intent paramIntent)
        {
          CordovaWebView.this.updateUserAgentString();
        }
      };
      this.cordova.getActivity().registerReceiver(this.receiver, localIntentFilter);
    }
    this.pluginManager = new PluginManager(this, this.cordova);
    this.jsMessageQueue = new NativeToJsMessageQueue(this, this.cordova);
    this.exposedJsApi = new ExposedJsApi(this.pluginManager, this.jsMessageQueue);
    exposeJsInterface();
    return;
  }
  catch (NoSuchMethodException localNoSuchMethodException)
  {
    while (true)
      Log.d("CordovaWebView", "We are on a modern version of Android, we will deprecate HTC 2.3 devices in 2.8");
  }
  catch (IllegalArgumentException localIllegalArgumentException)
  {
    while (true)
      Log.d("CordovaWebView", "Doing the NavDump failed with bad arguments");
  }
  catch (IllegalAccessException localIllegalAccessException)
  {
    while (true)
      Log.d("CordovaWebView", "This should never happen: IllegalAccessException means this isn't Android anymore");
  }
  catch (InvocationTargetException localInvocationTargetException)
  {
    while (true)
      Log.d("CordovaWebView", "This should never happen: InvocationTargetException means this isn't Android anymore.");
  }
}
项目:cordova-android-chromeview    文件:ExposedJsApi.java   
public ExposedJsApi(PluginManager pluginManager, NativeToJsMessageQueue jsMessageQueue) {
    this.pluginManager = pluginManager;
    this.jsMessageQueue = jsMessageQueue;
}
项目:12306-android-Decompile    文件:ExposedJsApi.java   
public ExposedJsApi(PluginManager paramPluginManager, NativeToJsMessageQueue paramNativeToJsMessageQueue)
{
  this.pluginManager = paramPluginManager;
  this.jsMessageQueue = paramNativeToJsMessageQueue;
}
项目:12306-android-Decompile    文件:CordovaWebView.java   
@SuppressLint({"NewApi"})
private void setup()
{
  setInitialScale(0);
  setVerticalScrollBarEnabled(false);
  requestFocusFromTouch();
  WebSettings localWebSettings = getSettings();
  localWebSettings.setJavaScriptEnabled(true);
  localWebSettings.setJavaScriptCanOpenWindowsAutomatically(true);
  localWebSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
  try
  {
    Class[] arrayOfClass = new Class[1];
    arrayOfClass[0] = Boolean.TYPE;
    Method localMethod = WebSettings.class.getMethod("setNavDump", arrayOfClass);
    if (Build.VERSION.SDK_INT < 11)
    {
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Boolean.valueOf(true);
      localMethod.invoke(localWebSettings, arrayOfObject);
    }
    localWebSettings.setSaveFormData(false);
    localWebSettings.setSavePassword(false);
    if (Build.VERSION.SDK_INT > 15)
      Level16Apis.enableUniversalAccess(localWebSettings);
    String str = this.cordova.getActivity().getApplicationContext().getDir("database", 0).getPath();
    if (Build.VERSION.SDK_INT < 11)
    {
      localWebSettings.setDatabaseEnabled(true);
      localWebSettings.setDatabasePath(str);
    }
    localWebSettings.setGeolocationDatabasePath(str);
    localWebSettings.setDomStorageEnabled(true);
    localWebSettings.setGeolocationEnabled(true);
    localWebSettings.setAppCacheMaxSize(5242880L);
    localWebSettings.setAppCachePath(this.cordova.getActivity().getApplicationContext().getDir("database", 0).getPath());
    localWebSettings.setAppCacheEnabled(true);
    updateUserAgentString();
    IntentFilter localIntentFilter = new IntentFilter();
    localIntentFilter.addAction("android.intent.action.CONFIGURATION_CHANGED");
    if (this.receiver == null)
    {
      this.receiver = new BroadcastReceiver()
      {
        public void onReceive(Context paramContext, Intent paramIntent)
        {
          CordovaWebView.this.updateUserAgentString();
        }
      };
      this.cordova.getActivity().registerReceiver(this.receiver, localIntentFilter);
    }
    this.pluginManager = new PluginManager(this, this.cordova);
    this.jsMessageQueue = new NativeToJsMessageQueue(this, this.cordova);
    this.exposedJsApi = new ExposedJsApi(this.pluginManager, this.jsMessageQueue);
    exposeJsInterface();
    return;
  }
  catch (NoSuchMethodException localNoSuchMethodException)
  {
    while (true)
      Log.d("CordovaWebView", "We are on a modern version of Android, we will deprecate HTC 2.3 devices in 2.8");
  }
  catch (IllegalArgumentException localIllegalArgumentException)
  {
    while (true)
      Log.d("CordovaWebView", "Doing the NavDump failed with bad arguments");
  }
  catch (IllegalAccessException localIllegalAccessException)
  {
    while (true)
      Log.d("CordovaWebView", "This should never happen: IllegalAccessException means this isn't Android anymore");
  }
  catch (InvocationTargetException localInvocationTargetException)
  {
    while (true)
      Log.d("CordovaWebView", "This should never happen: InvocationTargetException means this isn't Android anymore.");
  }
}
项目:cordova-android-chromium    文件:ExposedJsApi.java   
public ExposedJsApi(PluginManager pluginManager, NativeToJsMessageQueue jsMessageQueue) {
    this.pluginManager = pluginManager;
    this.jsMessageQueue = jsMessageQueue;
}