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
Changes from 1 commit
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
Next Next commit
chore(android): remove old code
  • Loading branch information
m1ga committed Jun 2, 2024
commit 2c639cef2cb50808f0e145368e76cff5f0968af1
Original file line number Diff line number Diff line change
@@ -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();
Original file line number Diff line number Diff line change
@@ -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)
@@ -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) {
Original file line number Diff line number Diff line change
@@ -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;
@@ -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;
Original file line number Diff line number Diff line change
@@ -66,23 +66,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;
@@ -99,7 +92,6 @@ public abstract class TiApplication extends Application implements KrollApplicat
protected ITiAppInfo appInfo;
protected TiStylesheet stylesheet;
protected HashMap<String, WeakReference<KrollModule>> modules;
protected String[] filteredAnalyticsEvents;

public static AtomicBoolean isActivityTransition = new AtomicBoolean(false);
protected static ArrayList<ActivityTransitionListener> activityTransitionListeners = new ArrayList<>();
@@ -475,7 +467,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();
@@ -755,26 +746,6 @@ public boolean runOnMainThread()
return true;
}

public void setFilterAnalyticsEvents(String[] events)
{
filteredAnalyticsEvents = events;
}

public boolean isAnalyticsFiltered(String eventName)
{
if (filteredAnalyticsEvents == null) {
return false;
}

for (int i = 0; i < filteredAnalyticsEvents.length; ++i) {
String currentName = filteredAnalyticsEvents[i];
if (eventName.equals(currentName)) {
return true;
}
}
return false;
}

@Override
public String getDeployType()
{
@@ -820,12 +791,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);
@@ -837,22 +802,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();
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
@@ -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;
Loading