Commit 3fcf0dcc authored by wanglei's avatar wanglei

...

parent 98d7c4d7
......@@ -45,9 +45,6 @@ class MyApplication : Application() {
var pdfSplitLanguage: String = Locale.getDefault().language
var wordLanguage: String = Locale.getDefault().language
var umpCanAd: Boolean = true
@JvmField
var PAUSED_VALUE = 0
}
......
......@@ -17,7 +17,6 @@ import com.base.pdfviewerscannerwhite.databinding.ActivitySplash2Binding
import com.base.pdfviewerscannerwhite.fcm.NotificationHoverUtils
import com.base.pdfviewerscannerwhite.helper.BaseActivity
import com.base.pdfviewerscannerwhite.helper.MyApplication
import com.base.pdfviewerscannerwhite.helper.MyApplication.Companion.umpCanAd
import com.base.pdfviewerscannerwhite.service.StayNotificationService.Companion.startStayNotification
import com.base.pdfviewerscannerwhite.ui.main.MainActivity
import com.base.pdfviewerscannerwhite.ui.permission.PermissionActivity
......@@ -26,6 +25,8 @@ import com.base.pdfviewerscannerwhite.utils.BarUtils
import com.base.pdfviewerscannerwhite.utils.LogEx
import com.base.pdfviewerscannerwhite.utils.UmpUtils
import com.base.pdfviewerscannerwhite.utils.UmpUtils.requestUMP
import com.base.pdfviewerscannerwhite.utils.UmpUtils.umpCalled
import com.base.pdfviewerscannerwhite.utils.UmpUtils.umpCanAd
import java.util.Calendar
import java.util.Locale
import java.util.concurrent.atomic.AtomicBoolean
......@@ -110,13 +111,18 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
if (isHotLaunch) {
agreePrivacy()
} else {
if (!umpCalled) {
UmpUtils.callback = {
umpCalled = true
umpCanAd = it
LogEx.logDebug(TAG, "UmpUtils.callback $it")
(application as MyApplication).initSolarEngine(it)
umpCanAd = it
agreePrivacy()
}
requestUMP(this)
} else {
agreePrivacy()
}
}
}
}
......
......@@ -17,6 +17,22 @@ import kotlinx.coroutines.launch
object UmpUtils {
var umpCanAd = true
get() {
return AppPreferences.getInstance().getBoolean("umpCanAd", field)
}
set(value) {
field = value
AppPreferences.getInstance().put("umpCanAd", value, true)
}
var umpCalled = false
get() {
return AppPreferences.getInstance().getBoolean("umpCalled", field)
}
set(value) {
field = value
AppPreferences.getInstance().put("umpCalled", value, true)
}
private fun Context.umpTest(): ConsentDebugSettings {
val debugSettings = ConsentDebugSettings.Builder(this)
......
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