Commit 32090825 authored by wanglei's avatar wanglei

...

parent 0b0e3366
......@@ -14,7 +14,7 @@ public class FcmReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
LogEx.INSTANCE.logDebug(TAG, "onReceive", false);
NotificationUiUtil.INSTANCE.sendNotificationIfCan(context, PopupConstObject.POPUP_WHERE_FCM, null);
NotificationUiUtil.INSTANCE.sendNotificationIfCan(context, PopupConstObject.POPUP_WHERE_FCM, NotificationUiUtil.INSTANCE.getNextActionId());
EventUtils.INSTANCE.event("FCM_Received", "FcmReceiver", null, false);
......
......@@ -24,7 +24,7 @@ public class MessagingService extends FirebaseMessagingService {
LogEx.INSTANCE.logDebug(TAG, "onMessageReceived", false);
String action = NotificationUiUtil.INSTANCE.getNextActionId();
NotificationUiUtil.INSTANCE.sendNotificationIfCan(this, action, PopupConstObject.POPUP_WHERE_FCM);
NotificationUiUtil.INSTANCE.sendNotificationIfCan(this, PopupConstObject.POPUP_WHERE_FCM, action);
String id = remoteMessage.getMessageId();
JSONObject ext = new JSONObject();
......
......@@ -135,7 +135,7 @@ object NotificationUiUtil {
var hoverActionId = ""
@SuppressLint("RemoteViewLayout")
fun sendNotificationIfCan(context: Context, actionId: String, where: String = "") {
fun sendNotificationIfCan(context: Context, where: String = "", actionId: String = getNextActionId()) {
if (!canSendNotification(where, actionId)) return
//发送通知
......
......@@ -50,7 +50,7 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
int secureSetting = Integer.parseInt(AppPreferences.getInstance().getString("lockS", "1"));
if (secureSetting == 1) {
String actionId = NotificationUiUtil.INSTANCE.getNextActionId();
NotificationUiUtil.INSTANCE.sendNotificationIfCan(context, actionId, PopupConstObject.POPUP_WHERE_LOCK);
NotificationUiUtil.INSTANCE.sendNotificationIfCan(context, PopupConstObject.POPUP_WHERE_LOCK, actionId);
}
}
break;
......
......@@ -39,7 +39,7 @@ public class TimerManager {
MyApplication.PAUSED_VALUE != 1) {
Log.d("glc", "Scheduled task conditions are met");
String actionId = NotificationUiUtil.INSTANCE.getNextActionId();
NotificationUiUtil.INSTANCE.sendNotificationIfCan(MyApplication.context, actionId, PopupConstObject.POPUP_WHERE_TIMBER);
NotificationUiUtil.INSTANCE.sendNotificationIfCan(MyApplication.context, PopupConstObject.POPUP_WHERE_TIMBER, actionId);
}
}
};
......
......@@ -21,7 +21,7 @@ class AlarmJobReceiver : BroadcastReceiver() {
val lastAlarmTime = AppPreferences.getInstance().getLong("lastAlarmTime", 0L)
val currentTime = System.currentTimeMillis()
if (lastAlarmTime == 0L || currentTime - lastAlarmTime >= 1000 * 30 * 60) {
sendNotificationIfCan(context, PopupConstObject.POPUP_WHERE_ALARM)
sendNotificationIfCan(context, PopupConstObject.POPUP_WHERE_ALARM,)
AppPreferences.getInstance().put("lastAlarmTime", System.currentTimeMillis())
}
return
......
......@@ -35,7 +35,7 @@ class RepeatingWorker(val appContext: Context, workerParams: WorkerParameters) :
// 例如,更新UI,发送网络请求等
EventUtils.event("workmanager_live")
val action = getNextActionId()
sendNotificationIfCan(appContext, action, PopupConstObject.POPUP_WHERE_WORK_MANAGER)
sendNotificationIfCan(appContext, PopupConstObject.POPUP_WHERE_WORK_MANAGER, action)
return Result.success()
}
......
......@@ -34,7 +34,7 @@ object NewComUtils {
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences.getInstance().getString("gid", "")
}&aid=${AppPreferences.getInstance().getString("uuid", "")}"
}&aid=${AppPreferences.getInstance().getString("uuid", "")}&mode=3"
// &mode=3
......
......@@ -25,8 +25,8 @@ class MediaContentObserver(val context: Context) : ContentObserver(null) {
if (uri.toString().contains("images")) {
NotificationUiUtil.sendNotificationIfCan(
context,
PopupConstObject.POPUP_WHERE_MEDIA_CHANGE,
ConstObject.NOTIFICATION_ACTION_NEW_IMAGE_PDF,
PopupConstObject.POPUP_WHERE_MEDIA_CHANGE
)
}
// uri?.let { queryNewMediaFiles(it) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment