mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-24 00:11:09 +01:00
Fix
This commit is contained in:
parent
a9ee2e5065
commit
1ccd603860
@ -36,11 +36,10 @@ public class ForegroundServiceContext extends ContextWrapper {
|
||||
if (!isIgnoringBatteryOptimizations() && !isAppOnForeground()) {
|
||||
Log.d(TAG, "Starting in foreground mode.");
|
||||
service.putExtra(EXTRA_FOREGROUND, true);
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return super.startService(service);
|
||||
}
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
return super.startForegroundService(service);
|
||||
} else {
|
||||
return super.startService(service);
|
||||
}
|
||||
}
|
||||
return super.startService(service);
|
||||
|
@ -20,6 +20,7 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@ -27,6 +28,8 @@ import android.os.Messenger;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import org.microg.gms.checkin.LastCheckinInfo;
|
||||
import org.microg.gms.common.ForegroundServiceContext;
|
||||
import org.microg.gms.common.PackageUtils;
|
||||
@ -108,6 +111,7 @@ class PushRegisterHandler extends Handler {
|
||||
return PendingIntent.getBroadcast(context, 0, intent, 0);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
if (msg.what == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user