Skip to content

Commit 6926f0d

Browse files
authored
chore(android): remove some dead analytics code (#14022)
1 parent dc180b9 commit 6926f0d

File tree

6 files changed

+0
-87
lines changed

6 files changed

+0
-87
lines changed

android/app/src/main/java/com/titanium/test/TitaniumTestAppInfo.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ public String getIcon()
6060
return "appicon.png";
6161
}
6262

63-
public boolean isAnalyticsEnabled()
64-
{
65-
return true;
66-
}
67-
6863
public String getGUID()
6964
{
7065
return "edf09efc-69ef-46fd-9777-35d6aaa2d7b5";

android/cli/commands/_build.js

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,9 +1541,6 @@ AndroidBuilder.prototype.run = async function run(logger, config, cli, finished)
15411541
// Notify plugins that we're about to begin.
15421542
await new Promise(resolve => cli.emit('build.pre.construct', this, resolve));
15431543

1544-
// Post build analytics.
1545-
await this.doAnalytics();
1546-
15471544
// Initialize build system. Checks if we need to do a clean or incremental build.
15481545
await this.initialize();
15491546
await this.loginfo();
@@ -1602,35 +1599,6 @@ AndroidBuilder.prototype.run = async function run(logger, config, cli, finished)
16021599
}
16031600
};
16041601

1605-
AndroidBuilder.prototype.doAnalytics = async function doAnalytics() {
1606-
const cli = this.cli;
1607-
let eventName = 'android.' + cli.argv.target;
1608-
1609-
if (cli.argv.target === 'dist-playstore') {
1610-
eventName = 'android.distribute.playstore';
1611-
} else if (this.allowDebugging && this.debugPort) {
1612-
eventName += '.debug';
1613-
} else if (this.allowProfiling && this.profilerPort) {
1614-
eventName += '.profile';
1615-
} else {
1616-
eventName += '.run';
1617-
}
1618-
1619-
cli.addAnalyticsEvent(eventName, {
1620-
name: cli.tiapp.name,
1621-
publisher: cli.tiapp.publisher,
1622-
url: cli.tiapp.url,
1623-
image: cli.tiapp.icon,
1624-
appid: cli.tiapp.id,
1625-
description: cli.tiapp.description,
1626-
type: cli.argv.type,
1627-
guid: cli.tiapp.guid,
1628-
version: cli.tiapp.version,
1629-
copyright: cli.tiapp.copyright,
1630-
date: (new Date()).toDateString()
1631-
});
1632-
};
1633-
16341602
AndroidBuilder.prototype.initialize = async function initialize() {
16351603
const argv = this.cli.argv;
16361604

@@ -1865,12 +1833,6 @@ AndroidBuilder.prototype.checkIfShouldForceRebuild = function checkIfShouldForce
18651833
return true;
18661834
}
18671835

