diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-11-18 15:26:28 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-11-18 15:26:28 +0100 |
commit | 66087cb3608ec70fd04248591b8531a0f4705a2f (patch) | |
tree | 731ebdaa368e14c6386193cc6e643577fafa035d /src/main/java/eu/siacs/conversations/utils | |
parent | 1122e084a0dc6327ea2ab75072211062e3077311 (diff) |
put error notification into notification service
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/UIHelper.java | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index 0d43450d..ed6efd06 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -106,48 +106,6 @@ public class UIHelper { } } - public static void showErrorNotification(Context context, - List<Account> accounts) { - NotificationManager mNotificationManager = (NotificationManager) context - .getSystemService(Context.NOTIFICATION_SERVICE); - List<Account> accountsWproblems = new ArrayList<>(); - for (Account account : accounts) { - if (account.hasErrorStatus()) { - accountsWproblems.add(account); - } - } - NotificationCompat.Builder mBuilder = new NotificationCompat.Builder( - context); - if (accountsWproblems.size() == 0) { - mNotificationManager.cancel(1111); - return; - } else if (accountsWproblems.size() == 1) { - mBuilder.setContentTitle(context - .getString(R.string.problem_connecting_to_account)); - mBuilder.setContentText(accountsWproblems.get(0).getJid().toBareJid().toString()); - } else { - mBuilder.setContentTitle(context - .getString(R.string.problem_connecting_to_accounts)); - mBuilder.setContentText(context.getString(R.string.touch_to_fix)); - } - mBuilder.setOngoing(true); - mBuilder.setLights(0xffffffff, 2000, 4000); - mBuilder.setSmallIcon(R.drawable.ic_notification); - TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); - stackBuilder.addParentStack(ConversationActivity.class); - - Intent manageAccountsIntent = new Intent(context, - ManageAccountActivity.class); - stackBuilder.addNextIntent(manageAccountsIntent); - - PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, - PendingIntent.FLAG_UPDATE_CURRENT); - - mBuilder.setContentIntent(resultPendingIntent); - Notification notification = mBuilder.build(); - mNotificationManager.notify(1111, notification); - } - private final static class EmoticonPattern { Pattern pattern; String replacement; |