mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Fossil/Skagen Hybrids: Remove activity fetching toasts and add finished signal
This commit is contained in:
parent
ab41adbc7f
commit
08a8b6a8fd
@ -555,10 +555,11 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
|
|
||||||
queueWrite(new FileDeleteRequest(getHandle()));
|
queueWrite(new FileDeleteRequest(getHandle()));
|
||||||
GB.updateTransferNotification(null, "", false, 100, getContext());
|
GB.updateTransferNotification(null, "", false, 100, getContext());
|
||||||
if (BuildConfig.DEBUG)
|
GB.signalActivityDataFinish();
|
||||||
GB.toast(getContext().getString(R.string.fossil_hr_synced_activity_data), Toast.LENGTH_SHORT, GB.INFO);
|
LOG.debug("Synchronized activity data");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
|
LOG.error("Error saving steps data: ", ex);
|
||||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||||
}
|
}
|
||||||
getDeviceSupport().getDevice().unsetBusyTask();
|
getDeviceSupport().getDevice().unsetBusyTask();
|
||||||
@ -567,8 +568,8 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
||||||
if(error == FILE_LOOKUP_ERROR.FILE_EMPTY && BuildConfig.DEBUG){
|
if(error == FILE_LOOKUP_ERROR.FILE_EMPTY){
|
||||||
GB.toast("No activity data to sync", Toast.LENGTH_SHORT, GB.INFO);
|
LOG.debug("No activity data to sync");
|
||||||
}
|
}
|
||||||
getDeviceSupport().getDevice().unsetBusyTask();
|
getDeviceSupport().getDevice().unsetBusyTask();
|
||||||
GB.updateTransferNotification(null, "", false, 100, getContext());
|
GB.updateTransferNotification(null, "", false, 100, getContext());
|
||||||
|
@ -86,7 +86,6 @@ import java.util.Timer;
|
|||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
|
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
|
||||||
@ -1251,10 +1250,11 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
|||||||
}
|
}
|
||||||
queueWrite(new FileDeleteRequest(fileHandle));
|
queueWrite(new FileDeleteRequest(fileHandle));
|
||||||
GB.updateTransferNotification(null, "", false, 100, getContext());
|
GB.updateTransferNotification(null, "", false, 100, getContext());
|
||||||
if (BuildConfig.DEBUG)
|
GB.signalActivityDataFinish();
|
||||||
GB.toast(getContext().getString(R.string.fossil_hr_synced_activity_data), Toast.LENGTH_SHORT, GB.INFO);
|
LOG.debug("Synchronized activity data");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
|
LOG.error("Error saving steps data: ", ex);
|
||||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||||
}
|
}
|
||||||
getDeviceSupport().getDevice().unsetBusyTask();
|
getDeviceSupport().getDevice().unsetBusyTask();
|
||||||
@ -1266,8 +1266,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
|||||||
@Override
|
@Override
|
||||||
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
||||||
if (error == FILE_LOOKUP_ERROR.FILE_EMPTY) {
|
if (error == FILE_LOOKUP_ERROR.FILE_EMPTY) {
|
||||||
if (BuildConfig.DEBUG)
|
LOG.debug("No activity data to sync");
|
||||||
GB.toast("No activity data to sync", Toast.LENGTH_SHORT, GB.INFO);
|
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("strange lookup stuff");
|
throw new RuntimeException("strange lookup stuff");
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,13 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.adapter.misfit;
|
package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.adapter.misfit;
|
||||||
|
|
||||||
|
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_ACTIVITY_POINT;
|
||||||
|
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_STEP_COUNT;
|
||||||
|
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_STEP_GOAL;
|
||||||
|
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_VIBRATION_STRENGTH;
|
||||||
|
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.QHYBRID_EVENT_BUTTON_PRESS;
|
||||||
|
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.QHYBRID_EVENT_FILE_UPLOADED;
|
||||||
|
|
||||||
import android.bluetooth.BluetoothGatt;
|
import android.bluetooth.BluetoothGatt;
|
||||||
import android.bluetooth.BluetoothGattCharacteristic;
|
import android.bluetooth.BluetoothGattCharacteristic;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -78,13 +85,6 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.mis
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
|
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||||
|
|
||||||
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_ACTIVITY_POINT;
|
|
||||||
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_STEP_COUNT;
|
|
||||||
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_STEP_GOAL;
|
|
||||||
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.ITEM_VIBRATION_STRENGTH;
|
|
||||||
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.QHYBRID_EVENT_BUTTON_PRESS;
|
|
||||||
import static nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport.QHYBRID_EVENT_FILE_UPLOADED;
|
|
||||||
|
|
||||||
public class MisfitWatchAdapter extends WatchAdapter {
|
public class MisfitWatchAdapter extends WatchAdapter {
|
||||||
private int lastButtonIndex = -1;
|
private int lastButtonIndex = -1;
|
||||||
private final SparseArray<Request> responseFilters = new SparseArray<>();
|
private final SparseArray<Request> responseFilters = new SparseArray<>();
|
||||||
@ -470,6 +470,7 @@ public class MisfitWatchAdapter extends WatchAdapter {
|
|||||||
getDeviceSupport().getDevice().unsetBusyTask();
|
getDeviceSupport().getDevice().unsetBusyTask();
|
||||||
GB.updateTransferNotification(null, "", false, 100, getContext());
|
GB.updateTransferNotification(null, "", false, 100, getContext());
|
||||||
getDeviceSupport().getDevice().sendDeviceUpdateIntent(getContext());
|
getDeviceSupport().getDevice().sendDeviceUpdateIntent(getContext());
|
||||||
|
GB.signalActivityDataFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user