From 9f156727e71382e89c6bd6beae79c83017a94bc1 Mon Sep 17 00:00:00 2001 From: Hevin Date: Tue, 26 Sep 2017 17:51:25 +0800 Subject: [PATCH] Remove unused code --- doc/Android_detail_api.md | 1 - src/android/JPushPlugin.java | 31 ++++--------------------------- www/JPushPlugin.js | 10 ---------- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/doc/Android_detail_api.md b/doc/Android_detail_api.md index 1186652..532a4aa 100644 --- a/doc/Android_detail_api.md +++ b/doc/Android_detail_api.md @@ -2,7 +2,6 @@ - [注册成功事件](#注册成功事件) - [获取集成日志(同时适用于 iOS)](#获取集成日志同时适用于-ios) -- [统计分析](#统计分析) - [清除通知](#清除通知) - [设置允许推送时间](#设置允许推送时间) - [设置通知静默时间](#设置通知静默时间) diff --git a/src/android/JPushPlugin.java b/src/android/JPushPlugin.java index 38ba9ff..f0491f0 100644 --- a/src/android/JPushPlugin.java +++ b/src/android/JPushPlugin.java @@ -39,15 +39,12 @@ import cn.jpush.android.service.JPushMessageReceiver; public class JPushPlugin extends CordovaPlugin { - private ExecutorService threadPool = Executors.newFixedThreadPool(1); - + private static final String TAG = JPushPlugin.class.getSimpleName(); + private Context mContext; - + private static JPushPlugin instance; private static Activity cordovaActivity; - private static String TAG = "JPushPlugin"; - - private static boolean isStatisticsOpened = false; // 是否开启统计分析功能 static String notificationTitle; static String notificationAlert; @@ -85,16 +82,7 @@ public class JPushPlugin extends CordovaPlugin { } } - public void onPause(boolean multitasking) { - if (isStatisticsOpened && multitasking) { - JPushInterface.onPause(this.cordova.getActivity()); - } - } - public void onResume(boolean multitasking) { - if (isStatisticsOpened && multitasking) { - JPushInterface.onResume(this.cordova.getActivity()); - } if (openNotificationAlert != null) { notificationAlert = null; transmitNotificationOpen(openNotificationTitle, openNotificationAlert, @@ -252,7 +240,7 @@ public class JPushPlugin extends CordovaPlugin { @Override public boolean execute(final String action, final JSONArray data, final CallbackContext callbackContext) throws JSONException { - threadPool.execute(new Runnable() { + cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { @@ -644,17 +632,6 @@ public class JPushPlugin extends CordovaPlugin { JPushInterface.clearLocalNotifications(this.cordova.getActivity()); } - /** - * 决定是否启用统计分析功能。 - */ - void setStatisticsOpen(JSONArray data, CallbackContext callbackContext) { - try { - isStatisticsOpened = data.getBoolean(0); - } catch (JSONException e) { - e.printStackTrace(); - } - } - /** * 设置通知静默时间 * http://docs.jpush.io/client/android_api/#api_5 diff --git a/www/JPushPlugin.js b/www/JPushPlugin.js index 7efaa9b..a9c3266 100644 --- a/www/JPushPlugin.js +++ b/www/JPushPlugin.js @@ -365,16 +365,6 @@ JPushPlugin.prototype.reportNotificationOpened = function (msgID) { } } -/** - *是否开启统计分析功能,用于“用户使用时长”,“活跃用户”,“用户打开次数”的统计,并上报到服务器上, - *在 Portal 上展示给开发者。 - */ -JPushPlugin.prototype.setStatisticsOpen = function (mode) { - if (device.platform === 'Android') { - this.callNative('setStatisticsOpen', [mode], null) - } -} - /** * 用于在 Android 6.0 及以上系统,申请一些权限 * 具体可看:http://docs.jpush.io/client/android_api/#android-60