📅  最后修改于: 2022-03-11 14:55:24.082000             🧑  作者: Mango
AppLog.i("System UI Service is Restarting")
val startSystemUiIntent = Intent(context, AwesomeService::class.java)
val restartServicePendingIntent = PendingIntent.getService(context, 1, startSystemUiIntent, PendingIntent.FLAG_ONE_SHOT)
val alarmManager = getSystemService(ALARM_SERVICE) as AlarmManager
alarmManager.setExact(AlarmManager.RTC_WAKEUP, SystemClock.currentThreadTimeMillis(), restartServicePendingIntent)
stopService(Intent(context, SystemUIService::class.java))