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.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Color; import android.graphics.Color;
import android.media.AudioManager; import android.media.AudioManager;
import android.net.Uri; import android.net.Uri;
@ -52,7 +51,6 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@ -96,15 +94,9 @@ public class CordovaActivity extends Activity implements CordovaInterface {
protected CordovaWebViewClient webViewClient; protected CordovaWebViewClient webViewClient;
protected LinearLayout root; protected LinearLayout root;
protected boolean cancelLoadUrl = false;
protected ProgressDialog spinnerDialog = null; protected ProgressDialog spinnerDialog = null;
private final ExecutorService threadPool = Executors.newCachedThreadPool(); 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_STARTING = 0;
private static int ACTIVITY_RUNNING = 1; private static int ACTIVITY_RUNNING = 1;
private static int ACTIVITY_EXITING = 2; private static int ACTIVITY_EXITING = 2;
@ -135,18 +127,8 @@ public class CordovaActivity extends Activity implements CordovaInterface {
// when another application (activity) is started. // when another application (activity) is started.
protected boolean keepRunning = true; protected boolean keepRunning = true;
private int lastRequestCode;
private Object responseCode;
private Intent lastIntent;
private Object lastResponseCode;
private String initCallbackClass; private String initCallbackClass;
private Object LOG_TAG;
/** /**
* Sets the authentication token. * Sets the authentication token.
* *
@ -207,14 +189,12 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/** /**
* Called when the activity is first created. * Called when the activity is first created.
*
* @param savedInstanceState
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Config.init(this); 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()"); LOG.d(TAG, "CordovaActivity.onCreate()");
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -344,16 +324,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.appView.setVisibility(View.INVISIBLE); this.appView.setVisibility(View.INVISIBLE);
this.root.addView(this.appView); this.root.addView(this.appView);
setContentView(this.root); setContentView(this.root);
// Clear cancel flag
this.cancelLoadUrl = false;
} }
/** /**
* Load the url into the webview. * Load the url into the webview.
*
* @param url
*/ */
public void loadUrl(String url) { public void loadUrl(String url) {
@ -408,18 +382,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.splashscreenTime = time; this.splashscreenTime = time;
this.loadUrl(url); 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 @Deprecated
public void cancelLoadUrl() { public void cancelLoadUrl() {
this.cancelLoadUrl = true;
} }
/** /**
@ -494,17 +450,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
return false; 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. * Get boolean property for activity.
* *
@ -666,10 +611,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.getIntent().putExtra(name.toLowerCase(), value); this.getIntent().putExtra(name.toLowerCase(), value);
} }
@Override
/** /**
* Called when the system is about to start resuming a previous activity. * Called when the system is about to start resuming a previous activity.
*/ */
@Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
@ -692,10 +637,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.removeSplashScreen(); this.removeSplashScreen();
} }
@Override
/** /**
* Called when the activity receives a new intent * Called when the activity receives a new intent
**/ **/
@Override
protected void onNewIntent(Intent intent) { protected void onNewIntent(Intent intent) {
super.onNewIntent(intent); super.onNewIntent(intent);
//Forward to plugins //Forward to plugins
@ -703,10 +648,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
this.appView.onNewIntent(intent); this.appView.onNewIntent(intent);
} }
@Override
/** /**
* Called when the activity will start interacting with the user. * Called when the activity will start interacting with the user.
*/ */
@Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
LOG.d(TAG, "Resuming the App"); 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. * The final call you receive before your activity is destroyed.
*/ */
@Override
public void onDestroy() { public void onDestroy() {
LOG.d(TAG, "CordovaActivity.onDestroy()"); LOG.d(TAG, "CordovaActivity.onDestroy()");
super.onDestroy(); super.onDestroy();
@ -756,9 +701,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/** /**
* Send a message to all plugins. * Send a message to all plugins.
*
* @param id The message id
* @param data The message data
*/ */
public void postMessage(String id, Object data) { public void postMessage(String id, Object data) {
if (this.appView != null) { if (this.appView != null) {
@ -771,9 +713,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* Add services to res/xml/plugins.xml instead. * Add services to res/xml/plugins.xml instead.
* *
* Add a class that implements a service. * Add a class that implements a service.
*
* @param serviceType
* @param className
*/ */
@Deprecated @Deprecated
public void addService(String serviceType, String className) { public void addService(String serviceType, String className) {
@ -854,7 +793,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
super.startActivityForResult(intent, requestCode); super.startActivityForResult(intent, requestCode);
} }
@Override
/** /**
* Called when an activity you launched exits, giving you the requestCode you started it with, * 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. * 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 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"). * @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) { protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
LOG.d(TAG, "Incoming Result"); LOG.d(TAG, "Incoming Result");
super.onActivityResult(requestCode, resultCode, intent); super.onActivityResult(requestCode, resultCode, intent);
@ -875,8 +814,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
return; return;
Uri result = intent == null || resultCode != Activity.RESULT_OK ? null : intent.getData(); Uri result = intent == null || resultCode != Activity.RESULT_OK ? null : intent.getData();
Log.d(TAG, "result = " + result); Log.d(TAG, "result = " + result);
// Uri filepath = Uri.parse("file://" + FileUtils.getRealPathFromURI(result, this));
// Log.d(TAG, "result = " + filepath);
mUploadMessage.onReceiveValue(result); mUploadMessage.onReceiveValue(result);
mUploadMessage = null; mUploadMessage = null;
} }
@ -937,11 +874,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/** /**
* Display an error dialog and optionally exit application. * 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) { public void displayError(final String title, final String message, final String button, final boolean exit) {
final CordovaActivity me = this; 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. * 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) { public boolean isUrlWhiteListed(String url) {
return Config.isUrlWhiteListed(url); return Config.isUrlWhiteListed(url);
@ -982,7 +911,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/* /*
* Hook in Cordova for menu plugins * Hook in Cordova for menu plugins
*
*/ */
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
@ -1004,9 +932,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/** /**
* Get Activity context. * Get Activity context.
*
* @return self
* @deprecated
*/ */
@Deprecated @Deprecated
public Context getContext() { public Context getContext() {