Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(android): remove old code #14053

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
public interface KrollApplication {
boolean DEFAULT_RUN_ON_MAIN_THREAD = false;

int getThreadStackSize();

Activity getCurrentActivity();

void waitForCurrentActivity(CurrentActivityListener l);

TiDeployData getDeployData();

boolean isFastDevMode();

String getAppGUID();

boolean isDebuggerEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public String toString()
};

public static final int DONT_INTERCEPT = Integer.MIN_VALUE + 1;
public static final int DEFAULT_THREAD_STACK_SIZE = 16 * 1024;
public static final String SOURCE_ANONYMOUS = "<anonymous>";

public static void init(Context context, KrollRuntime runtime)
Expand Down Expand Up @@ -303,15 +302,6 @@ public Object evalString(String source, String filename)
}
}

public int getThreadStackSize(Context context)
{
if (context instanceof KrollApplication) {
KrollApplication app = (KrollApplication) context;
return app.getThreadStackSize();
}
return DEFAULT_THREAD_STACK_SIZE;
}

public boolean handleMessage(Message msg)
{
switch (msg.what) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class TiDeployData
protected static final String DEBUGGER_PORT = "debuggerPort";
protected static final String PROFILER_ENABLED = "profilerEnabled";
protected static final String PROFILER_PORT = "profilerPort";
protected static final String FASTDEV_PORT = "fastdevPort";
protected static final String FASTDEV_LISTEN = "fastdevListen";

private KrollApplication krollApp;
private JSONObject deployData;
Expand Down Expand Up @@ -127,41 +125,6 @@ public int getProfilerPort()
return deployData.optInt(PROFILER_PORT, -1);
}

/**
* @return The "fastdev" http server port, or -1
*/
public int getFastDevPort()
{
// fastdev is deprecated
return -1;

/*
if (isDeployTypeDisabled()) {
return -1;
}

return deployData.optInt(FASTDEV_PORT, -1);
*/
}

/**
* @return Whether or not Fastdev mode should listen for a connection (default false)
* This is useful for situations where adb forward or other external methods are necessary
*/
public boolean getFastDevListen()
{
// fastdev is deprecated
return false;

/*
if (isDeployTypeDisabled()) {
return false;
}

return deployData.optBoolean(FASTDEV_LISTEN, false);
*/
}

private boolean isDeployTypeDisabled()
{
String deployType = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,16 @@ public abstract class TiApplication extends Application implements KrollApplicat
private static final String PROPERTY_THREAD_STACK_SIZE = "ti.android.threadstacksize";
private static final String PROPERTY_COMPILE_JS = "ti.android.compilejs";
private static final String PROPERTY_DEFAULT_UNIT = "ti.ui.defaultunit";
private static final String PROPERTY_USE_LEGACY_WINDOW = "ti.android.useLegacyWindow";
private static long mainThreadId = 0;

protected static TiApplication tiApp = null;

public static final String DEPLOY_TYPE_DEVELOPMENT = "development";
public static final String DEPLOY_TYPE_TEST = "test";
public static final String DEPLOY_TYPE_PRODUCTION = "production";
public static final int DEFAULT_THREAD_STACK_SIZE = 16 * 1024; // 16K as a "sane" default
public static final String APPLICATION_PREFERENCES_NAME = "titanium";
public static final String PROPERTY_FASTDEV = "ti.android.fastdev";
public static final int TRIM_MEMORY_RUNNING_LOW = 10; // Application.TRIM_MEMORY_RUNNING_LOW for API 16+

// Whether or not using legacy window. This is set in the application's tiapp.xml with the
// "ti.android.useLegacyWindow" property.
public static boolean USE_LEGACY_WINDOW = false;

private String baseUrl;
private String startUrl;
private HashMap<String, SoftReference<KrollProxy>> proxyMap;
Expand Down Expand Up @@ -475,7 +468,6 @@ public void postOnCreate()
}

TiConfig.DEBUG = TiConfig.LOGD = appProperties.getBool("ti.android.debug", false);
USE_LEGACY_WINDOW = appProperties.getBool(PROPERTY_USE_LEGACY_WINDOW, false);

// Start listening for system locale changes.
startLocaleMonitor();
Expand Down Expand Up @@ -795,12 +787,6 @@ public String getDefaultUnit()
return defaultUnit;
}

@Override
public int getThreadStackSize()
{
return getAppProperties().getInt(PROPERTY_THREAD_STACK_SIZE, DEFAULT_THREAD_STACK_SIZE);
}

public boolean forceCompileJS()
{
return getAppProperties().getBool(PROPERTY_COMPILE_JS, false);
Expand All @@ -812,22 +798,6 @@ public TiDeployData getDeployData()
return deployData;
}

@Override
public boolean isFastDevMode()
{
/* Fast dev is enabled by default in development mode, and disabled otherwise
* When the property is set, it overrides the default behavior on emulator only
* Deploy types are as follow:
* Emulator: 'development'
* Device: 'test'
*/
boolean development = getDeployType().equals(TiApplication.DEPLOY_TYPE_DEVELOPMENT);
if (!development) {
return false;
}
return getAppProperties().getBool(TiApplication.PROPERTY_FASTDEV, development);
}

public static void launch()
{
final TiRootActivity rootActivity = TiApplication.getInstance().getRootActivity();
Expand Down
4 changes: 0 additions & 4 deletions android/titanium/src/java/org/appcelerator/titanium/TiC.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
*/
public class TiC
{
public static final int API_LEVEL_HONEYCOMB = 11;
public static final int API_LEVEL_ICE_CREAM_SANDWICH = 14;
public static final int API_LEVEL_JELLY_BEAN = 16;

public static final int PERMISSION_CODE_CALENDAR = 100;
public static final int PERMISSION_CODE_CAMERA = 101;
public static final int PERMISSION_CODE_CONTACTS = 102;
Expand Down
Loading