Skip to content

Commit

Permalink
Merge branch 'hotfix/1.5.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Jun 19, 2016
2 parents c2dd26e + 98ad3aa commit 2b6fc06
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<manifest
package="org.isoron.uhabits"
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="21"
android:versionName="1.5.5">
android:versionCode="22"
android:versionName="1.5.6">

<uses-permission android:name="android.permission.VIBRATE"/>

Expand Down
17 changes: 10 additions & 7 deletions app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ protected void onPostExecute(Void aVoid)
contentIntent.setData(data);
PendingIntent contentPendingIntent =
PendingIntent.getActivity(context, 0, contentIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
PendingIntent.FLAG_UPDATE_CURRENT);

PendingIntent dismissPendingIntent = buildDismissIntent(context);
PendingIntent checkIntentPending = buildCheckIntent(context, habit, timestamp);
PendingIntent checkIntentPending = buildCheckIntent(context,
habit, timestamp, 1);
PendingIntent snoozeIntentPending = buildSnoozeIntent(context, habit);

Uri ringtoneUri = ReminderHelper.getRingtoneUri(context);
Expand Down Expand Up @@ -223,26 +224,28 @@ public static PendingIntent buildSnoozeIntent(Context context, Habit habit)
Intent snoozeIntent = new Intent(context, HabitBroadcastReceiver.class);
snoozeIntent.setData(data);
snoozeIntent.setAction(ACTION_SNOOZE);
return PendingIntent.getBroadcast(context, 0, snoozeIntent, PendingIntent.FLAG_CANCEL_CURRENT);
return PendingIntent.getBroadcast(context, 0, snoozeIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
}

public static PendingIntent buildCheckIntent(Context context, Habit habit, Long timestamp)
public static PendingIntent buildCheckIntent(Context context, Habit
habit, Long timestamp, int requestCode)
{
Uri data = habit.getUri();
Intent checkIntent = new Intent(context, HabitBroadcastReceiver.class);
checkIntent.setData(data);
checkIntent.setAction(ACTION_CHECK);
if(timestamp != null) checkIntent.putExtra("timestamp", timestamp);
return PendingIntent.getBroadcast(context, 0, checkIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
return PendingIntent.getBroadcast(context, requestCode, checkIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
}

public static PendingIntent buildDismissIntent(Context context)
{
Intent deleteIntent = new Intent(context, HabitBroadcastReceiver.class);
deleteIntent.setAction(ACTION_DISMISS);
return PendingIntent.getBroadcast(context, 0, deleteIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
PendingIntent.FLAG_UPDATE_CURRENT);
}

public static PendingIntent buildViewHabitIntent(Context context, Habit habit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected void refreshCustomViewData(View view)
@Override
protected PendingIntent getOnClickPendingIntent(Context context, Habit habit)
{
return HabitBroadcastReceiver.buildCheckIntent(context, habit, null);
return HabitBroadcastReceiver.buildCheckIntent(context, habit, null, 2);
}

@Override
Expand Down

0 comments on commit 2b6fc06

Please sign in to comment.