Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't redisplay notifications after they have been dismissed
Fixes signalapp/Signal-Android#5751 Fixes signalapp/Signal-Android#6218 // FREEBIE Upstream commit: signalapp/Signal-Android@2f46c6c
- Loading branch information
1 parent
64ca1e2
commit f265f25
Showing
20 changed files
with
141 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule com.amulyakhare.textdrawable
updated
from 558677 to be6cb9
Submodule com.android.support.support-v4-preferencefragment
updated
from 717a45 to ace4ea
Submodule org.whispersystems.jobmanager
updated
from 0ed6cc to b0f8ec
Submodule org.whispersystems.libpastelog
updated
from 605454 to b5056c
Submodule org.whispersystems.libsignal
updated
from 686e3d to 13fa05
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/org/smssecure/smssecure/notifications/DeleteNotificationReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.smssecure.smssecure.notifications; | ||
|
||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.os.AsyncTask; | ||
|
||
import org.smssecure.smssecure.database.DatabaseFactory; | ||
|
||
public class DeleteNotificationReceiver extends BroadcastReceiver { | ||
|
||
public static String DELETE_NOTIFICATION_ACTION = "org.smssecure.smssecure.DELETE_NOTIFICATION"; | ||
|
||
public static String EXTRA_IDS = "message_ids"; | ||
public static String EXTRA_MMS = "is_mms"; | ||
|
||
@Override | ||
public void onReceive(final Context context, Intent intent) { | ||
if (DELETE_NOTIFICATION_ACTION.equals(intent.getAction())) { | ||
MessageNotifier.clearReminder(context); | ||
|
||
final long[] ids = intent.getLongArrayExtra(EXTRA_IDS); | ||
final boolean[] mms = intent.getBooleanArrayExtra(EXTRA_MMS); | ||
|
||
if (ids == null || mms == null || ids.length != mms.length) return; | ||
|
||
new AsyncTask<Void, Void, Void>() { | ||
@Override | ||
protected Void doInBackground(Void... params) { | ||
for (int i=0;i<ids.length;i++) { | ||
if (!mms[i]) DatabaseFactory.getSmsDatabase(context).markAsNotified(ids[i]); | ||
else DatabaseFactory.getMmsDatabase(context).markAsNotified(ids[i]); | ||
} | ||
|
||
return null; | ||
} | ||
}.execute(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.