Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/org/adblockplus/android/Utils.java

Issue 5327480814567424: Issue 1108 - Support notifications (Closed)
Patch Set: Only one Notification displayed now Created Feb. 18, 2015, 3:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 builder.setContentText(context.getString(R.string.msg_update_available)); 84 builder.setContentText(context.getString(R.string.msg_update_available));
85 } 85 }
86 else 86 else
87 { 87 {
88 builder.setContentText(context.getString(R.string.msg_update_missing)); 88 builder.setContentText(context.getString(R.string.msg_update_missing));
89 } 89 }
90 90
91 final Notification notification = builder.getNotification(); 91 final Notification notification = builder.getNotification();
92 final NotificationManager notificationManager = 92 final NotificationManager notificationManager =
93 (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERV ICE); 93 (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERV ICE);
94 final int updateNotificationId = R.string.app_name + 1; 94 notificationManager.notify(AdblockPlus.UPDATE_NOTIFICATION_ID, notification) ;
95 notificationManager.notify(updateNotificationId, notification);
96 } 95 }
97 96
98 protected static void updateSubscriptionStatus(final Context context, final Su bscription sub) 97 protected static void updateSubscriptionStatus(final Context context, final Su bscription sub)
99 { 98 {
100 final JsValue jsDownloadStatus = sub.getProperty("downloadStatus"); 99 final JsValue jsDownloadStatus = sub.getProperty("downloadStatus");
101 final String downloadStatus = jsDownloadStatus.isNull() ? "" : jsDownloadSta tus.toString(); 100 final String downloadStatus = jsDownloadStatus.isNull() ? "" : jsDownloadSta tus.toString();
102 final long lastDownload = sub.getProperty("lastDownload").asLong(); 101 final long lastDownload = sub.getProperty("lastDownload").asLong();
103 102
104 String status = "synchronize_never"; 103 String status = "synchronize_never";
105 long time = 0; 104 long time = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 buf.close(); 143 buf.close();
145 } 144 }
146 145
147 } 146 }
148 catch (final Exception e) 147 catch (final Exception e)
149 { 148 {
150 // Ignored for now 149 // Ignored for now
151 } 150 }
152 } 151 }
153 } 152 }
OLDNEW
« no previous file with comments | « src/org/adblockplus/android/ProxyService.java ('k') | src/org/adblockplus/android/updater/UpdaterService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld