mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-09-12 17:26:53 +02:00
Wakeful receivers only handle non-null intents
This commit is contained in:
parent
87465cd1dd
commit
ecfe3da3f7
@ -95,7 +95,9 @@ public class CheckinService extends IntentService {
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, e);
|
||||
} finally {
|
||||
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
||||
if (intent != null) {
|
||||
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
||||
}
|
||||
schedule(this);
|
||||
stopSelf();
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ public class McsService extends Service implements Handler.Callback {
|
||||
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
||||
} else if (connectIntent == null) {
|
||||
connectIntent = intent;
|
||||
} else {
|
||||
} else if (intent != null) {
|
||||
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
||||
}
|
||||
}
|
||||
|
@ -112,11 +112,12 @@ class PushRegisterService : LifecycleService() {
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
WakefulBroadcastReceiver.completeWakefulIntent(intent)
|
||||
Log.d(TAG, "onStartCommand: $intent")
|
||||
lifecycleScope.launchWhenStarted {
|
||||
if (intent == null) return@launchWhenStarted
|
||||
handleIntent(intent)
|
||||
if (intent != null) {
|
||||
WakefulBroadcastReceiver.completeWakefulIntent(intent)
|
||||
Log.d(TAG, "onStartCommand: $intent")
|
||||
lifecycleScope.launchWhenStarted {
|
||||
handleIntent(intent)
|
||||
}
|
||||
}
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user