You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
29 lines
894 B
Java
29 lines
894 B
Java
package com.topjohnwu.magisk.receivers;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Build;
|
|
|
|
import com.topjohnwu.magisk.services.OnBootIntentService;
|
|
|
|
public class BootReceiver extends BroadcastReceiver {
|
|
|
|
private void startIntentService(Context context) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
context.startForegroundService(new Intent(context, OnBootIntentService.class));
|
|
} else {
|
|
context.startService(new Intent(context, OnBootIntentService.class));
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onReceive(Context context, Intent intent) {
|
|
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
|
|
// There is currently no need to start an IntentService onBoot
|
|
// startIntentService(context);
|
|
}
|
|
}
|
|
|
|
}
|