Further lint cleanup

This commit is contained in:
l3d00m
2015-08-20 19:29:46 +02:00
parent 419ba50ab2
commit 8f881e23b2
15 changed files with 24 additions and 81 deletions
@@ -168,7 +168,6 @@ public class MmsConfig {
int type;
while ((type=parser.next()) != parser.START_TAG
&& type != parser.END_DOCUMENT) {
;
}
if (type != parser.START_TAG) {
@@ -186,7 +185,6 @@ public class MmsConfig {
int type;
while ((type=parser.next()) != parser.START_TAG
&& type != parser.END_DOCUMENT) {
;
}
}
@@ -154,7 +154,7 @@ public class MmsConfig {
}
public static boolean getMmsEnabled() {
return mMmsEnabled == 1 ? true : false;
return mMmsEnabled == 1;
}
public static int getMaxMessageSize() {
@@ -294,7 +294,6 @@ public class MmsConfig {
int type;
while ((type=parser.next()) != XmlPullParser.START_TAG
&& type != XmlPullParser.END_DOCUMENT) {
;
}
if (type != XmlPullParser.START_TAG) {
@@ -312,7 +311,6 @@ public class MmsConfig {
int type;
while ((type=parser.next()) != XmlPullParser.START_TAG
&& type != XmlPullParser.END_DOCUMENT) {
;
}
}
@@ -755,11 +755,8 @@ public class MessageUtils {
// "foo+caf_=6505551212=tmomail.net@gmail.com", which is the 'from' address from a forwarded email
// message from Gmail. We don't want to treat "foo+caf_=6505551212=tmomail.net@gmail.com" and
// "6505551212" to be the same.
if (number.indexOf('@') >= 0) {
return false;
}
return number.indexOf('@') < 0 && PhoneNumberUtils.compare(number, getLocalNumber());
return PhoneNumberUtils.compare(number, getLocalNumber());
}
public static void handleReadReport(final Context context,
@@ -919,7 +916,7 @@ public class MessageUtils {
public static void viewMmsMessageAttachment(final Activity activity, final Uri msgUri,
final SlideshowModel slideshow, final int requestCode, AsyncDialog asyncDialog) {
boolean isSimple = (slideshow == null) ? false : slideshow.isSimple();
boolean isSimple = (slideshow != null) && slideshow.isSimple();
if (isSimple) {
// In attachment-editor mode, we only ever have one slide.
MessageUtils.viewSimpleSlideshow(activity, slideshow);
@@ -43,7 +43,7 @@ public class RecipientIdCache {
this.id = id;
this.number = number;
}
};
}
static void init(Context context) {
sInstance = new RecipientIdCache(context);
@@ -1400,10 +1400,7 @@ public class ExifInterface {
public boolean isTagCountDefined(int tagId) {
int info = getTagInfo().get(tagId);
// No value in info can be zero, as all tags have a non-zero type
if (info == 0) {
return false;
}
return getComponentCountFromInfo(info) != ExifTag.SIZE_UNDEFINED;
return info != 0 && getComponentCountFromInfo(info) != ExifTag.SIZE_UNDEFINED;
}
/**
@@ -1550,10 +1547,7 @@ public class ExifInterface {
*/
public boolean setTagValue(int tagId, int ifdId, Object val) {
ExifTag t = getTag(tagId, ifdId);
if (t == null) {
return false;
}
return t.setValue(val);
return t != null && t.setValue(val);
}
/**
@@ -1829,10 +1823,7 @@ public class ExifInterface {
*/
public boolean setCompressedThumbnail(Bitmap thumb) {
ByteArrayOutputStream thumbnail = new ByteArrayOutputStream();
if (!thumb.compress(Bitmap.CompressFormat.JPEG, 90, thumbnail)) {
return false;
}
return setCompressedThumbnail(thumbnail.toByteArray());
return thumb.compress(Bitmap.CompressFormat.JPEG, 90, thumbnail) && setCompressedThumbnail(thumbnail.toByteArray());
}
/**
@@ -636,10 +636,7 @@ public class ExifParser {
private boolean checkAllowed(int ifd, int tagId) {
int info = mInterface.getTagInfo().get(tagId);
if (info == ExifInterface.DEFINITION_NULL) {
return false;
}
return ExifInterface.isIfdAllowed(info, ifd);
return info != ExifInterface.DEFINITION_NULL && ExifInterface.isIfdAllowed(info, ifd);
}
protected void readFullTagValue(ExifTag tag) throws IOException {
@@ -880,10 +880,7 @@ public class ExifTag {
}
private boolean checkBadComponentCount(int count) {
if (mHasDefinedDefaultComponentCount && (mComponentCountActual != count)) {
return true;
}
return false;
return mHasDefinedDefaultComponentCount && (mComponentCountActual != count);
}
private static String convertTypeToString(short type) {
@@ -974,20 +971,11 @@ public class ExifTag {
if (tag.mValue == null) {
return false;
} else if (mValue instanceof long[]) {
if (!(tag.mValue instanceof long[])) {
return false;
}
return Arrays.equals((long[]) mValue, (long[]) tag.mValue);
return tag.mValue instanceof long[] && Arrays.equals((long[]) mValue, (long[]) tag.mValue);
} else if (mValue instanceof Rational[]) {
if (!(tag.mValue instanceof Rational[])) {
return false;
}
return Arrays.equals((Rational[]) mValue, (Rational[]) tag.mValue);
return tag.mValue instanceof Rational[] && Arrays.equals((Rational[]) mValue, (Rational[]) tag.mValue);
} else if (mValue instanceof byte[]) {
if (!(tag.mValue instanceof byte[])) {
return false;
}
return Arrays.equals((byte[]) mValue, (byte[]) tag.mValue);
return tag.mValue instanceof byte[] && Arrays.equals((byte[]) mValue, (byte[]) tag.mValue);
} else {
return mValue.equals(tag.mValue);
}
@@ -401,9 +401,6 @@ public class Utils {
* @return true if app is default
*/
public static boolean isDefaultSmsApp(Context context) {
if (hasKitKat()) {
return context.getPackageName().equals(Telephony.Sms.getDefaultSmsPackage(context));
}
return true;
return !hasKitKat() || context.getPackageName().equals(Telephony.Sms.getDefaultSmsPackage(context));
}
}
@@ -26,7 +26,6 @@ public class ConversationListAdapter extends RecyclerCursorAdapter<ConversationL
implements LiveView {
private final Resources mRes;
private final SharedPreferences mPrefs;
private final Drawable mMuted;
@@ -35,7 +34,6 @@ public class ConversationListAdapter extends RecyclerCursorAdapter<ConversationL
public ConversationListAdapter(Context context) {
mContext = context;
mRes = MainActivity.getRes(mContext);
mPrefs = MainActivity.getPrefs(mContext);
mMuted = ContextCompat.getDrawable(context, R.drawable.ic_mute);
@@ -10,7 +10,6 @@ import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import com.moez.QKSMS.R;
import com.moez.QKSMS.interfaces.LiveView;
import com.moez.QKSMS.common.LiveViewManager;
import com.moez.QKSMS.ui.ThemeManager;