1868-
if (!this.tiapp.analytics !== !manifest.analytics) {
1869-
this.logger.info(__('Forcing rebuild: tiapp.xml analytics flag changed since last build'));
1870-
this.logger.info(' ' + __('Was: %s', !!manifest.analytics));
1871-
this.logger.info(' ' + __('Now: %s', !!this.tiapp.analytics));
1872-
return true;
1873-
}
18741836
if (this.tiapp.publisher !== manifest.publisher) {
18751837
this.logger.info(__('Forcing rebuild: tiapp.xml publisher changed since last build'));
18761838
this.logger.info(' ' + __('Was: %s', manifest.publisher));
@@ -3822,7 +3784,6 @@ AndroidBuilder.prototype.writeBuildManifest = async function writeBuildManifest(
38223784
outputDir: this.cli.argv['output-dir'],
38233785
name: this.tiapp.name,
38243786
id: this.tiapp.id,
3825-
analytics: this.tiapp.analytics,
38263787
publisher: this.tiapp.publisher,
38273788
url: this.tiapp.url,
38283789
version: this.tiapp.version,

android/templates/build/AppInfo.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ public String getIcon() {
5252
return "<%- tiapp.icon %>";
5353
}
5454

55-
public boolean isAnalyticsEnabled() {
56-
return <%- !!tiapp.analytics %>;
57-
}
58-
5955
public String getGUID() {
6056
return "<%- tiapp.guid %>";
6157
}

android/titanium/src/java/org/appcelerator/titanium/ITiAppInfo.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public interface ITiAppInfo {
1515
String getCopyright();
1616
String getDescription();
1717
String getIcon();
18-
boolean isAnalyticsEnabled();
1918
String getGUID();
2019
boolean isFullscreen();
2120
String getDeployType();

android/titanium/src/java/org/appcelerator/titanium/TiApplication.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public abstract class TiApplication extends Application implements KrollApplicat
9999
protected ITiAppInfo appInfo;
100100
protected TiStylesheet stylesheet;
101101
protected HashMap<String, WeakReference<KrollModule>> modules;
102-
protected String[] filteredAnalyticsEvents;
103102

104103
public static AtomicBoolean isActivityTransition = new AtomicBoolean(false);
105104
protected static ArrayList<ActivityTransitionListener> activityTransitionListeners = new ArrayList<>();
@@ -738,11 +737,6 @@ public KrollProxy unregisterProxy(String proxyId)
738737
return proxy;
739738
}
740739

741-
public boolean isAnalyticsEnabled()
742-
{
743-
return false;
744-
}
745-
746740
/**
747741
* Determines if Titanium's JavaScript runtime should run on the main UI thread or not
748742
* based on the "tiapp.xml" property "run-on-main-thread".
@@ -755,26 +749,6 @@ public boolean runOnMainThread()
755749
return true;
756750
}
757751

758-
public void setFilterAnalyticsEvents(String[] events)
759-
{
760-
filteredAnalyticsEvents = events;
761-
}
762-
763-
public boolean isAnalyticsFiltered(String eventName)
764-
{
765-
if (filteredAnalyticsEvents == null) {
766-
return false;
767-
}
768-
769-
for (int i = 0; i < filteredAnalyticsEvents.length; ++i) {
770-
String currentName = filteredAnalyticsEvents[i];
771-
if (eventName.equals(currentName)) {
772-
return true;
773-
}
774-
}
775-
return false;
776-
}
777-
778752
@Override
779753
public String getDeployType()
780754
{

android/titanium/src/java/org/appcelerator/titanium/TiApplicationLifecycle.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import android.app.Application;
1111
import android.os.Bundle;
1212

13-
import com.appcelerator.aps.APSAnalytics;
14-
1513
import org.appcelerator.kroll.KrollModule;
1614

1715
public class TiApplicationLifecycle implements Application.ActivityLifecycleCallbacks
@@ -50,11 +48,6 @@ public void onActivityStarted(Activity activity)
5048
}
5149
appModule.fireEvent(TiC.EVENT_RESUMED, null);
5250
}
53-
54-
// Post analytics for this event, if enabled.
55-
if (this.tiApp.isAnalyticsEnabled()) {
56-
APSAnalytics.getInstance().sendAppForegroundEvent();
57-
}
5851
}
5952

6053
// Increment number of "started" activities. These are activities that are currently in the foreground.
@@ -76,11 +69,6 @@ public void onActivityStopped(Activity activity)
7669
appModule.fireEvent(TiC.EVENT_PAUSE, null);
7770
appModule.fireEvent(TiC.EVENT_PAUSED, null);
7871
}
79-
80-
// Post analytics for this event, if enabled.
81-
if (this.tiApp.isAnalyticsEnabled()) {
82-
APSAnalytics.getInstance().sendAppBackgroundEvent();
83-
}
8472
}
8573

8674
// Decrement count of started/visible activities.

0 commit comments

Comments
 (0)