mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 08:05:55 +01:00
Avoid boxing
This commit is contained in:
parent
ce2f984e9f
commit
f142003f09
@ -88,7 +88,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
|
||||
protected void refreshList() {
|
||||
appList.clear();
|
||||
ArrayList uuids = AppManagerActivity.getUuidsFromFile(getSortFilename());
|
||||
ArrayList<UUID> uuids = AppManagerActivity.getUuidsFromFile(getSortFilename());
|
||||
List<GBDeviceApp> systemApps = getSystemAppsInCategory();
|
||||
boolean needsRewrite = false;
|
||||
for (GBDeviceApp systemApp : systemApps) {
|
||||
@ -106,11 +106,11 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
private void refreshListFromPebble(Intent intent) {
|
||||
appList.clear();
|
||||
int appCount = intent.getIntExtra("app_count", 0);
|
||||
for (Integer i = 0; i < appCount; i++) {
|
||||
String appName = intent.getStringExtra("app_name" + i.toString());
|
||||
String appCreator = intent.getStringExtra("app_creator" + i.toString());
|
||||
UUID uuid = UUID.fromString(intent.getStringExtra("app_uuid" + i.toString()));
|
||||
GBDeviceApp.Type appType = GBDeviceApp.Type.values()[intent.getIntExtra("app_type" + i.toString(), 0)];
|
||||
for (int i = 0; i < appCount; i++) {
|
||||
String appName = intent.getStringExtra("app_name" + i);
|
||||
String appCreator = intent.getStringExtra("app_creator" + i);
|
||||
UUID uuid = UUID.fromString(intent.getStringExtra("app_uuid" + i));
|
||||
GBDeviceApp.Type appType = GBDeviceApp.Type.values()[intent.getIntExtra("app_type" + i, 0)];
|
||||
|
||||
GBDeviceApp app = new GBDeviceApp(uuid, appName, appCreator, "", appType);
|
||||
app.setOnDevice(true);
|
||||
|
@ -255,7 +255,7 @@ public class HPlusCoordinator extends AbstractDeviceCoordinator {
|
||||
}
|
||||
|
||||
public static byte getAllDayHR(String address) {
|
||||
Boolean value = (prefs.getBoolean(HPlusConstants.PREF_HPLUS_ALLDAYHR, true));
|
||||
boolean value = (prefs.getBoolean(HPlusConstants.PREF_HPLUS_ALLDAYHR, true));
|
||||
|
||||
if(value){
|
||||
return HPlusConstants.ARG_HEARTRATE_ALLDAY_ON;
|
||||
|
@ -71,9 +71,9 @@ public class CalendarEvents {
|
||||
private boolean fetchSystemEvents(Context mContext) {
|
||||
|
||||
Calendar cal = GregorianCalendar.getInstance();
|
||||
Long dtStart = cal.getTimeInMillis();
|
||||
long dtStart = cal.getTimeInMillis();
|
||||
cal.add(Calendar.DATE, lookahead_days);
|
||||
Long dtEnd = cal.getTimeInMillis();
|
||||
long dtEnd = cal.getTimeInMillis();
|
||||
|
||||
Uri.Builder eventsUriBuilder = Instances.CONTENT_URI.buildUpon();
|
||||
ContentUris.appendId(eventsUriBuilder, dtStart);
|
||||
|
@ -241,11 +241,11 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
|
||||
Intent appInfoIntent = new Intent(AbstractAppManagerFragment.ACTION_REFRESH_APPLIST);
|
||||
int appCount = appInfoEvent.apps.length;
|
||||
appInfoIntent.putExtra("app_count", appCount);
|
||||
for (Integer i = 0; i < appCount; i++) {
|
||||
appInfoIntent.putExtra("app_name" + i.toString(), appInfoEvent.apps[i].getName());
|
||||
appInfoIntent.putExtra("app_creator" + i.toString(), appInfoEvent.apps[i].getCreator());
|
||||
appInfoIntent.putExtra("app_uuid" + i.toString(), appInfoEvent.apps[i].getUUID().toString());
|
||||
appInfoIntent.putExtra("app_type" + i.toString(), appInfoEvent.apps[i].getType().ordinal());
|
||||
for (int i = 0; i < appCount; i++) {
|
||||
appInfoIntent.putExtra("app_name" + i, appInfoEvent.apps[i].getName());
|
||||
appInfoIntent.putExtra("app_creator" + i, appInfoEvent.apps[i].getCreator());
|
||||
appInfoIntent.putExtra("app_uuid" + i, appInfoEvent.apps[i].getUUID().toString());
|
||||
appInfoIntent.putExtra("app_type" + i, appInfoEvent.apps[i].getType().ordinal());
|
||||
}
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(appInfoIntent);
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
break;
|
||||
}
|
||||
case ACTION_SET_HEARTRATE_MEASUREMENT_INTERVAL: {
|
||||
Integer seconds = intent.getIntExtra(EXTRA_INTERVAL_SECONDS, 0);
|
||||
int seconds = intent.getIntExtra(EXTRA_INTERVAL_SECONDS, 0);
|
||||
mDeviceSupport.onSetHeartRateMeasurementInterval(seconds);
|
||||
break;
|
||||
}
|
||||
|
@ -497,7 +497,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
title = notificationSpec.title;
|
||||
}
|
||||
|
||||
Long ts = System.currentTimeMillis();
|
||||
long ts = System.currentTimeMillis();
|
||||
if (mFwMajor < 3) {
|
||||
ts += (SimpleTimeZone.getDefault().getOffset(ts));
|
||||
}
|
||||
@ -514,7 +514,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
notificationSpec.sourceName, hasHandle, notificationSpec.cannedReplies);
|
||||
} else {
|
||||
// 1.x notification on FW 2.X
|
||||
String[] parts = {title, notificationSpec.body, ts.toString(), subtitle};
|
||||
String[] parts = {title, notificationSpec.body, String.valueOf(ts), subtitle};
|
||||
// be aware that type is at this point always NOTIFICATION_EMAIL
|
||||
return encodeMessage(ENDPOINT_NOTIFICATION, NOTIFICATION_EMAIL, 0, parts);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class GB {
|
||||
text += ": " + context.getString(R.string.battery) + " " + device.getBatteryLevel() + "%";
|
||||
}
|
||||
|
||||
Boolean connected = device.isInitialized();
|
||||
boolean connected = device.isInitialized();
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID);
|
||||
builder.setContentTitle(deviceName)
|
||||
.setTicker(deviceName + " - " + text)
|
||||
|
Loading…
Reference in New Issue
Block a user