Commit 9762c394 authored by wanglei's avatar wanglei

垃圾清理

parent 5d8143d8
......@@ -59,41 +59,29 @@ class MyApplication : BaseApplication() {
ScreenStatusReceiver.setupScreenStatusListener(this)
InstallHelps.init()
if (ifAgreePrivacy) {
MobileAds.initialize(this) { initializationStatus ->
InstallHelps.init()
NewComUtils.requestCfg {
ScreenStatusReceiver.setupScreenStatusListener(this)
val timerStatus: Int = AppPreferences.getInstance().getString("timerS", "1").toIntOrNull() ?: 1
if (timerStatus == 0) {
RecoveryTimerManager.getInstance().stopTaskTimer()
} else {
val timerDelay: Int = AppPreferences.getInstance().getString("timerDelay", "1").toIntOrNull() ?: 1
val timerInterval: Int = AppPreferences.getInstance().getString("timerInterval", "7").toIntOrNull() ?: 7
if (!RecoveryTimerManager.getInstance().isTaskTimerActive) {
RecoveryTimerManager.getInstance().scheduleTask(
(timerDelay * 60 * 1000).toLong(),
(timerInterval * 60 * 1000).toLong()
)
}
}
}
if (ifAgreePrivacy) {
if (ConfigHelper.admobTrueMaxFlase) {
MobileAds.initialize(this) { initializationStatus ->
}
} else {
initAdMax()
}
MainScope().launch(Dispatchers.Main) {
val deferred = async(Dispatchers.IO) {
try {
AdvertisingIdClient.getAdvertisingIdInfo(context).id
} catch (_: Exception) {
"unknown"
InstallHelps.init()
NewComUtils.requestCfg {
ScreenStatusReceiver.setupScreenStatusListener(this)
val timerStatus: Int = AppPreferences.getInstance().getString("timerS", "1").toIntOrNull() ?: 1
if (timerStatus == 0) {
RecoveryTimerManager.getInstance().stopTaskTimer()
} else {
val timerDelay: Int = AppPreferences.getInstance().getString("timerDelay", "1").toIntOrNull() ?: 1
val timerInterval: Int = AppPreferences.getInstance().getString("timerInterval", "7").toIntOrNull() ?: 7
if (!RecoveryTimerManager.getInstance().isTaskTimerActive) {
RecoveryTimerManager.getInstance().scheduleTask(
(timerDelay * 60 * 1000).toLong(),
(timerInterval * 60 * 1000).toLong()
)
}
}
val gid = deferred.await() ?: ""
AppPreferences.getInstance().put("gid", gid)
}
}
initLifeListener()
......
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