From 5fb7ca418025a12cdfdab2ef1053fdd5bceff708 Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Sun, 3 Aug 2025 14:04:32 +0200 Subject: [PATCH 1/9] [update] Removes the foreground service requirement for the timer service. --- app/src/main/AndroidManifest.xml | 5 +- .../activities/ExerciseActivity.java | 62 ++++++++++++++++++- .../receivers/TimerSchedulerReceiver.java | 11 ++-- .../aktivpause/service/TimerService.java | 49 +++++++++++++-- 4 files changed, 110 insertions(+), 17 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 88e8f33..3c5e177 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -10,8 +10,6 @@ - - + android:exported="false" /> loader, ExerciseSet set) { if (set != null) { diff --git a/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java b/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java index 8138054..d9318ef 100644 --- a/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java +++ b/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java @@ -11,6 +11,7 @@ import android.os.Build; import android.os.IBinder; import android.preference.PreferenceManager; import androidx.annotation.NonNull; +import androidx.core.app.AlarmManagerCompat; import androidx.legacy.content.WakefulBroadcastReceiver; import org.secuso.aktivpause.service.TimerService; @@ -79,7 +80,7 @@ public class TimerSchedulerReceiver extends WakefulBroadcastReceiver { AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent automaticTimerIntent = new Intent(context, TimerSchedulerReceiver.class); - PendingIntent automaticTimerPending = PendingIntent.getBroadcast(context, 0, automaticTimerIntent, PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent automaticTimerPending = PendingIntent.getBroadcast(context, 0, automaticTimerIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timestamp); @@ -143,12 +144,8 @@ public class TimerSchedulerReceiver extends WakefulBroadcastReceiver { } } - if(done || !scheduleExerciseDaysEnabled) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending); - } else { - alarmManager.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending); - } + if((done || !scheduleExerciseDaysEnabled)) { + AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending); } } diff --git a/app/src/main/java/org/secuso/aktivpause/service/TimerService.java b/app/src/main/java/org/secuso/aktivpause/service/TimerService.java index 8b74948..99bb99d 100644 --- a/app/src/main/java/org/secuso/aktivpause/service/TimerService.java +++ b/app/src/main/java/org/secuso/aktivpause/service/TimerService.java @@ -12,6 +12,7 @@ import android.content.SharedPreferences; import android.content.pm.ServiceInfo; import android.os.Binder; import android.os.CountDownTimer; +import android.os.Handler; import android.os.IBinder; import android.preference.PreferenceManager; import android.provider.Settings; @@ -56,6 +57,9 @@ public class TimerService extends Service { private static final int UPDATE_INTERVAL = 125; public static final int NOTIFICATION_ID = 31337; + private NotificationCompat.Builder notiBuilder = null; + private NotificationManager notiManager = null; + private boolean isAppInBackground = false; private TimerServiceBinder mBinder = new TimerServiceBinder(); private CountDownTimer mTimer; @@ -366,13 +370,50 @@ public class TimerService extends Service { } private void updateNotification() { - if(isRunning() || isPaused()) { - ServiceCompat.startForeground(this, NOTIFICATION_ID, buildNotification(), ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE); - } else { - stopForeground(true); + if(isAppInBackground) { + Notification notification = buildNotification(); + notiManager.notify(NOTIFICATION_ID, notification); + } + else if(notiManager != null) { + notiManager.cancel(NOTIFICATION_ID); } } + /** + * Check if the app is in the background. + * If so, start a notification showing the current timer. + * + * @param isInBackground Sets global flag to determine whether the app is in the background + */ + public void setIsAppInBackground(boolean isInBackground){ + this.isAppInBackground = isInBackground; + + //Execute after short delay to prevent short notification popup if workoutActivity is closed + final Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + updateNotification(); + } + }, 700); + } + + /** + * Cancel the notification when workout activity is destroyed + */ + public void workoutClosed(){ + this.isAppInBackground = false; + notiManager.cancel(NOTIFICATION_ID); + } + +// private void updateNotification() { +// if(isRunning() || isPaused()) { +// ServiceCompat.startForeground(this, NOTIFICATION_ID, buildNotification(), ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE); +// } else { +// stopForeground(true); +// } +// } + @Override public IBinder onBind(Intent intent) { return mBinder; From ca48a56dde15c8f1e8edf7c43f3c8d4583fc02aa Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Sun, 3 Aug 2025 14:53:58 +0200 Subject: [PATCH 2/9] Change versionCode to differentiate from last Google Play version --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 167eccd..6a4248a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.secuso.aktivpause" minSdkVersion 21 targetSdkVersion 34 - versionCode 11 - versionName "1.2.2" + versionCode 100 + versionName "1.2.3" vectorDrawables.useSupportLibrary = true } buildTypes { From cb98c61dbd5ef9905e419283bdd27b22b53323a9 Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Fri, 22 Aug 2025 09:40:39 +0200 Subject: [PATCH 3/9] [fix] Adds missing RECEIVER_NOT_EXPORTED. --- .../main/java/org/secuso/aktivpause/service/TimerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/secuso/aktivpause/service/TimerService.java b/app/src/main/java/org/secuso/aktivpause/service/TimerService.java index 99bb99d..09f2966 100644 --- a/app/src/main/java/org/secuso/aktivpause/service/TimerService.java +++ b/app/src/main/java/org/secuso/aktivpause/service/TimerService.java @@ -147,7 +147,7 @@ public class TimerService extends Service { super.onCreate(); - registerReceiver(timerReceiver, new IntentFilter(TIMER_BROADCAST)); + ContextCompat.registerReceiver(this, timerReceiver, new IntentFilter(TIMER_BROADCAST), ContextCompat.RECEIVER_NOT_EXPORTED); ContextCompat.registerReceiver(this, notificationDeletedReceiver, new IntentFilter(ACTION_NOTIFICATION_DELETED), ContextCompat.RECEIVER_NOT_EXPORTED); ContextCompat.registerReceiver(this, notificationPreferenceChangedReceiver, new IntentFilter(ACTION_NOTIFICATION_CANCELED), ContextCompat.RECEIVER_NOT_EXPORTED); } From 8b4b0293b1d56314981702bae18c9f052593ba03 Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Fri, 22 Aug 2025 09:47:46 +0200 Subject: [PATCH 4/9] [fix] Adds missing RECEIVER_NOT_EXPORTED. --- .../java/org/secuso/aktivpause/activities/TimerActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java b/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java index 0f3c4ce..b92aac0 100644 --- a/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java +++ b/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java @@ -15,6 +15,7 @@ import android.preference.PreferenceManager; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; import androidx.loader.app.LoaderManager; import androidx.loader.content.AsyncTaskLoader; import androidx.loader.content.Loader; @@ -231,7 +232,7 @@ public class TimerActivity extends BaseActivity implements LoaderManager.LoaderC isActivityVisible = true; - registerReceiver(timerReceiver, new IntentFilter(TimerService.TIMER_BROADCAST)); + ContextCompat.registerReceiver(this, timerReceiver, new IntentFilter(TimerService.TIMER_BROADCAST), ContextCompat.RECEIVER_NOT_EXPORTED); if(mTimerService != null && !mTimerService.isRunning()) { updateProgress(mTimerService.getInitialDuration()); From 1917800db5e8067b2d46abb8db95a28b5687c994 Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Fri, 22 Aug 2025 09:48:27 +0200 Subject: [PATCH 5/9] [bump] version. --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6a4248a..f08fdef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.secuso.aktivpause" minSdkVersion 21 targetSdkVersion 34 - versionCode 100 - versionName "1.2.3" + versionCode 101 + versionName "1.2.5" vectorDrawables.useSupportLibrary = true } buildTypes { From f07974daee5b29473a4727b0ee6c9ef879db19f4 Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Fri, 22 Aug 2025 12:26:27 +0200 Subject: [PATCH 6/9] [fix] Adds missing canScheduleExactAlarm guard. --- app/build.gradle | 4 ++-- .../secuso/aktivpause/receivers/TimerSchedulerReceiver.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f08fdef..c9c2eec 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.secuso.aktivpause" minSdkVersion 21 targetSdkVersion 34 - versionCode 101 - versionName "1.2.5" + versionCode 102 + versionName "1.2.6" vectorDrawables.useSupportLibrary = true } buildTypes { diff --git a/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java b/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java index d9318ef..6ebfc46 100644 --- a/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java +++ b/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java @@ -144,7 +144,7 @@ public class TimerSchedulerReceiver extends WakefulBroadcastReceiver { } } - if((done || !scheduleExerciseDaysEnabled)) { + if((done || !scheduleExerciseDaysEnabled) && (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) || alarmManager.canScheduleExactAlarms()) { AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending); } } From 6c5d5c6b81d9e5d66886cadbf3fc65646e096127 Mon Sep 17 00:00:00 2001 From: coderPaddyS Date: Fri, 22 Aug 2025 10:30:19 +0000 Subject: [PATCH 7/9] update changelog for v1.2.6 changes This commit was created by changelog-from-release in 'Changelog Generation' CI workflow --- CHANGELOG.md | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..843cdfb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,108 @@ +# Changelog + + +## [Aktivpause to Go v1.2.6](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.6) - 2025-08-22 + +Fixes missing canScheduleExactAlarm check. +**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2.5...v1.2.6 + +[Changes][v1.2.6] + + + +## [Aktivpause to Go v1.2.5](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.5) - 2025-08-22 + +Fixes crashes due to missing receiver flags. +**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2.4...v1.2.5 + +[Changes][v1.2.5] + + + +## [Aktivpause to Go v1.2.3](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.3) - 2025-08-03 + +## What's Changed +* Change versionCode to differentiate from last Google Play version by [@coderPaddyS](https://github.com/coderPaddyS) in [#28](https://github.com/SecUSo/Aktivpause/pull/28) + + +**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2.2...v1.2.3 + +[Changes][v1.2.3] + + + +## [Aktivpause to Go v1.2.2](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.2) - 2025-07-23 + +## What's Changed +* documentation: Added info re: Privacy Friendly Backup by [@jahway603](https://github.com/jahway603) in [#16](https://github.com/SecUSo/Aktivpause/pull/16) +* Updates Copyright by [@coderPaddyS](https://github.com/coderPaddyS) in [#17](https://github.com/SecUSo/Aktivpause/pull/17) +* Update to SDK 34; Fixes a bug hindering the training to start. by [@coderPaddyS](https://github.com/coderPaddyS) in [#21](https://github.com/SecUSo/Aktivpause/pull/21) +* Adds ci and changelog workflows. by [@coderPaddyS](https://github.com/coderPaddyS) in [#24](https://github.com/SecUSo/Aktivpause/pull/24) +* Updates App-Info by [@coderPaddyS](https://github.com/coderPaddyS) in [#22](https://github.com/SecUSo/Aktivpause/pull/22) + +## New Contributors +* [@jahway603](https://github.com/jahway603) made their first contribution in [#16](https://github.com/SecUSo/Aktivpause/pull/16) + +**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2...v1.2.2 + +[Changes][v1.2.2] + + + +## [v1.2](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2) - 2023-05-28 + +## What's Changed +* Backup integration by [@coderPaddyS](https://github.com/coderPaddyS) in [#14](https://github.com/SecUSo/Aktivpause/pull/14) + +## New Contributors +* [@coderPaddyS](https://github.com/coderPaddyS) made their first contribution in [#14](https://github.com/SecUSo/Aktivpause/pull/14) + +**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.1.2...v1.2 + +[Changes][v1.2] + + + +## [Aktivpause to Go v1.1.2](https://github.com/SecUSo/Aktivpause/releases/tag/v1.1.2) - 2020-07-09 + +- Evaluation is done. Thank you for participating. +- Removed evaluation link + +[Changes][v1.1.2] + + + +## [Aktivpause to Go v1.1.1](https://github.com/SecUSo/Aktivpause/releases/tag/v1.1.1) - 2020-04-02 + +- Release für PlayStore + +[Changes][v1.1.1] + + + +## [Aktivpause to Go v1.1](https://github.com/SecUSo/Aktivpause/releases/tag/v1.1) - 2020-04-02 + +- Online-Umfrage Link hinzugefügt + +[Changes][v1.1] + + + +## [Aktivpause to Go (v1.0)](https://github.com/SecUSo/Aktivpause/releases/tag/v1.0) - 2019-10-28 + +- Initial release + +[Changes][v1.0] + + +[v1.2.6]: https://github.com/SecUSo/Aktivpause/compare/v1.2.5...v1.2.6 +[v1.2.5]: https://github.com/SecUSo/Aktivpause/compare/v1.2.3...v1.2.5 +[v1.2.3]: https://github.com/SecUSo/Aktivpause/compare/v1.2.2...v1.2.3 +[v1.2.2]: https://github.com/SecUSo/Aktivpause/compare/v1.2...v1.2.2 +[v1.2]: https://github.com/SecUSo/Aktivpause/compare/v1.1.2...v1.2 +[v1.1.2]: https://github.com/SecUSo/Aktivpause/compare/v1.1.1...v1.1.2 +[v1.1.1]: https://github.com/SecUSo/Aktivpause/compare/v1.1...v1.1.1 +[v1.1]: https://github.com/SecUSo/Aktivpause/compare/v1.0...v1.1 +[v1.0]: https://github.com/SecUSo/Aktivpause/tree/v1.0 + + From a5afddb770ac7a0a2455f9e3cb37946d2a877a22 Mon Sep 17 00:00:00 2001 From: Izzy Date: Mon, 21 Jul 2025 00:30:48 +0200 Subject: [PATCH 8/9] fastlane: slightly improve formatting for full descriptions --- fastlane/metadata/android/de-DE/full_description.txt | 9 ++++++--- fastlane/metadata/android/en-US/full_description.txt | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/fastlane/metadata/android/de-DE/full_description.txt b/fastlane/metadata/android/de-DE/full_description.txt index 1755c83..d20c39d 100644 --- a/fastlane/metadata/android/de-DE/full_description.txt +++ b/fastlane/metadata/android/de-DE/full_description.txt @@ -1,5 +1,7 @@ Die Aktivpause-App ermöglicht es Ihnen, selbstständig Bewegungspausen durchzuführen und so ganz individuell eine gezielte Auszeit in Ihren Arbeitsalltag zu integrieren. Wann, wo und wie lange Sie aktive Pausen machen, können Sie somit für sich persönlich entscheiden. Das breite Übungsspektrum stammt aus dem etablierten Aktivpause-Programm am KIT und wurde von Wissenschaftler*innen am Institut für Sport und Sportwissenschaft des KIT zusammengestellt. + Folgende Features bietet die Aktivpause-App: + 1. Auswahl und Erstellung von Übungssets: Aus den vorhandenen Übungen lassen sich individuelle Übungssets zusammenstellen, die für die Pausen ausgewählt werden können. Es stehen auch vordefinierte Übungssets zur Verfügung, die Ihnen den Start erleichtern. 2. Das Übungsspektrum reicht von Übungen zur Aktivierung des Herz-Kreislauf-Systems über Dehnungs- und Kräftigungs- bis hin zu Entspannungsübungen. 3. Mit der Filterfunktion können Sie gezielt Übungen nach Körperregion auswählen und etwaige Beschwerden vorbeugen. @@ -8,6 +10,7 @@ Folgende Features bietet die Aktivpause-App: Kontaktieren Sie uns gerne über: -Bluesky - @secusoresearch.bsky.social https://bsky.app/profile/secusoresearch.bsky.social -Mastodon - @SECUSO_Research@bawü.social https://xn--baw-joa.social/@SECUSO_Research/ -Offene Stellen - https://secuso.aifb.kit.edu/83.php \ No newline at end of file + +* Bluesky - @secusoresearch.bsky.social https://bsky.app/profile/secusoresearch.bsky.social +* Mastodon - @SECUSO_Research@bawü.social https://xn--baw-joa.social/@SECUSO_Research/ +* Offene Stellen - https://secuso.aifb.kit.edu/83.php \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 5276374..ed6bdc7 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -1,6 +1,7 @@ The Aktivpause to Go App allows you to integrate planned breaks into your daily work. You can decide when, where and for how long you want to take breaks and this app will help shape your break in a healthy way. It offers a wide variety of exercises from the well-established Aktivpause program at KIT and was developed by Scientists at the Institute of Sports and Sports Science (IfSS) of KIT. Exercises are currently only provided in german. The following features are provided by the app: + 1. Creation and Choice of exercise sets: Individual exercise sets can be created. This makes it easier to complete your favorite exercises faster. The exercise sets can then be chosen to perform during breaks. There are also predefined exercise sets to ease the start into the app. 2. There are a wide variety of exercises: Exercises to activate the cardiovascular system, stretching, strength, and relaxation exercises. 3. The filter feature lets you easily choose exercises for specific body regions that may help you prevent potential complaints. @@ -8,6 +9,7 @@ The following features are provided by the app: 5. Integrate the Aktivpause break into your daily routine. You can schedule breaks to start at specific times and days, so you don’t have to think about starting the timer manually to be reminded to take breaks. Feel free to contact us via: -Bluesky - @secusoresearch.bsky.social https://bsky.app/profile/secusoresearch.bsky.social -Mastodon - @SECUSO_Research@bawü.social https://xn--baw-joa.social/@SECUSO_Research/ -Job opening - https://secuso.aifb.kit.edu/english/Job_Offers.php \ No newline at end of file + +* Bluesky - @secusoresearch.bsky.social https://bsky.app/profile/secusoresearch.bsky.social +* Mastodon - @SECUSO_Research@bawü.social https://xn--baw-joa.social/@SECUSO_Research/ +* Job opening - https://secuso.aifb.kit.edu/english/Job_Offers.php \ No newline at end of file From 3d0d88b52575644c8774ba1683f4e8e973b94a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= <98773052+udenr@users.noreply.github.com> Date: Tue, 13 Jan 2026 13:08:34 +0100 Subject: [PATCH 9/9] Add F-Droid badge to README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index acdf54c..5d50b79 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ ## Aktivpause +[Get it on F-Droid](https://f-droid.org/repository/browse/?fdid=org.secuso.aktivpause) + The Aktivpause to Go App allows you to integrate planned breaks into your daily work. You can decide when, where and for how long you want to take breaks and this app will help shape your break in a healthy way. It offers a wide variety of exercises from the well-established Aktivpause program at KIT and was developed by Scientists at the Institute of Sports and Sports Science (IfSS) of KIT. Exercises are currently only provided in german. ## Download and more Information