From 4be192645954821c55e9f9ffc0f8af3e8f112b02 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 20 Mar 2016 15:00:05 +0100 Subject: [PATCH] reformat code though Android Studio --- .../gadgetbridge/activities/AppManagerActivity.java | 2 +- .../activities/ExternalPebbleJSActivity.java | 1 + .../activities/charts/AbstractChartFragment.java | 1 - .../gadgetbridge/adapter/GBDeviceAdapter.java | 4 +--- .../adapter/ItemWithDetailsAdapter.java | 1 + .../database/schema/ActivityDBUpdate_7.java | 8 -------- .../gadgetbridge/devices/miband/MiBandFWHelper.java | 13 +++++++++---- .../devices/miband/MiBandSampleProvider.java | 10 +++++----- .../gadgetbridge/model/ItemWithDetails.java | 1 + .../service/DeviceCommunicationService.java | 1 - .../devices/miband/AbstractMi1FirmwareInfo.java | 12 +++--------- .../devices/miband/AbstractMiFirmwareInfo.java | 10 +++++++--- .../service/devices/miband/DeviceInfo.java | 2 +- .../service/devices/miband/Mi1SFirmwareInfo.java | 4 +++- .../service/devices/miband/Mi1SFirmwareInfoFW1.java | 13 +++++-------- .../service/devices/miband/Mi1SFirmwareInfoFW2.java | 9 +++------ .../service/devices/miband/MiBandSupport.java | 1 - .../devices/pebble/AppMessageHandlerPebStyle.java | 1 - .../pebble/AppMessageHandlerTimeStylePebble.java | 1 - .../gadgetbridge/util/PebbleUtils.java | 1 + .../service/AbstractServiceTestCase.java | 2 +- .../gadgetbridge/service/TestDeviceSupport.java | 2 +- .../service/devices/miband/FirmwareTest.java | 12 +++++++----- .../gadgetbridge/test/GBMockApplication.java | 1 + .../gadgetbridge/test/GBMockIntent.java | 2 +- 25 files changed, 53 insertions(+), 62 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java index d7297120..e2a1d56d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java @@ -80,7 +80,7 @@ public class AppManagerActivity extends Activity { List systemApps = new ArrayList<>(); systemApps.add(new GBDeviceApp(UUID.fromString("4dab81a6-d2fc-458a-992c-7a1f3b96a970"), "Sports (System)", "Pebble Inc.", "", GBDeviceApp.Type.APP_SYSTEM)); systemApps.add(new GBDeviceApp(UUID.fromString("cf1e816a-9db0-4511-bbb8-f60c48ca8fac"), "Golf (System)", "Pebble Inc.", "", GBDeviceApp.Type.APP_SYSTEM)); - if (mGBDevice != null && !"aplite".equals(PebbleUtils.getPlatformName(mGBDevice.getFirmwareVersion()))) { + if (mGBDevice != null && !"aplite".equals(PebbleUtils.getPlatformName(mGBDevice.getFirmwareVersion()))) { systemApps.add(new GBDeviceApp(PebbleProtocol.UUID_PEBBLE_HEALTH, "Health (System)", "Pebble Inc.", "", GBDeviceApp.Type.APP_SYSTEM)); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java index f6138fb6..caa6a290 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java @@ -100,6 +100,7 @@ public class ExternalPebbleJSActivity extends Activity { return super.onConsoleMessage(consoleMessage); } } + private class GBWebClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java index 61f6ad01..21f7774f 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java @@ -16,7 +16,6 @@ import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.data.BarData; import com.github.mikephil.charting.data.BarDataSet; import com.github.mikephil.charting.data.BarEntry; -import com.github.mikephil.charting.data.ChartData; import com.github.mikephil.charting.data.CombinedData; import com.github.mikephil.charting.data.Entry; import com.github.mikephil.charting.data.LineData; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java index b655a601..cd2decd6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java @@ -12,14 +12,12 @@ import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; -import java.text.Collator; import java.util.Collections; import java.util.List; import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.model.BatteryState; -import nodomain.freeyourgadget.gadgetbridge.model.GenericItem; import nodomain.freeyourgadget.gadgetbridge.model.ItemWithDetails; /** @@ -126,7 +124,7 @@ public class GBDeviceAdapter extends ArrayAdapter { return view; } - public void justifyListViewHeightBasedOnChildren (ListView listView) { + public void justifyListViewHeightBasedOnChildren(ListView listView) { ArrayAdapter adapter = (ArrayAdapter) listView.getAdapter(); if (adapter == null) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/ItemWithDetailsAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/ItemWithDetailsAdapter.java index fed094ac..92448d9c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/ItemWithDetailsAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/ItemWithDetailsAdapter.java @@ -30,6 +30,7 @@ public class ItemWithDetailsAdapter extends ArrayAdapter { public void setHorizontalAlignment(boolean horizontalAlignment) { this.horizontalAlignment = horizontalAlignment; } + @Override public View getView(int position, View view, ViewGroup parent) { ItemWithDetails item = getItem(position); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/schema/ActivityDBUpdate_7.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/schema/ActivityDBUpdate_7.java index 84638f3c..c7077451 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/schema/ActivityDBUpdate_7.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/schema/ActivityDBUpdate_7.java @@ -1,13 +1,5 @@ package nodomain.freeyourgadget.gadgetbridge.database.schema; -import android.database.sqlite.SQLiteDatabase; - -import nodomain.freeyourgadget.gadgetbridge.database.DBHelper; -import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript; - -import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_CUSTOM_SHORT; -import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.TABLE_GBACTIVITYSAMPLES; - /** * Bugfix for users who installed 0.8.1 cleanly, i.e. without any previous * database. Perform Update script 6 again. diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandFWHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandFWHelper.java index e490e855..3c4ba09b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandFWHelper.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandFWHelper.java @@ -26,8 +26,12 @@ public class MiBandFWHelper { private final Uri uri; private final ContentResolver cr; - private final @NonNull AbstractMiFirmwareInfo firmwareInfo; - private final @NonNull byte[] fw; + private final + @NonNull + AbstractMiFirmwareInfo firmwareInfo; + private final + @NonNull + byte[] fw; /** * Provides a different notification API which is also used on Mi1A devices. @@ -125,12 +129,13 @@ public class MiBandFWHelper { } /** - * * @param wholeFirmwareBytes * @return * @throws IllegalArgumentException when the data is not recognized as firmware data */ - public static @NonNull AbstractMiFirmwareInfo determineFirmwareInfoFor(byte[] wholeFirmwareBytes) { + public static + @NonNull + AbstractMiFirmwareInfo determineFirmwareInfoFor(byte[] wholeFirmwareBytes) { return AbstractMiFirmwareInfo.determineFirmwareInfoFor(wholeFirmwareBytes); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java index b9b622d3..b87406e1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java @@ -5,11 +5,11 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind; public class MiBandSampleProvider implements SampleProvider { public static final int TYPE_DEEP_SLEEP = 5; - public static final int TYPE_LIGHT_SLEEP = 4; - public static final int TYPE_ACTIVITY = -1; - public static final int TYPE_UNKNOWN = -1; - public static final int TYPE_NONWEAR = 3; - public static final int TYPE_CHARGING = 6; + public static final int TYPE_LIGHT_SLEEP = 4; + public static final int TYPE_ACTIVITY = -1; + public static final int TYPE_UNKNOWN = -1; + public static final int TYPE_NONWEAR = 3; + public static final int TYPE_CHARGING = 6; // public static final byte TYPE_NREM = 5; // DEEP SLEEP // public static final byte TYPE_ONBED = 7; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ItemWithDetails.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ItemWithDetails.java index 0c5dc497..078ced99 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ItemWithDetails.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ItemWithDetails.java @@ -11,6 +11,7 @@ public interface ItemWithDetails extends Parcelable, Comparable /** * Equality is based on #getName() only. + * * @param other */ boolean equals(Object other); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java index 0d495422..ad49e23d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java @@ -3,7 +3,6 @@ package nodomain.freeyourgadget.gadgetbridge.service; import android.app.NotificationManager; import android.app.Service; import android.content.BroadcastReceiver; -import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMi1FirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMi1FirmwareInfo.java index 67247583..cf626593 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMi1FirmwareInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMi1FirmwareInfo.java @@ -5,9 +5,6 @@ import android.support.annotation.NonNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst; -import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; - /** * Some helper methods for Mi1 and Mi1A firmware. */ @@ -21,18 +18,15 @@ public abstract class AbstractMi1FirmwareInfo extends AbstractMiFirmwareInfo { } @Override - public int getFirmwareOffset() - { + public int getFirmwareOffset() { return 0; } - public int getFirmwareLength() - { + public int getFirmwareLength() { return wholeFirmwareBytes.length; } - public int getFirmwareVersion() - { + public int getFirmwareVersion() { return (wholeFirmwareBytes[getOffsetFirmwareVersionMajor()] << 24) | (wholeFirmwareBytes[getOffsetFirmwareVersionMinor()] << 16) | (wholeFirmwareBytes[getOffsetFirmwareVersionRevision()] << 8) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java index 4f988517..e303e45f 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java @@ -8,12 +8,13 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; public abstract class AbstractMiFirmwareInfo { /** - * * @param wholeFirmwareBytes * @return * @throws IllegalArgumentException when the data is not recognized as firmware data */ - public static @NonNull AbstractMiFirmwareInfo determineFirmwareInfoFor(byte[] wholeFirmwareBytes) { + public static + @NonNull + AbstractMiFirmwareInfo determineFirmwareInfoFor(byte[] wholeFirmwareBytes) { AbstractMiFirmwareInfo[] candidates = getFirmwareInfoCandidatesFor(wholeFirmwareBytes); if (candidates.length == 0) { throw new IllegalArgumentException("Unsupported data (maybe not even a firmware?)."); @@ -59,7 +60,9 @@ public abstract class AbstractMiFirmwareInfo { public abstract boolean isGenerallyCompatibleWith(GBDevice device); - public @NonNull byte[] getFirmwareBytes() { + public + @NonNull + byte[] getFirmwareBytes() { return Arrays.copyOfRange(wholeFirmwareBytes, getFirmwareOffset(), getFirmwareLength()); } @@ -85,6 +88,7 @@ public abstract class AbstractMiFirmwareInfo { } throw new UnsupportedOperationException(getClass().getName() + " must override getFirst() and getSecond()"); } + public AbstractMiFirmwareInfo getSecond() { if (isSingleMiBandFirmware()) { throw new UnsupportedOperationException(getClass().getName() + " only supports on firmware"); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/DeviceInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/DeviceInfo.java index 2379fe8e..ddad3f24 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/DeviceInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/DeviceInfo.java @@ -87,7 +87,7 @@ public class DeviceInfo extends AbstractInfo { ", hwVersion=" + hwVersion + ", feature=" + feature + ", appearance=" + appearance + - ", fw2Version (hr)=" + fw2Version+ + ", fw2Version (hr)=" + fw2Version + '}'; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfo.java index 32193d33..c9301b90 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfo.java @@ -31,7 +31,9 @@ public class Mi1SFirmwareInfo extends AbstractMi1SFirmwareInfo { return fw2Info; } - public static @Nullable Mi1SFirmwareInfo getInstance(byte[] wholeFirmwareBytes) { + public static + @Nullable + Mi1SFirmwareInfo getInstance(byte[] wholeFirmwareBytes) { Mi1SFirmwareInfo info = new Mi1SFirmwareInfo(wholeFirmwareBytes); if (info.isGenerallySupportedFirmware()) { return info; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW1.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW1.java index 3270f0d8..b8ea7aab 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW1.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW1.java @@ -15,8 +15,7 @@ public class Mi1SFirmwareInfoFW1 extends AbstractMi1SFirmwareInfo { } @Override - public int getFirmwareOffset() - { + public int getFirmwareOffset() { return (wholeFirmwareBytes[12] & 255) << 24 | (wholeFirmwareBytes[13] & 255) << 16 | (wholeFirmwareBytes[14] & 255) << 8 @@ -24,8 +23,7 @@ public class Mi1SFirmwareInfoFW1 extends AbstractMi1SFirmwareInfo { } @Override - public int getFirmwareLength() - { + public int getFirmwareLength() { return (wholeFirmwareBytes[16] & 255) << 24 | (wholeFirmwareBytes[17] & 255) << 16 | (wholeFirmwareBytes[18] & 255) << 8 @@ -33,15 +31,14 @@ public class Mi1SFirmwareInfoFW1 extends AbstractMi1SFirmwareInfo { } @Override - public int getFirmwareVersion() - { + public int getFirmwareVersion() { return (wholeFirmwareBytes[8] & 255) << 24 | (wholeFirmwareBytes[9] & 255) << 16 | (wholeFirmwareBytes[10] & 255) << 8 | wholeFirmwareBytes[11] & 255; } - @Override + @Override protected boolean isGenerallySupportedFirmware() { try { int majorVersion = getFirmwareVersionMajor(); @@ -49,5 +46,5 @@ public class Mi1SFirmwareInfoFW1 extends AbstractMi1SFirmwareInfo { } catch (IllegalArgumentException e) { return false; } - } + } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW2.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW2.java index 86d4d61e..9cd013f7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW2.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/Mi1SFirmwareInfoFW2.java @@ -13,8 +13,7 @@ public class Mi1SFirmwareInfoFW2 extends AbstractMi1SFirmwareInfo { } @Override - public int getFirmwareOffset() - { + public int getFirmwareOffset() { return (wholeFirmwareBytes[26] & 255) << 24 | (wholeFirmwareBytes[27] & 255) << 16 | (wholeFirmwareBytes[28] & 255) << 8 @@ -22,8 +21,7 @@ public class Mi1SFirmwareInfoFW2 extends AbstractMi1SFirmwareInfo { } @Override - public int getFirmwareLength() - { + public int getFirmwareLength() { return (wholeFirmwareBytes[30] & 255) << 24 | (wholeFirmwareBytes[31] & 255) << 16 | (wholeFirmwareBytes[32] & 255) << 8 @@ -41,8 +39,7 @@ public class Mi1SFirmwareInfoFW2 extends AbstractMi1SFirmwareInfo { } @Override - public int getFirmwareVersion() - { + public int getFirmwareVersion() { return (wholeFirmwareBytes[22] & 255) << 24 | (wholeFirmwareBytes[23] & 255) << 16 | (wholeFirmwareBytes[24] & 255) << 8 diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java index be8b6182..8dab5a4c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java @@ -30,7 +30,6 @@ import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandDateConverter; import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandFWHelper; import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandService; import nodomain.freeyourgadget.gadgetbridge.devices.miband.VibrationProfile; -import nodomain.freeyourgadget.gadgetbridge.impl.GBAlarm; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.State; import nodomain.freeyourgadget.gadgetbridge.model.Alarm; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerPebStyle.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerPebStyle.java index 8b90c5a6..781e56c1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerPebStyle.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerPebStyle.java @@ -10,7 +10,6 @@ import java.util.ArrayList; import java.util.UUID; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent; -import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes; import nodomain.freeyourgadget.gadgetbridge.devices.pebble.PebbleColor; public class AppMessageHandlerPebStyle extends AppMessageHandler { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerTimeStylePebble.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerTimeStylePebble.java index fb1583f7..2ab8ae2d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerTimeStylePebble.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerTimeStylePebble.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import java.util.UUID; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent; -import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes; public class AppMessageHandlerTimeStylePebble extends AppMessageHandler { public static final int KEY_SETTING_SIDEBAR_LEFT = 9; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java index 0e13e925..11ec9678 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java @@ -12,6 +12,7 @@ public class PebbleUtils { } return platformName; } + public static String getModel(String hwRev) { //TODO: get real data? String model; diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractServiceTestCase.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractServiceTestCase.java index c7ba649f..fe9e03e3 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractServiceTestCase.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractServiceTestCase.java @@ -28,7 +28,7 @@ public abstract class AbstractServiceTestCase { private NotificationManager mNotificationManager; private MockHelper mMockHelper; - protected AbstractServiceTestCase(Class serviceClass) { + protected AbstractServiceTestCase(Class serviceClass) { mServiceClass = serviceClass; Assert.assertNotNull(serviceClass); } diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/TestDeviceSupport.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/TestDeviceSupport.java index 8722f00d..29043020 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/TestDeviceSupport.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/TestDeviceSupport.java @@ -47,7 +47,7 @@ public class TestDeviceSupport extends AbstractDeviceSupport { @Override public void onNotification(NotificationSpec notificationSpec) { - + } @Override diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/FirmwareTest.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/FirmwareTest.java index 732464f6..8ceee215 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/FirmwareTest.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/FirmwareTest.java @@ -25,7 +25,7 @@ public class FirmwareTest { private static final int DOUBLE = 2; @Test - public void testFirmwareMi1() throws Exception{ + public void testFirmwareMi1() throws Exception { byte[] wholeFw = getFirmwareMi(); Assert.assertNotNull(wholeFw); @@ -38,7 +38,7 @@ public class FirmwareTest { } @Test - public void testFirmwareMi1A() throws Exception{ + public void testFirmwareMi1A() throws Exception { byte[] wholeFw = getFirmwareMi1A(); Assert.assertNotNull(wholeFw); @@ -51,7 +51,7 @@ public class FirmwareTest { } @Test - public void testFirmwareMi1S() throws Exception{ + public void testFirmwareMi1S() throws Exception { byte[] wholeFw = getFirmwareMi1S(); Assert.assertNotNull(wholeFw); @@ -84,7 +84,8 @@ public class FirmwareTest { try { info.getFirmwareVersion(); Assert.fail("should not get fw version from AbstractMi1SFirmwareInfo"); - } catch (UnsupportedOperationException expected) {} + } catch (UnsupportedOperationException expected) { + } Assert.assertNotEquals(info.getFirst().getFirmwareOffset(), info.getSecond().getFirmwareOffset()); Assert.assertFalse(Arrays.equals(info.getFirst().getFirmwareBytes(), info.getSecond().getFirmwareBytes())); @@ -99,7 +100,8 @@ public class FirmwareTest { try { info.getSecond(); Assert.fail("should throw UnsuportedOperationException"); - } catch (UnsupportedOperationException expected) {} + } catch (UnsupportedOperationException expected) { + } int calculatedLength = info.getFirmwareLength(); Assert.assertTrue("Unexpected firmware length: " + wholeFw.length, calculatedLength <= wholeFw.length); break; diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockApplication.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockApplication.java index b9f16b12..805716fa 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockApplication.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockApplication.java @@ -19,6 +19,7 @@ public class GBMockApplication extends MockApplication { public Context getApplicationContext() { return this; } + @Override public PackageManager getPackageManager() { return mPackageManager; diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockIntent.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockIntent.java index 667e4497..080361e3 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockIntent.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/GBMockIntent.java @@ -12,7 +12,7 @@ import java.util.Map; public class GBMockIntent extends Intent { private String mAction; - private final Map extras = new HashMap<>(); + private final Map extras = new HashMap<>(); @NonNull @Override