@@ -23,8 +23,10 @@ public final class VenvyStatisticsManager {
2323 public static final int PRELOAD_FLOW = 5 ;
2424 public static final int OPEN_PAGE = 6 ;
2525 public static final int CLOSE_PAGE = 7 ;
26+ public static final int PAGE_NAME = 8 ;
2627
2728 private Platform platform ;
29+
2830 private VenvyStatisticsManager () {
2931
3032 }
@@ -42,25 +44,27 @@ public void init(Platform platform) {
4244 }
4345
4446 public void submitCommonTrack (int type , JSONObject jsonObj ) {
45- if (jsonObj == null ){
47+ if (jsonObj == null ) {
4648 return ;
4749 }
4850 if (VenvyStatisticsManager .AB_APPLET_TRACK == type ) {
4951 submitABAppletTrackStatisticsInfo (jsonObj );
5052 } else if (VenvyStatisticsManager .USER_ACTION == type ) {
5153 submitUserActionStatisticsInfo (jsonObj );
52- }else if (VenvyStatisticsManager .VISUAL_SWITCH_COUNT == type ) {
54+ } else if (VenvyStatisticsManager .VISUAL_SWITCH_COUNT == type ) {
5355 submitVisualSwitchStatisticsInfo (jsonObj );
54- }else if (VenvyStatisticsManager .PLAY_CONFIRM == type ) {
56+ } else if (VenvyStatisticsManager .PLAY_CONFIRM == type ) {
5557 submitPlayConfirmStatisticsInfo (jsonObj );
56- }else if (VenvyStatisticsManager .PRELOAD_FLOW == type ) {
58+ } else if (VenvyStatisticsManager .PRELOAD_FLOW == type ) {
5759 submitPreLoadFlowStatisticsInfo (jsonObj );
58- }else if (VenvyStatisticsManager .OPEN_PAGE == type || VenvyStatisticsManager .CLOSE_PAGE == type ) {
59- executeThread (jsonObj .toString ());
60+ } else if (VenvyStatisticsManager .OPEN_PAGE == type
61+ || VenvyStatisticsManager .CLOSE_PAGE == type
62+ || VenvyStatisticsManager .PAGE_NAME == type ) {
63+ submitABAppletTrackStatisticsInfo (type , jsonObj );
6064 }
6165 }
6266
63- private void submitPreLoadFlowStatisticsInfo (JSONObject jsonObj ){
67+ private void submitPreLoadFlowStatisticsInfo (JSONObject jsonObj ) {
6468 try {
6569 String dataJson = StatisticDCUtils .obtainPreLoadFlowStatisticsJson (VenvyStatisticsManager .PRELOAD_FLOW , jsonObj );
6670 executeThread (dataJson );
@@ -69,7 +73,7 @@ private void submitPreLoadFlowStatisticsInfo(JSONObject jsonObj){
6973 }
7074 }
7175
72- private void submitPlayConfirmStatisticsInfo (JSONObject jsonObj ){
76+ private void submitPlayConfirmStatisticsInfo (JSONObject jsonObj ) {
7377 try {
7478 String dataJson = StatisticDCUtils .obtainPlayConfirmStatisticsJson (VenvyStatisticsManager .PLAY_CONFIRM , jsonObj );
7579 executeThread (dataJson );
@@ -78,7 +82,7 @@ private void submitPlayConfirmStatisticsInfo(JSONObject jsonObj){
7882 }
7983 }
8084
81- private void submitVisualSwitchStatisticsInfo (JSONObject jsonObj ){
85+ private void submitVisualSwitchStatisticsInfo (JSONObject jsonObj ) {
8286 try {
8387 String dataJson = StatisticDCUtils .obtainVisualSwitchStatisticsJson (VenvyStatisticsManager .VISUAL_SWITCH_COUNT , jsonObj );
8488 executeThread (dataJson );
@@ -105,14 +109,23 @@ private void submitABAppletTrackStatisticsInfo(JSONObject jsonObj) {
105109 }
106110 }
107111
112+ private void submitABAppletTrackStatisticsInfo (int type , JSONObject jsonObj ) {
113+ try {
114+ String dataJson = StatisticDCUtils .obtainABAppletTrackStatisticsJson (type , jsonObj );
115+ executeThread (dataJson );
116+ } catch (JSONException e ) {
117+ e .printStackTrace ();
118+ }
119+ }
120+
108121 private void executeThread (String dataJson ) {
109- if (!TextUtils .isEmpty (dataJson ) && platform != null ){
110- ThreadManager .getInstance ().createLongPool ().execute (new AsyncStatisticsRunnable (platform ,dataJson ));
122+ if (!TextUtils .isEmpty (dataJson ) && platform != null ) {
123+ ThreadManager .getInstance ().createLongPool ().execute (new AsyncStatisticsRunnable (platform , dataJson ));
111124 }
112125 }
113126
114127 public void submitVisualSwitchStatisticsInfo (String onOrOff ) {
115- if (TextUtils .isEmpty (onOrOff ) || platform == null ){
128+ if (TextUtils .isEmpty (onOrOff ) || platform == null ) {
116129 return ;
117130 }
118131 try {
@@ -123,20 +136,20 @@ public void submitVisualSwitchStatisticsInfo(String onOrOff) {
123136 }
124137 }
125138
126- public void submitFileStatisticsInfo (List <DownloadTask > downloadTaskList , int downLoadStage ) {
127- if (downloadTaskList == null || downloadTaskList .size () <= 0 || platform == null ){
139+ public void submitFileStatisticsInfo (List <DownloadTask > downloadTaskList , int downLoadStage ) {
140+ if (downloadTaskList == null || downloadTaskList .size () <= 0 || platform == null ) {
128141 return ;
129142 }
130143 try {
131- String dataJson = StatisticDCUtils .obtainFlowStatisticJson (VenvyStatisticsManager .PRELOAD_FLOW ,downloadTaskList ,downLoadStage );
144+ String dataJson = StatisticDCUtils .obtainFlowStatisticJson (VenvyStatisticsManager .PRELOAD_FLOW , downloadTaskList , downLoadStage );
132145 executeThread (dataJson );
133146 } catch (JSONException e ) {
134147 e .printStackTrace ();
135148 }
136149 }
137150
138- public void submitFileStatisticsInfo (StatisticsInfoBean .FileInfoBean fileInfoBean , int downLoadStage ) {
139- if (fileInfoBean == null || platform == null ){
151+ public void submitFileStatisticsInfo (StatisticsInfoBean .FileInfoBean fileInfoBean , int downLoadStage ) {
152+ if (fileInfoBean == null || platform == null ) {
140153 return ;
141154 }
142155 try {
0 commit comments