Commit 16332edf authored by Your Name's avatar Your Name

Merge remote-tracking branch 'origin/master'

parents beb913b0 c41dc2fa
Pipeline #1411 canceled with stages
......@@ -33,6 +33,7 @@ import com.swiftcleaner.chovey.view.MainActivity;
import com.zxdemo.ZxApplication;
import com.zxdemo.admob.AdmobHelper;
import com.zxdemo.http.ZxHttp;
import com.zxdemo.service.PermanentNotifyService;
import com.zxdemo.utils.ActivityLauncher;
import com.zxdemo.utils.NonBlockingCountdown;
......@@ -87,7 +88,7 @@ public class StartActivity extends AppCompatActivity {
//协议
setupAgreementTextView();
}
PermanentNotifyService.Companion.startOmgNotification(this);
}
@Override
......
......@@ -6,6 +6,7 @@ import android.app.KeyguardManager
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.Bundle
import android.os.PowerManager
import android.text.TextUtils
......@@ -54,7 +55,9 @@ class ZxApplication : Application() {
val powerManager = getSystemService(Context.POWER_SERVICE) as PowerManager
isScreenOn = powerManager.isInteractive
startOmgNotification()
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
startOmgNotification()
}
}
fun initApp() {
......
......@@ -90,10 +90,10 @@ object NotificationUtils {
.setLargeIcon(
BitmapFactory.decodeResource(
context.resources,
R.mipmap.ic_launcher
R.mipmap.logox
)
)
.setSmallIcon(R.mipmap.ic_launcher_round)
.setSmallIcon(R.mipmap.logox)
.setVibrate(longArrayOf(0)) // 禁止震动
.setSound(null) // 禁止声音
.setContentTitle("")
......
......@@ -30,9 +30,6 @@ class PermanentNotifyService : Service() {
var isRunning = false
fun Context.startOmgNotification() {
val intent = Intent(this, PermanentNotifyService::class.java)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(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