Delete dead code from CordovaActivity

This commit is contained in:
Andrew Grieve 2014-07-04 11:46:03 -04:00
parent 95118398dd
commit 79aa3e159d

View File

@ -37,7 +37,6 @@ import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Color;
import android.media.AudioManager;
import android.net.Uri;
@ -52,7 +51,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.webkit.ValueCallback;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
@ -96,15 +94,9 @@ public class CordovaActivity extends Activity implements CordovaInterface {
protected CordovaWebViewClient webViewClient;
protected LinearLayout root;
protected boolean cancelLoadUrl = false;
protected ProgressDialog spinnerDialog = null;
private final ExecutorService threadPool = Executors.newCachedThreadPool();
// The initial URL for our app
// ie http://server/path/index.html#abc?query
//private String url = null;
private static int ACTIVITY_STARTING = 0;
private static int ACTIVITY_RUNNING = 1;
private static int ACTIVITY_EXITING = 2;
@ -135,18 +127,8 @@ public class CordovaActivity extends Activity implements CordovaInterface {
// when another application (activity) is started.
protected boolean keepRunning = true;
private int lastRequestCode;
private Object responseCode;
private Intent lastIntent;
private Object lastResponseCode;
private String initCallbackClass;
private Object LOG_TAG;
/**
* Sets the authentication token.
*
@ -207,14 +189,12 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/**
* Called when the activity is first created.
*
* @param savedInstanceState
*/
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
Config.init(this);
LOG.i(TAG, "Apache Cordova native platform version " + appView.CORDOVA_VERSION + " is starting");
LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting");
LOG.d(TAG, "CordovaActivity.onCreate()");
super.onCreate(savedInstanceState);
@ -344,16 +324,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.appView.setVisibility(View.INVISIBLE);
this.root.addView(this.appView);
setContentView(this.root);
// Clear cancel flag
this.cancelLoadUrl = false;
}
/**
* Load the url into the webview.
*
* @param url
*/
public void loadUrl(String url) {
@ -408,18 +382,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.splashscreenTime = time;
this.loadUrl(url);
/*
// Init web view if not already done
if (this.appView == null) {
this.init();
}
this.splashscreenTime = time;
this.splashscreen = this.getIntegerProperty("SplashScreen", 0);
this.showSplashScreen(this.splashscreenTime);
this.appView.loadUrl(url, time);
*/
}
/*
@ -455,14 +417,8 @@ public class CordovaActivity extends Activity implements CordovaInterface {
}
}
/**
* Cancel loadUrl before it has been loaded.
*/
// TODO NO-OP
@Deprecated
public void cancelLoadUrl() {
this.cancelLoadUrl = true;
}
/**
@ -494,17 +450,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
return false;
}
@Override
/**
* Called by the system when the device configuration changes while your activity is running.
*
* @param Configuration newConfig
*/
public void onConfigurationChanged(Configuration newConfig) {
//don't reload the current page when the orientation is changed
super.onConfigurationChanged(newConfig);
}
/**
* Get boolean property for activity.
*
@ -666,10 +611,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.getIntent().putExtra(name.toLowerCase(), value);
}
@Override
/**
* Called when the system is about to start resuming a previous activity.
*/
@Override
protected void onPause() {
super.onPause();
@ -692,10 +637,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.removeSplashScreen();
}
@Override
/**
* Called when the activity receives a new intent
**/
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
//Forward to plugins
@ -703,10 +648,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.appView.onNewIntent(intent);
}
@Override
/**
* Called when the activity will start interacting with the user.
*/
@Override
protected void onResume() {
super.onResume();
LOG.d(TAG, "Resuming the App");
@ -735,10 +680,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
}
}
@Override
/**
* The final call you receive before your activity is destroyed.
*/
@Override
public void onDestroy() {
LOG.d(TAG, "CordovaActivity.onDestroy()");
super.onDestroy();
@ -756,9 +701,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/**
* Send a message to all plugins.
*
* @param id The message id
* @param data The message data
*/
public void postMessage(String id, Object data) {
if (this.appView != null) {
@ -771,9 +713,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* Add services to res/xml/plugins.xml instead.
*
* Add a class that implements a service.
*
* @param serviceType
* @param className
*/
@Deprecated
public void addService(String serviceType, String className) {
@ -854,7 +793,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
super.startActivityForResult(intent, requestCode);
}
@Override
/**
* Called when an activity you launched exits, giving you the requestCode you started it with,
* the resultCode it returned, and any additional data from it.
@ -864,6 +802,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* @param resultCode The integer result code returned by the child activity through its setResult().
* @param data An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
LOG.d(TAG, "Incoming Result");
super.onActivityResult(requestCode, resultCode, intent);
@ -875,8 +814,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
return;
Uri result = intent == null || resultCode != Activity.RESULT_OK ? null : intent.getData();
Log.d(TAG, "result = " + result);
// Uri filepath = Uri.parse("file://" + FileUtils.getRealPathFromURI(result, this));
// Log.d(TAG, "result = " + filepath);
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
}
@ -937,11 +874,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/**
* Display an error dialog and optionally exit application.
*
* @param title
* @param message
* @param button
* @param exit
*/
public void displayError(final String title, final String message, final String button, final boolean exit) {
final CordovaActivity me = this;
@ -972,9 +904,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/**
* Determine if URL is in approved list of URLs to load.
*
* @param url
* @return true if the url is whitelisted
*/
public boolean isUrlWhiteListed(String url) {
return Config.isUrlWhiteListed(url);
@ -982,7 +911,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/*
* Hook in Cordova for menu plugins
*
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
@ -1004,9 +932,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/**
* Get Activity context.
*
* @return self
* @deprecated
*/
@Deprecated
public Context getContext() {