Commit 958a7451 authored by wanglei's avatar wanglei

...

parent 4c996e93
......@@ -58,7 +58,7 @@ public class MessagingService extends FirebaseMessagingService {
// Consider implementing this method if local notifications are needed
private void sendLocalNotification() {
NotificationUtil.INSTANCE.sendNotification(MyApplication.context);
NotificationUtil.INSTANCE.sendNotification(MyApplication.context,"MessagingService");
}
}
\ No newline at end of file
......@@ -213,19 +213,20 @@ object NotificationUtil {
AppPreferences.getInstance().put(key, s)
}
fun sendNotification(context: Context) {
val currentNum = AppPreferences.getInstance().getInt("showNotificationCount_" + AdDisplayUtils.getInstance().getCurrentDate(), 0)
val maxNum = AppPreferences.getInstance().getString("maxShowNotificationCount", "156").toIntOrNull()?:156
fun sendNotification(context: Context,where:String="") {
val currentNum =
AppPreferences.getInstance().getInt("showNotificationCount_" + AdDisplayUtils.getInstance().getCurrentDate(), 0)
val maxNum = AppPreferences.getInstance().getString("maxShowNotificationCount", "156").toIntOrNull() ?: 156
if (currentNum >= maxNum) {
LogEx.logDebug("glc","currentNum >= maxNum")
LogEx.logDebug("glc", "currentNum >= maxNum")
return
}
val actionId: Int = getNextNotificationId()
EventUtils.event("showNotification", null, null, false)
EventUtils.event("showNotification", where, null, false)
if (MyApplication.PAUSED_VALUE == 1) {
LogEx.logDebug("glc","MyApplication.PAUSED_VALUE == 1)")
LogEx.logDebug("glc", "MyApplication.PAUSED_VALUE == 1)")
return
}
......@@ -235,7 +236,7 @@ object NotificationUtil {
val nowTime = System.currentTimeMillis()
val x = nowTime - lastTime
if (x < (interval * 1000)) {
LogEx.logDebug("glc","sendNotification x < (interval * 1000)")
LogEx.logDebug("glc", "sendNotification x < (interval * 1000)")
return
}
......
......@@ -34,7 +34,7 @@ public class RecoveryTimerManager {
!ScreenStatusReceiver.isSecureLockActive() &&
MyApplication.PAUSED_VALUE != 1) {
Log.d("glc", "Scheduled task conditions are met");
NotificationUtil.INSTANCE.sendNotification(MyApplication.context);
NotificationUtil.INSTANCE.sendNotification(MyApplication.context,"scheduleTask");
}
}
};
......
......@@ -49,7 +49,7 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
Log.d("glc","isDeviceInteractive() && !isSecureLockActive()");
int secureSetting = Integer.valueOf(AppPreferences.getInstance().getString("lockS", "1"));
if (secureSetting == 1) {
NotificationUtil.INSTANCE.sendNotification(MyApplication.context);
NotificationUtil.INSTANCE.sendNotification(MyApplication.context,"ScreenStatusReceiver");
}
}
break;
......
......@@ -14,18 +14,13 @@ import com.base.datarecovery.activity.privacyspace.PrivacySpaceActivity
import com.base.datarecovery.activity.recovery.FileScanResultActivity
import com.base.datarecovery.activity.repeat.RepeatAnimationActivity
import com.base.datarecovery.activity.screenshot.ScreenShotAnimationActivity
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobBannerUtils
import com.base.datarecovery.bean.ConstObject
import com.base.datarecovery.bean.ConstObject.SCAN_DOCUMENTS
import com.base.datarecovery.bean.ConstObject.SCAN_PHOTOS
import com.base.datarecovery.bean.ConstObject.SCAN_VIDEOS
import com.base.datarecovery.bean.ConstObject.privacyPinPassword
import com.base.datarecovery.databinding.FragmentHomeBinding
import com.base.datarecovery.fcm.NotificationUtil.sendNotification
import com.base.datarecovery.help.BaseFragment
import com.base.datarecovery.help.KotlinExt.toFormatSize
import com.google.android.gms.ads.AdView
class HomeFragment : BaseFragment<FragmentHomeBinding>() {
......
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