Commit 86b87261 authored by Tiago Cunha's avatar Tiago Cunha

Quality tools fixes

parent ec6255f5
...@@ -40,6 +40,8 @@ public class PushNotificationHandler implements PushConstants { ...@@ -40,6 +40,8 @@ public class PushNotificationHandler implements PushConstants {
private static SparseArrayCompat<ArrayList<String>> messageMap = new SparseArrayCompat<>(); private static SparseArrayCompat<ArrayList<String>> messageMap = new SparseArrayCompat<>();
private Random random = new Random();
public void setNotification(int notId, String message) { public void setNotification(int notId, String message) {
ArrayList<String> messageList = messageMap.get(notId); ArrayList<String> messageList = messageMap.get(notId);
if (messageList == null) { if (messageList == null) {
...@@ -108,7 +110,7 @@ public class PushNotificationHandler implements PushConstants { ...@@ -108,7 +110,7 @@ public class PushNotificationHandler implements PushConstants {
notificationIntent.putExtra(ROOM_ID, roomId); notificationIntent.putExtra(ROOM_ID, roomId);
notificationIntent.putExtra(NOT_ID, notId); notificationIntent.putExtra(NOT_ID, notId);
int requestCode = new Random().nextInt(); int requestCode = random.nextInt();
PendingIntent contentIntent = PendingIntent PendingIntent contentIntent = PendingIntent
.getActivity(context, requestCode, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); .getActivity(context, requestCode, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
......
...@@ -137,11 +137,11 @@ public class GCMIntentService extends GcmListenerService implements PushConstant ...@@ -137,11 +137,11 @@ public class GCMIntentService extends GcmListenerService implements PushConstant
*/ */
private Bundle normalizeExtras(Context context, Bundle extras) { private Bundle normalizeExtras(Context context, Bundle extras) {
Log.d(LOG_TAG, "normalize extras"); Log.d(LOG_TAG, "normalize extras");
Iterator<String> it = extras.keySet().iterator(); Iterator<String> keyIterator = extras.keySet().iterator();
Bundle newExtras = new Bundle(); Bundle newExtras = new Bundle();
while (it.hasNext()) { while (keyIterator.hasNext()) {
String key = it.next(); String key = keyIterator.next();
Log.d(LOG_TAG, "key = " + key); Log.d(LOG_TAG, "key = " + key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment