Added Service.onTimeout

This commit is contained in:
M66B 2024-04-11 07:50:39 +02:00
parent c5099952bb
commit 9b317defe5
3 changed files with 18 additions and 0 deletions

View File

@ -72,6 +72,12 @@ public class ServiceExternal extends ServiceBase {
startForeground(NotificationHelper.NOTIFICATION_EXTERNAL, getNotification());
}
@Override
public void onTimeout(int startId) {
Log.e(new Throwable("onTimeout"));
stopSelf(startId);
}
@Override
public void onDestroy() {
Log.i("Service external destroy");

View File

@ -202,6 +202,12 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onTimeout(int startId) {
Log.e(new Throwable("onTimeout"));
stopSelf(startId);
}
@Override
public void onDestroy() {
EntityLog.log(this, "Service send destroy");

View File

@ -1177,6 +1177,12 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
return START_STICKY;
}
@Override
public void onTimeout(int startId) {
Log.e(new Throwable("onTimeout"));
stopSelf(startId);
}
private void onEnable(Intent intent) {
boolean enabled = intent.getBooleanExtra("enabled", true);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);