mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-17 11:19:01 +00:00
fix potential ANR when scheduling task notifications
This commit is contained in:
parent
e99ff76f67
commit
a4ea581a71
2 changed files with 5 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.habitrpg.android.habitica"
|
||||
android:versionCode="1925"
|
||||
android:versionCode="1926"
|
||||
android:versionName="1.1.6"
|
||||
android:screenOrientation="portrait"
|
||||
android:installLocation="auto" >
|
||||
|
|
|
|||
|
|
@ -531,15 +531,17 @@ public class Task extends RealmObject implements Parcelable {
|
|||
newTime.setTime(today.getTime());
|
||||
} else if (FREQUENCY_WEEKLY.equals(this.getFrequency())) {
|
||||
int nextActiveDayOfTheWeek = newTime.get(Calendar.DAY_OF_WEEK);
|
||||
while ((!this.getRepeat().getForDay(nextActiveDayOfTheWeek) || newTime.before(today) || newTime.equals(today)) && nextActiveDayOfTheWeek < 7) {
|
||||
int daysChecked = 0;
|
||||
while ((!this.getRepeat().getForDay(nextActiveDayOfTheWeek) || newTime.before(today) || newTime.equals(today)) && daysChecked <= 7) {
|
||||
if (nextActiveDayOfTheWeek == 6) {
|
||||
nextActiveDayOfTheWeek = 0;
|
||||
} else {
|
||||
nextActiveDayOfTheWeek += 1;
|
||||
}
|
||||
daysChecked += 1;
|
||||
newTime.add(Calendar.DATE, 1);
|
||||
}
|
||||
if (nextActiveDayOfTheWeek > 7) {
|
||||
if (daysChecked > 7) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue