1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 03:16:51 +01:00

Avoid unnecessary boxing

This commit is contained in:
cpfeiffer 2018-08-17 00:25:48 +02:00
parent c6bfd296a6
commit 98cd54657a
3 changed files with 5 additions and 5 deletions

View File

@ -76,11 +76,11 @@ public class MusicPlaybackReceiver extends BroadcastReceiver {
stateSpec.state = (byte) (((Boolean) incoming) ? MusicStateSpec.STATE_PLAYING : MusicStateSpec.STATE_PAUSED);
stateSpec.playRate = (byte) (((Boolean) incoming) ? 100 : 0);
} else if (incoming instanceof String && "duration".equals(key)) {
musicSpec.duration = Integer.valueOf((String) incoming) / 1000;
musicSpec.duration = Integer.parseInt((String) incoming) / 1000;
} else if (incoming instanceof String && "trackno".equals(key)) {
musicSpec.trackNr = Integer.valueOf((String) incoming);
musicSpec.trackNr = Integer.parseInt((String) incoming);
} else if (incoming instanceof String && "totaltrack".equals(key)) {
musicSpec.trackCount = Integer.valueOf((String) incoming);
musicSpec.trackCount = Integer.parseInt((String) incoming);
} else if (incoming instanceof Integer && "pos".equals(key)) {
stateSpec.position = (Integer) incoming;
} else if (incoming instanceof Integer && "repeat".equals(key)) {

View File

@ -121,7 +121,7 @@ public class OmniJawsObserver extends ContentObserver {
weatherSpec.windSpeed = toKmh(c.getFloat(11));
weatherSpec.windDirection = c.getInt(12);
weatherSpec.timestamp = (int) (Long.valueOf(c.getString(9)) / 1000);
weatherSpec.timestamp = (int) (Long.parseLong(c.getString(9)) / 1000);
} else if (i == 1) {
weatherSpec.todayMinTemp = toKelvin(c.getFloat(5));
weatherSpec.todayMaxTemp = toKelvin(c.getFloat(6));

View File

@ -181,7 +181,7 @@ public class AndroidUtils {
return id.replaceFirst("raw:", "");
}
uri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
Uri.parse("content://downloads/public_downloads"), Long.parseLong(id));
}
} else if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
final String docId = DocumentsContract.getDocumentId(uri);