Commit 0e780a9e authored by wanglei's avatar wanglei

...

parent 747216ec
...@@ -13,6 +13,7 @@ import com.test.easy.easycleanerjunk.fcm.CloseNotificationReceiver ...@@ -13,6 +13,7 @@ import com.test.easy.easycleanerjunk.fcm.CloseNotificationReceiver
import com.test.easy.easycleanerjunk.fcm.NotificationUtil import com.test.easy.easycleanerjunk.fcm.NotificationUtil
import com.test.easy.easycleanerjunk.helps.BaseActivity import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.ConfigHelper import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.ConfigHelper.remainNotification
import com.test.easy.easycleanerjunk.helps.EventUtils import com.test.easy.easycleanerjunk.helps.EventUtils
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.service.PermanentNotificationService import com.test.easy.easycleanerjunk.service.PermanentNotificationService
...@@ -82,11 +83,13 @@ class NewSplashActivity : BaseActivity<ActivityLayoutSplashBinding>(), ...@@ -82,11 +83,13 @@ class NewSplashActivity : BaseActivity<ActivityLayoutSplashBinding>(),
} }
private fun startNotification() { private fun startNotification() {
val intent = Intent(this, PermanentNotificationService::class.java) if (remainNotification) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val intent = Intent(this, PermanentNotificationService::class.java)
startForegroundService(intent) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
} else { startForegroundService(intent)
startService(intent) } else {
startService(intent)
}
} }
} }
......
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