ForegroundService en Android Oreo es asesinado

Estoy tratando de crear un servicio que solicite la ubicación del dispositivo cada minuto. Necesito que esto funcione en segundo plano, incluso cuando la aplicación está cerrada. Hasta ahora logré hacerlo funcionar en dispositivos que tienen un sistema operativo Android anterior a Oreo, pero ahora estoy probando el servicio en un dispositivo Android Oreo y no funciona cuando cierro o pongo la aplicación en segundo plano. En mi investigación, descubrí que para los dispositivos Oreo se debe utilizar un servicio en primer plano con una notificación continua para lograr esto, así que para comenzar, he implementado un servicio en primer plano simple como el siguiente, que al iniciarlo muestra una notificación continua y cuando se detiene la notificación es removido

public class MyForegroundService extends Service {

    private static String TAG = MyForegroundService.class.getSimpleName();

    private static final String CHANNEL_ID = "channel_01";
    private static final int NOTIFICATION_ID = 12345678;

    private NotificationManager mNotificationManager;

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    public MyForegroundService() {
        super();
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.d(TAG, "onCreate");

        mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

        // Android O requires a Notification Channel.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            CharSequence name = getString(R.string.app_name);

            // Create the channel for the notification
            NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_DEFAULT);

            // Set the Notification Channel for the Notification Manager.
            mNotificationManager.createNotificationChannel(mChannel);
        }

        startForeground(NOTIFICATION_ID, getNotification());
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.d(TAG, "onStartCommand");

        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.d(TAG, "onDestroy");

        stopForeground(true);
    }

    private Notification getNotification() {

        // Get the application name from the Settings
        String appName = PrefApp.getSettings(getApplicationContext()).getAppConfigs().getAppName();
        String applicationKey = PrefApp.getSettings(getApplicationContext()).getAppConfigs().getAppKey();

        NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
                .setContentTitle(appName)
                .setContentText("Services are running")
                .setOngoing(true)
                .setPriority(Notification.PRIORITY_HIGH)
                .setSmallIcon(R.mipmap.ic_notification)
                .setWhen(System.currentTimeMillis());

        // Set the Channel ID for Android O.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            builder.setChannelId(CHANNEL_ID); // Channel ID
        }

        return builder.build();
    }
}

Estoy comenzando y deteniendo el servicio anterior utilizando las siguientes funciones.

public void startMyForegroundService() {
    Log.d(TAG, "Start Foreground Service");

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        startForegroundService(new Intent(getApplicationContext(), MyForegroundService.class));
    } else {
        startService(new Intent(getApplicationContext(), MyForegroundService.class));
    }
}

public void stopMyForegroundService() {
    Log.d(TAG, "Stop Foreground Service");
    stopService(new Intent(getApplicationContext(), MyForegroundService.class));
}

Estoy probando el servicio anterior y, por alguna razón, el servicio se anula después de unos 30 minutos desde que lo inicio. ¿Alguien puede decirme si estoy haciendo algo mal o posiblemente guiarme por una solución que pueda funcionar para mí?

Nota: He seguido estatutoria y probó su aplicación también y que todavía no funciona. El servicio se está cancelando después de un tiempo.

ásicamente, mi objetivo es implementar un servicio que pueda ejecutarse en segundo plano (incluso cuando la aplicación está cerrada) y obtener actualizaciones de ubicación cada minuto.

Respuestas a la pregunta(1)

Su respuesta a la pregunta