2019-03-28 08:56:35 -07:00
|
|
|
package org.thoughtcrime.securesms.jobmanager;
|
|
|
|
|
|
|
|
import android.app.Service;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.IBinder;
|
2020-08-19 10:06:26 +10:00
|
|
|
import androidx.annotation.Nullable;
|
2019-03-28 08:56:35 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Service that keeps the application in memory while the app is closed.
|
|
|
|
*
|
|
|
|
* Important: Should only be used on API < 26.
|
|
|
|
*/
|
|
|
|
public class KeepAliveService extends Service {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public @Nullable IBinder onBind(Intent intent) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
|
|
|
return START_STICKY;
|
|
|
|
}
|
|
|
|
}
|