mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-12-04 16:57:27 +00:00
Wakeful receivers only handle non-null intents
This commit is contained in:
parent
87465cd1dd
commit
ecfe3da3f7
3 changed files with 10 additions and 7 deletions
|
@ -95,7 +95,9 @@ public class CheckinService extends IntentService {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
} finally {
|
} finally {
|
||||||
|
if (intent != null) {
|
||||||
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
||||||
|
}
|
||||||
schedule(this);
|
schedule(this);
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
|
|
|
@ -320,7 +320,7 @@ public class McsService extends Service implements Handler.Callback {
|
||||||
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
||||||
} else if (connectIntent == null) {
|
} else if (connectIntent == null) {
|
||||||
connectIntent = intent;
|
connectIntent = intent;
|
||||||
} else {
|
} else if (intent != null) {
|
||||||
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
WakefulBroadcastReceiver.completeWakefulIntent(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,12 +112,13 @@ class PushRegisterService : LifecycleService() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
|
if (intent != null) {
|
||||||
WakefulBroadcastReceiver.completeWakefulIntent(intent)
|
WakefulBroadcastReceiver.completeWakefulIntent(intent)
|
||||||
Log.d(TAG, "onStartCommand: $intent")
|
Log.d(TAG, "onStartCommand: $intent")
|
||||||
lifecycleScope.launchWhenStarted {
|
lifecycleScope.launchWhenStarted {
|
||||||
if (intent == null) return@launchWhenStarted
|
|
||||||
handleIntent(intent)
|
handleIntent(intent)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return super.onStartCommand(intent, flags, startId)
|
return super.onStartCommand(intent, flags, startId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue