Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedol committed Jun 8, 2015
2 parents 9a6a6cd + ee86cff commit 3e35d25
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
3 changes: 2 additions & 1 deletion changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"date": "9th June, 2015",
"features": [],
"bugs": [
"Upgrade otto to v1.3.7 to fix synthetic bridge methods created by JDK 8"
"Upgrade otto to v1.3.7 to fix synthetic bridge methods created by JDK 8",
"Fix issue when messages received from server is empty."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion smssync/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ android {
}

defaultConfig {
versionCode 34
versionCode 35
versionName "2.8.2"
minSdkVersion 8
targetSdkVersion 22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public void smsServerResponse(SmssyncResponse response) {
}

if (response != null && response.getPayload() != null
&& response.getPayload().getMessages().size() > 0) {
&& (!Util.isEmpty(response.getPayload().getMessages()))) {
for (Message msg : response.getPayload().getMessages()) {
sendTaskSms(msg);
}
Expand Down
31 changes: 18 additions & 13 deletions smssync/src/main/java/org/addhen/smssync/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@

package org.addhen.smssync.util;

import org.addhen.smssync.App;
import org.addhen.smssync.BuildConfig;
import org.addhen.smssync.R;
import org.addhen.smssync.activities.MainActivity;
import org.addhen.smssync.prefs.Prefs;
import org.addhen.smssync.receivers.ConnectivityChangedReceiver;
import org.addhen.smssync.state.LogEvent;
import org.json.JSONException;
import org.json.JSONObject;

import android.annotation.TargetApi;
import android.app.NotificationManager;
import android.app.PendingIntent;
Expand All @@ -39,16 +49,6 @@
import android.util.Log;
import android.widget.Toast;

import org.addhen.smssync.App;
import org.addhen.smssync.BuildConfig;
import org.addhen.smssync.R;
import org.addhen.smssync.activities.MainActivity;
import org.addhen.smssync.prefs.Prefs;
import org.addhen.smssync.receivers.ConnectivityChangedReceiver;
import org.addhen.smssync.state.LogEvent;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
Expand All @@ -57,6 +57,7 @@
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -171,7 +172,7 @@ public static String limitString(String value, int length) {
* @return String
*/
public static String formatDate(String dateFormat, String date,
String toFormat) {
String toFormat) {

String formatted = "";

Expand Down Expand Up @@ -280,7 +281,7 @@ public static void showNotification(Context context) {
* @param notificationTitle notification title
*/
public static void showFailNotification(Context context, String message,
String notificationTitle) {
String notificationTitle) {

Intent baseIntent = new Intent(context, MainActivity.class);
baseIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Expand All @@ -304,7 +305,7 @@ public static void showFailNotification(Context context, String message,
* @param ongoing True if you don't want the user to clear the notification
*/
public static void buildNotification(Context context, int drawable,
String message, String title, PendingIntent intent, boolean ongoing) {
String message, String title, PendingIntent intent, boolean ongoing) {

NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Expand Down Expand Up @@ -628,4 +629,8 @@ public void log(String format, Object... args) {
public void log(String message, Exception ex) {
Logger.log(getClass().getName(), message, ex);
}

public static boolean isEmpty(Collection<?> collection) {
return collection == null || collection.isEmpty();
}
}
3 changes: 2 additions & 1 deletion smssync/src/main/play/en-US/whatsnew
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Upgrade otto to v1.3.7 to fix synthetic bridge methods created by JDK 8.
- Upgrade otto to v1.3.7 to fix synthetic bridge methods created by JDK 8.
- Fix issue when messages received from server is empty.

0 comments on commit 3e35d25

Please sign in to comment.