mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Reduce dependency on selectedDevices
A lot of legacy code back from when Gadgetbridge only supported a single device still depends on selectedDevices. This can lead to issues if multiple devices of the same type are paired / connected, as it is not possible for coordinators to know which device is being checked, and they will simply use the first they find.
This commit is contained in:
+1
-1
@@ -395,7 +395,7 @@ public class ActivitySummariesFilter extends AbstractGBActivity {
|
||||
Device dbDevice = DBHelper.findDevice(device, daoSession);
|
||||
int icon = device.getDeviceCoordinator().getDefaultIconResource();
|
||||
if (dbDevice != null && coordinator != null
|
||||
&& coordinator.supportsActivityTracks()
|
||||
&& coordinator.supportsActivityTracks(device)
|
||||
&& !newMap.containsKey(device.getAliasOrName())) {
|
||||
newMap.put(device.getAliasOrName(), new Pair<>(dbDevice.getId(), icon));
|
||||
}
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ public class ControlCenterv2 extends AppCompatActivity
|
||||
// Hide 'refreshing' animation immediately if no health devices are connected
|
||||
List<GBDevice> devices1 = GBApplication.app().getDeviceManager().getDevices();
|
||||
for (GBDevice dev : devices1) {
|
||||
if (dev.getDeviceCoordinator().supportsActivityDataFetching() && dev.isInitialized()) {
|
||||
if (dev.getDeviceCoordinator().supportsActivityDataFetching(dev) && dev.isInitialized()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ public class WidgetConfigurationActivity extends Activity implements GBActivity
|
||||
allDevices = GBApplication.app().getDeviceManager().getDevices().stream()
|
||||
.filter(device -> {
|
||||
final DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||
return coordinator.supportsActivityDataFetching() || coordinator.supportsActivityTracking();
|
||||
return coordinator.supportsActivityDataFetching(device) || coordinator.supportsActivityTracking();
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
+11
-9
@@ -26,7 +26,6 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
@@ -209,6 +208,9 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (action == null) {
|
||||
return;
|
||||
}
|
||||
switch (action) {
|
||||
case ACTION_REFRESH_APPLIST: {
|
||||
if (intent.hasExtra("app_count")) {
|
||||
@@ -217,7 +219,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
LOG.info("will refresh list based on data from device");
|
||||
refreshListFromDevice(intent);
|
||||
}
|
||||
} else if (mCoordinator.supportsAppListFetching()) {
|
||||
} else if (mCoordinator.supportsAppListFetching(mGBDevice)) {
|
||||
refreshList();
|
||||
} else if (isCacheManager()) {
|
||||
refreshList();
|
||||
@@ -236,7 +238,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
}
|
||||
String path = intent.getStringExtra("EXTRA_PATH");
|
||||
String name = intent.getStringExtra("EXTRA_NAME");
|
||||
LOG.info("Attempting to add downloaded app " + name + " to cache");
|
||||
LOG.info("Attempting to add downloaded app {} to cache", name);
|
||||
FossilFileReader fileReader;
|
||||
try {
|
||||
fileReader = new FossilFileReader(Uri.fromFile(new File(path)), context);
|
||||
@@ -245,7 +247,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
if (FossilHRInstallHandler.saveAppInCache(fileReader, fileReader.getBackground(), fileReader.getPreview(), mCoordinator, context)) {
|
||||
LOG.info("Successfully moved downloaded app " + name + " to cache");
|
||||
LOG.info("Successfully moved downloaded app {} to cache", name);
|
||||
GB.toast(String.format(context.getString(R.string.appmanager_downloaded_to_cache), name), Toast.LENGTH_LONG, GB.INFO);
|
||||
if (isCacheManager()) {
|
||||
refreshList();
|
||||
@@ -395,7 +397,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
|
||||
LocalBroadcastManager.getInstance(getContext()).registerReceiver(mReceiver, filter);
|
||||
|
||||
if (mCoordinator.supportsAppListFetching()) {
|
||||
if (mCoordinator.supportsAppListFetching(mGBDevice)) {
|
||||
GBApplication.deviceService(mGBDevice).onAppInfoReq();
|
||||
if (isCacheManager()) {
|
||||
refreshList();
|
||||
@@ -424,7 +426,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
|
||||
final FloatingActionButton appListFab = ((FloatingActionButton) getActivity().findViewById(R.id.fab));
|
||||
final FloatingActionButton appListFabNew = ((FloatingActionButton) getActivity().findViewById(R.id.fab_new));
|
||||
watchfaceDesignerActivity = mCoordinator.getWatchfaceDesignerActivity();
|
||||
watchfaceDesignerActivity = mCoordinator.getWatchfaceDesignerActivity(mGBDevice);
|
||||
View rootView = inflater.inflate(R.layout.activity_appmanager, container, false);
|
||||
|
||||
RecyclerView appListView = (RecyclerView) (rootView.findViewById(R.id.appListView));
|
||||
@@ -450,7 +452,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
appList,
|
||||
R.layout.item_appmanager_watchapp,
|
||||
this,
|
||||
mCoordinator.supportsAppReordering() || isCacheManager()
|
||||
mCoordinator.supportsAppReordering(mGBDevice) || isCacheManager()
|
||||
);
|
||||
appListView.setAdapter(mGBDeviceAppAdapter);
|
||||
|
||||
@@ -692,7 +694,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
}
|
||||
|
||||
private void deleteAppFromDevice(final GBDeviceApp selectedApp) {
|
||||
if (mCoordinator.supportsAppReordering()) {
|
||||
if (mCoordinator.supportsAppReordering(mGBDevice)) {
|
||||
AppManagerActivity.deleteFromAppOrderFile(mGBDevice.getAddress() + ".watchapps", selectedApp.getUUID()); // FIXME: only if successful
|
||||
AppManagerActivity.deleteFromAppOrderFile(mGBDevice.getAddress() + ".watchfaces", selectedApp.getUUID()); // FIXME: only if successful
|
||||
Intent refreshIntent = new Intent(AbstractAppManagerFragment.ACTION_REFRESH_APPLIST);
|
||||
@@ -742,7 +744,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
|
||||
if (!mCoordinator.supportsAppReordering() && !isCacheManager()) {
|
||||
if (!mCoordinator.supportsAppReordering(mGBDevice) && !isCacheManager()) {
|
||||
return 0;
|
||||
}
|
||||
//we only support up and down movement and only for moving, not for swiping apps away
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class ActivityChartsActivity extends AbstractChartsActivity {
|
||||
@Override
|
||||
protected boolean supportsRefresh() {
|
||||
final DeviceCoordinator coordinator = getDevice().getDeviceCoordinator();
|
||||
return coordinator.supportsActivityDataFetching();
|
||||
return coordinator.supportsActivityDataFetching(getDevice());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -476,7 +476,7 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
|
||||
);
|
||||
|
||||
//fetch activity data
|
||||
holder.fetchActivityDataBox.setVisibility((device.isInitialized() && coordinator.supportsActivityDataFetching()) ? View.VISIBLE : View.GONE);
|
||||
holder.fetchActivityDataBox.setVisibility((device.isInitialized() && coordinator.supportsActivityDataFetching(device)) ? View.VISIBLE : View.GONE);
|
||||
holder.fetchActivityData.setOnClickListener(new View.OnClickListener()
|
||||
|
||||
{
|
||||
@@ -510,7 +510,7 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||
Class<? extends Activity> appsManagementActivity = coordinator.getAppsManagementActivity();
|
||||
Class<? extends Activity> appsManagementActivity = coordinator.getAppsManagementActivity(device);
|
||||
if (appsManagementActivity != null) {
|
||||
Intent startIntent = new Intent(context, appsManagementActivity);
|
||||
startIntent.putExtra(GBDevice.EXTRA_DEVICE, device);
|
||||
@@ -566,7 +566,7 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
|
||||
);
|
||||
|
||||
//show activity tracks
|
||||
holder.showActivityTracks.setVisibility(coordinator.supportsActivityTracks() ? View.VISIBLE : View.GONE);
|
||||
holder.showActivityTracks.setVisibility(coordinator.supportsActivityTracks(device) ? View.VISIBLE : View.GONE);
|
||||
holder.showActivityTracks.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
|
||||
+10
-10
@@ -243,7 +243,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
|
||||
@Override
|
||||
public boolean allowFetchActivityData(GBDevice device) {
|
||||
return device.isInitialized() && !device.isBusy() && supportsActivityDataFetching();
|
||||
return device.isInitialized() && !device.isBusy() && supportsActivityDataFetching(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -434,7 +434,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppReordering() {
|
||||
public boolean supportsAppReordering(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -507,13 +507,13 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getWatchfaceDesignerActivity() {
|
||||
public Class<? extends Activity> getWatchfaceDesignerActivity(final GBDevice device) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean supportsNavigation() {
|
||||
public boolean supportsNavigation(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -213,7 +213,7 @@ public interface DeviceCoordinator {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean supportsActivityDataFetching();
|
||||
boolean supportsActivityDataFetching(final GBDevice device);
|
||||
|
||||
/**
|
||||
* Returns true if activity tracking is supported by the device
|
||||
@@ -239,7 +239,7 @@ public interface DeviceCoordinator {
|
||||
* data. This is different from the constant activity tracking since the tracks are
|
||||
* usually recorded with additional features, like e.g. GPS.
|
||||
*/
|
||||
boolean supportsActivityTracks();
|
||||
boolean supportsActivityTracks(GBDevice device);
|
||||
|
||||
/**
|
||||
* Returns true if stress measurement and fetching is supported by the device
|
||||
@@ -559,14 +559,14 @@ public interface DeviceCoordinator {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Class<? extends Activity> getAppsManagementActivity();
|
||||
Class<? extends Activity> getAppsManagementActivity(GBDevice device);
|
||||
|
||||
/**
|
||||
* Returns the Activity class that will be used to design watchfaces.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Class<? extends Activity> getWatchfaceDesignerActivity();
|
||||
Class<? extends Activity> getWatchfaceDesignerActivity(GBDevice device);
|
||||
|
||||
/**
|
||||
* Returns the device app cache directory.
|
||||
@@ -591,12 +591,12 @@ public interface DeviceCoordinator {
|
||||
/**
|
||||
* Indicated whether the device supports fetching a list of its apps.
|
||||
*/
|
||||
boolean supportsAppListFetching();
|
||||
boolean supportsAppListFetching(GBDevice device);
|
||||
|
||||
/**
|
||||
* Indicates whether the device supports reordering of apps.
|
||||
*/
|
||||
boolean supportsAppReordering();
|
||||
boolean supportsAppReordering(GBDevice device);
|
||||
|
||||
/**
|
||||
* Returns how/if the given device should be bonded before connecting to it.
|
||||
@@ -618,7 +618,7 @@ public interface DeviceCoordinator {
|
||||
* Indicates whether the device has some kind of calender we can sync to.
|
||||
* Also used for generated sunrise/sunset events
|
||||
*/
|
||||
boolean supportsCalendarEvents();
|
||||
boolean supportsCalendarEvents(GBDevice device);
|
||||
|
||||
/**
|
||||
* Indicates whether the device supports getting a stream of live data.
|
||||
@@ -645,7 +645,7 @@ public interface DeviceCoordinator {
|
||||
* Indicates whether the device supports current weather and/or weather
|
||||
* forecast display.
|
||||
*/
|
||||
boolean supportsWeather();
|
||||
boolean supportsWeather(GBDevice device);
|
||||
|
||||
/**
|
||||
* Indicates whether the device supports being found by vibrating,
|
||||
@@ -816,7 +816,7 @@ public interface DeviceCoordinator {
|
||||
@Nullable
|
||||
WidgetManager getWidgetManager(GBDevice device);
|
||||
|
||||
boolean supportsNavigation();
|
||||
boolean supportsNavigation(GBDevice device);
|
||||
|
||||
int getOrderPriority();
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class AsteroidOSDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+6
-9
@@ -21,7 +21,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.banglejs;
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -41,11 +40,9 @@ import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SleepAsAndroidFeature;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryParser;
|
||||
@@ -82,7 +79,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -113,7 +110,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -123,7 +120,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -133,7 +130,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -169,7 +166,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return BuildConfig.INTERNET_ACCESS ? AppsManagementActivity.class : null;
|
||||
}
|
||||
|
||||
@@ -250,7 +247,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNavigation() {
|
||||
public boolean supportsNavigation(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -26,12 +26,9 @@ import androidx.annotation.NonNull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.binary_sensor.activity.DataActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
@@ -69,7 +66,7 @@ public class BinarySensorCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return DataActivity.class;
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -19,8 +19,6 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.casio.gbx100;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -32,7 +30,6 @@ import java.util.regex.Pattern;
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.casio.Casio2C2DDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.CasioGBX100ActivitySampleDao;
|
||||
@@ -93,7 +90,7 @@ public class CasioGBX100DeviceCoordinator extends Casio2C2DDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -231,17 +231,17 @@ public class CmfWatchProCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return AppManagerActivity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return false; // TODO it does not, but we can fake it for watchfaces
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ public class CmfWatchProCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ public class CmfWatchProCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -1,15 +1,12 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.cycling_sensor.coordinator;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.TimeSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.cycling_sensor.activity.CyclingLiveDataActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.cycling_sensor.db.CyclingSampleProvider;
|
||||
@@ -75,7 +72,7 @@ public class CyclingSensorCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return CyclingLiveDataActivity.class;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class PixooCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -213,6 +213,7 @@ public class G1DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() { return true; }
|
||||
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-7
@@ -19,8 +19,6 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.fitpro;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -35,7 +33,6 @@ import de.greenrobot.dao.query.QueryBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
@@ -76,7 +73,7 @@ public class FitProDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -116,13 +113,13 @@ public class FitProDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -132,7 +129,7 @@ public class FitProDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -15,7 +15,6 @@ import java.util.Map;
|
||||
import de.greenrobot.dao.AbstractDao;
|
||||
import de.greenrobot.dao.Property;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.appmanager.AppManagerActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettings;
|
||||
@@ -30,7 +29,6 @@ import nodomain.freeyourgadget.gadgetbridge.devices.Vo2MaxSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.vivomovehr.GarminCapability;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.BaseActivitySummaryDao;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.GarminActivitySampleDao;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.GarminBodyEnergySampleDao;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.GarminEventSampleDao;
|
||||
@@ -169,7 +167,7 @@ public abstract class GarminCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_garmin_realtime_settings);
|
||||
}
|
||||
|
||||
if (supportsCalendarEvents()){
|
||||
if (supportsCalendarEvents(device)){
|
||||
deviceSpecificSettings.addRootScreen(
|
||||
DeviceSpecificSettingsScreen.CALENDAR,
|
||||
R.xml.devicesettings_header_calendar,
|
||||
@@ -253,12 +251,12 @@ public abstract class GarminCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return AppManagerActivity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
|
||||
public abstract class GarminBikeComputerCoordinator extends GarminCoordinator {
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public abstract class GarminBikeComputerCoordinator extends GarminCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class GarminBikeComputerCoordinator extends GarminCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -8,18 +8,18 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
|
||||
public class GarminETrexSeCoordinator extends GarminCoordinator {
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
// for gps tracks
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -11,12 +11,12 @@ public abstract class GarminWatchCoordinator extends GarminCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public abstract class GarminWatchCoordinator extends GarminCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public abstract class GarminWatchCoordinator extends GarminCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@ abstract class GloryFitCoordinator : AbstractBLEDeviceCoordinator() {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun supportsActivityDataFetching(): Boolean {
|
||||
override fun supportsActivityDataFetching(device: GBDevice): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ abstract class GloryFitCoordinator : AbstractBLEDeviceCoordinator() {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun supportsWeather(): Boolean {
|
||||
override fun supportsWeather(device: GBDevice): Boolean {
|
||||
// TODO it does
|
||||
return false
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class HPlusCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class SG2Coordinator extends HPlusCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -149,7 +149,7 @@ public abstract class HuamiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -589,7 +589,7 @@ public abstract class HuamiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -59,12 +59,12 @@ public class AmazfitBand5Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -58,12 +58,12 @@ public class AmazfitBipCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,12 +62,12 @@ public class AmazfitBip3Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,12 +62,12 @@ public class AmazfitBip3ProCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -58,12 +58,12 @@ public class AmazfitBipSCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -58,12 +58,12 @@ public class AmazfitBipUCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -58,12 +58,12 @@ public class AmazfitBipUProCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -58,12 +58,12 @@ public class AmazfitCorCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -58,12 +58,12 @@ public class AmazfitCor2Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,12 +62,12 @@ public class AmazfitGTRCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class AmazfitGTRLiteCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class AmazfitGTR2Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class AmazfitGTR2eCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class AmazfitGTSCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class AmazfitGTS2Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class AmazfitGTS2eCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public class AmazfitNeoCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class AmazfitTRexCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class AmazfitTRexProCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,12 +62,12 @@ public class AmazfitVergeLCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -61,12 +61,12 @@ public class AmazfitXCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -66,12 +66,12 @@ public class MiBand3Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,12 +62,12 @@ public class MiBand4Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -61,12 +61,12 @@ public class MiBand5Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,7 +62,7 @@ public class MiBand6Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class MiBand6Coordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,12 +63,12 @@ public class ZeppECoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -181,7 +181,7 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return AppManagerActivity.class;
|
||||
}
|
||||
|
||||
@@ -306,12 +306,12 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ public class AmazfitHelioStrapCoordinator extends ZeppOsCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class AmazfitHelioStrapCoordinator extends ZeppOsCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -111,17 +111,17 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return huaweiCoordinator.supportsWeather();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return huaweiCoordinator.getAppManagerActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return huaweiCoordinator.getSupportsAppListFetching();
|
||||
}
|
||||
@Override
|
||||
@@ -165,12 +165,12 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return huaweiCoordinator.supportsCalendarEvents();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -120,17 +120,17 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return huaweiCoordinator.supportsWeather();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return huaweiCoordinator.getAppManagerActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return huaweiCoordinator.getSupportsAppListFetching();
|
||||
}
|
||||
@Override
|
||||
@@ -174,12 +174,12 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return huaweiCoordinator.supportsCalendarEvents();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -25,12 +25,10 @@ import java.util.Collections;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
@@ -57,7 +55,7 @@ public class ID115Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -6,12 +6,9 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.idasen.IdasenDeviceSupport;
|
||||
@@ -53,7 +50,7 @@ public class IdasenCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return IdasenControlActivity.class;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-7
@@ -17,18 +17,12 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.lefun;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
@@ -67,7 +61,7 @@ public class LefunDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class MarstekB2500DeviceCoordinator extends AbstractBLEDeviceCoordinator
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return SolarEquipmentStatusActivity.class;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -16,18 +16,13 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.mijia_lywsd;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.TimeSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.TemperatureSample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
@@ -40,7 +35,7 @@ public abstract class AbstractMijiaLywsdCoordinator extends AbstractBLEDeviceCoo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -102,7 +102,7 @@ public abstract class AbstractMoyoungDeviceCoordinator extends AbstractBLEDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public abstract class AbstractMoyoungDeviceCoordinator extends AbstractBLEDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public abstract class AbstractMoyoungDeviceCoordinator extends AbstractBLEDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public abstract class AbstractMoyoungDeviceCoordinator extends AbstractBLEDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ public abstract class AbstractMoyoungDeviceCoordinator extends AbstractBLEDevice
|
||||
if (getWorldClocksSlotCount() > 0) {
|
||||
generic.add(R.xml.devicesettings_world_clocks);
|
||||
}
|
||||
if (supportsCalendarEvents()) {
|
||||
if (supportsCalendarEvents(device)) {
|
||||
generic.add(R.xml.devicesettings_sync_calendar);
|
||||
}
|
||||
final List<Integer> health = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.HEALTH);
|
||||
|
||||
+2
-1
@@ -21,6 +21,7 @@ import androidx.annotation.DrawableRes;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
|
||||
public class KT80Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
@Override
|
||||
@@ -50,7 +51,7 @@ public class KT80Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class KsixVentureCoordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class RainbuvvyT97Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+19
-30
@@ -91,10 +91,8 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
DevicePrefs prefs = GBApplication.getDevicePrefs(device);
|
||||
int activityTracker = prefs.getInt("pebble_activitytracker", SampleProvider.PROVIDER_PEBBLE_HEALTH);
|
||||
return switch (activityTracker) {
|
||||
case SampleProvider.PROVIDER_PEBBLE_MISFIT ->
|
||||
new PebbleMisfitSampleProvider(device, session);
|
||||
case SampleProvider.PROVIDER_PEBBLE_MORPHEUZ ->
|
||||
new PebbleMorpheuzSampleProvider(device, session);
|
||||
case SampleProvider.PROVIDER_PEBBLE_MISFIT -> new PebbleMisfitSampleProvider(device, session);
|
||||
case SampleProvider.PROVIDER_PEBBLE_MORPHEUZ -> new PebbleMorpheuzSampleProvider(device, session);
|
||||
default -> new PebbleHealthSampleProvider(device, session);
|
||||
};
|
||||
}
|
||||
@@ -106,7 +104,9 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFlashing() { return true; }
|
||||
public boolean supportsFlashing() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
@@ -139,7 +139,7 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return AppManagerActivity.class;
|
||||
}
|
||||
|
||||
@@ -159,39 +159,28 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
List<GBDevice> devices = GBApplication.app().getDeviceManager().getSelectedDevices();
|
||||
for(GBDevice device : devices){
|
||||
if(device.getType() == DeviceType.PEBBLE){
|
||||
if (device.getFirmwareVersion() != null) {
|
||||
return PebbleUtils.getFwMajor(device.getFirmwareVersion()) < 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppReordering() {
|
||||
List<GBDevice> devices = GBApplication.app().getDeviceManager().getSelectedDevices();
|
||||
for(GBDevice device : devices){
|
||||
if(device.getType() == DeviceType.PEBBLE){
|
||||
if (device.getFirmwareVersion() != null) {
|
||||
return PebbleUtils.getFwMajor(device.getFirmwareVersion()) >= 3;
|
||||
}
|
||||
}
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
if (device.getFirmwareVersion() != null) {
|
||||
return PebbleUtils.getFwMajor(device.getFirmwareVersion()) < 3;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsAppReordering(final GBDevice device) {
|
||||
if (device.getFirmwareVersion() != null) {
|
||||
return PebbleUtils.getFwMajor(device.getFirmwareVersion()) >= 3;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -76,7 +76,7 @@ public class PineTimeJFCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class PineTimeJFCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNavigation() {
|
||||
public boolean supportsNavigation(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+25
-40
@@ -94,14 +94,8 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
List<GBDevice> devices = GBApplication.app().getDeviceManager().getSelectedDevices();
|
||||
for(GBDevice device : devices){
|
||||
if(isFossilHybrid(device) && device.getState() == GBDevice.State.INITIALIZED){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return isFossilHybrid(device) && device.getState() == GBDevice.State.INITIALIZED;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,8 +104,8 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
return isHybridHR();
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return isHybridHR(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,20 +144,13 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return installHandler.isValid() ? installHandler : null;
|
||||
}
|
||||
|
||||
private boolean supportsAlarmConfiguration() {
|
||||
List<GBDevice> devices = GBApplication.app().getDeviceManager().getSelectedDevices();
|
||||
LOG.debug("devices count: " + devices.size());
|
||||
for(GBDevice device : devices){
|
||||
if(isFossilHybrid(device) && device.getState() == GBDevice.State.INITIALIZED){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
private boolean supportsAlarmConfiguration(final GBDevice device) {
|
||||
return isFossilHybrid(device) && device.getState() == GBDevice.State.INITIALIZED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return this.supportsAlarmConfiguration() ? 5 : 0;
|
||||
public int getAlarmSlotCount(final GBDevice device) {
|
||||
return supportsAlarmConfiguration(device) ? 5 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,18 +188,18 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return isHybridHR() ? AppManagerActivity.class : QHybridConfigActivity.class;
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return isHybridHR(device) ? AppManagerActivity.class : QHybridConfigActivity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getWatchfaceDesignerActivity() {
|
||||
return isHybridHR() ? HybridHRWatchfaceDesignerActivity.class : null;
|
||||
public Class<? extends Activity> getWatchfaceDesignerActivity(final GBDevice device) {
|
||||
return isHybridHR(device) ? HybridHRWatchfaceDesignerActivity.class : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,8 +228,8 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return isHybridHR();
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return isHybridHR(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,8 +243,8 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return isHybridHR();
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return isHybridHR(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -282,12 +269,13 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
final List<Integer> generic = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.GENERIC);
|
||||
// Firmware version specific settings
|
||||
if (getFirmwareVersion() != null && getFirmwareVersion().smallerThan(new Version("3.0"))) {
|
||||
final Version firmwareVersion = getFirmwareVersion(device);
|
||||
if (firmwareVersion != null && firmwareVersion.smallerThan(new Version("3.0"))) {
|
||||
generic.add(R.xml.devicesettings_fossilhybridhr_pre_fw300);
|
||||
} else {
|
||||
generic.add(R.xml.devicesettings_fossilhybridhr_post_fw300);
|
||||
}
|
||||
if (getFirmwareVersion() != null && getFirmwareVersion().smallerThan(new Version("2.20"))) {
|
||||
if (firmwareVersion != null && firmwareVersion.smallerThan(new Version("2.20"))) {
|
||||
generic.add(R.xml.devicesettings_fossilhybridhr_pre_fw220);
|
||||
}
|
||||
// Settings applicable to all firmware versions
|
||||
@@ -343,12 +331,9 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return device.getName().startsWith("Hybrid HR") || device.getName().equals("Fossil Gen. 6 Hybrid");
|
||||
}
|
||||
|
||||
private Version getFirmwareVersion() {
|
||||
List<GBDevice> devices = GBApplication.app().getDeviceManager().getSelectedDevices();
|
||||
for (GBDevice device : devices) {
|
||||
if (isFossilHybrid(device)) {
|
||||
return new Version(device.getFirmwareVersion2());
|
||||
}
|
||||
private Version getFirmwareVersion(final GBDevice device) {
|
||||
if (isFossilHybrid(device)) {
|
||||
return new Version(device.getFirmwareVersion2());
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -369,8 +354,8 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNavigation() {
|
||||
return isHybridHR();
|
||||
public boolean supportsNavigation(final GBDevice device) {
|
||||
return isHybridHR(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class SMAQ2OSSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -113,12 +113,12 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class SonySWR12DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+23
-23
@@ -172,7 +172,7 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
@Nullable
|
||||
@Override
|
||||
public ActivitySummaryParser getActivitySummaryParser(final GBDevice device, final Context context) {
|
||||
return supportsActivityTracks() ? new TestActivitySummaryParser() : super.getActivitySummaryParser(device, context);
|
||||
return supportsActivityTracks(device) ? new TestActivitySummaryParser() : super.getActivitySummaryParser(device, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -191,8 +191,8 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
return supports(getTestDevice(), TestFeature.APP_LIST_FETCHING);
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return supports(device, TestFeature.APP_LIST_FETCHING);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -209,7 +209,7 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return supports(getTestDevice(), TestFeature.SCREENSHOTS);
|
||||
return supports(device, TestFeature.SCREENSHOTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -240,51 +240,51 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppReordering() {
|
||||
return supports(getTestDevice(), TestFeature.APP_REORDERING);
|
||||
public boolean supportsAppReordering(final GBDevice device) {
|
||||
return supports(device, TestFeature.APP_REORDERING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return supports(getTestDevice(), TestFeature.APPS_MANAGEMENT);
|
||||
return supports(device, TestFeature.APPS_MANAGEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCachedAppManagement(final GBDevice device) {
|
||||
return supports(getTestDevice(), TestFeature.CACHED_APP_MANAGEMENT);
|
||||
return supports(device, TestFeature.CACHED_APP_MANAGEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsInstalledAppManagement(final GBDevice device) {
|
||||
return supports(getTestDevice(), TestFeature.INSTALLED_APP_MANAGEMENT);
|
||||
return supports(device, TestFeature.INSTALLED_APP_MANAGEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWatchfaceManagement(final GBDevice device) {
|
||||
return supports(getTestDevice(), TestFeature.WATCHFACE_MANAGEMENT);
|
||||
return supports(device, TestFeature.WATCHFACE_MANAGEMENT);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return AppManagerActivity.class;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getWatchfaceDesignerActivity() {
|
||||
public Class<? extends Activity> getWatchfaceDesignerActivity(final GBDevice device) {
|
||||
// TODO getWatchfaceDesignerActivity
|
||||
return super.getWatchfaceDesignerActivity();
|
||||
return super.getWatchfaceDesignerActivity(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return supports(getTestDevice(), TestFeature.CALENDAR_EVENTS);
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return supports(device, TestFeature.CALENDAR_EVENTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return supports(getTestDevice(), TestFeature.ACTIVITY_DATA_FETCHING);
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return supports(device, TestFeature.ACTIVITY_DATA_FETCHING);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -318,8 +318,8 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
return supports(getTestDevice(), TestFeature.ACTIVITY_TRACKS);
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return supports(device, TestFeature.ACTIVITY_TRACKS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -471,8 +471,8 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return supports(getTestDevice(), TestFeature.WEATHER);
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return supports(device, TestFeature.WEATHER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -585,8 +585,8 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNavigation() {
|
||||
return supports(getTestDevice(), TestFeature.NAVIGATION);
|
||||
public boolean supportsNavigation(final GBDevice device) {
|
||||
return supports(device, TestFeature.NAVIGATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class TLW64Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ public class UltrahumanDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class UM25Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return DataActivity.class;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ public class VescCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class VescCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return VescControlActivity.class;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@ public class WithingsSteelHRDeviceCoordinator extends AbstractBLEDeviceCoordinat
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class WithingsSteelHRDeviceCoordinator extends AbstractBLEDeviceCoordinat
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -216,17 +216,17 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
public Class<? extends Activity> getAppsManagementActivity(final GBDevice device) {
|
||||
return AppManagerActivity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppListFetching() {
|
||||
public boolean supportsAppListFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppReordering() {
|
||||
public boolean supportsAppReordering(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -236,12 +236,12 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracks() {
|
||||
public boolean supportsActivityTracks(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
//
|
||||
// Calendar
|
||||
//
|
||||
if (supportsCalendarEvents()) {
|
||||
if (supportsCalendarEvents(device)) {
|
||||
deviceSpecificSettings.addRootScreen(
|
||||
DeviceSpecificSettingsScreen.CALENDAR,
|
||||
R.xml.devicesettings_header_calendar,
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class MiWatchLiteCoordinator extends XiaomiCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
public boolean supportsCalendarEvents(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class XWatchCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ public abstract class AbstractYawellRingCoordinator extends AbstractBLEDeviceCoo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ public class ZeTimeCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
public boolean supportsWeather(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ZeTimeCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
public boolean supportsActivityDataFetching(final GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+15
-14
@@ -207,20 +207,20 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
this.supportsSleepAsAndroid = supportsSleepAsAndroid;
|
||||
}
|
||||
|
||||
public void logicalOr(DeviceCoordinator operand){
|
||||
if(operand.supportsCalendarEvents()){
|
||||
public void logicalOr(DeviceCoordinator operand, final GBDevice device){
|
||||
if (operand.supportsCalendarEvents(device)) {
|
||||
setSupportsCalendarEvents(true);
|
||||
}
|
||||
if(operand.supportsWeather()){
|
||||
if (operand.supportsWeather(device)) {
|
||||
setSupportsWeather(true);
|
||||
}
|
||||
if(operand.supportsActivityDataFetching()){
|
||||
if (operand.supportsActivityDataFetching(device)) {
|
||||
setSupportsActivityDataFetching(true);
|
||||
}
|
||||
if(operand.supportsMusicInfo()){
|
||||
if (operand.supportsMusicInfo()) {
|
||||
setSupportsMusicInfo(true);
|
||||
}
|
||||
if(operand.supportsNavigation()){
|
||||
if (operand.supportsNavigation(device)) {
|
||||
setSupportsNavigation(true);
|
||||
}
|
||||
if (operand.supportsSleepAsAndroid()) {
|
||||
@@ -307,7 +307,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
private final String API_LEGACY_ACTION_DEVICE_CONNECTED = "nodomain.freeyourgadget.gadgetbridge.BLUETOOTH_CONNECTED";
|
||||
private final String API_LEGACY_ACTION_DEVICE_SCANNED = "nodomain.freeyourgadget.gadgetbridge.BLUETOOTH_SCANNED";
|
||||
|
||||
private void sendDeviceAPIBroadcast(String address, String action){
|
||||
private void sendDeviceAPIBroadcast(String address, String action) {
|
||||
if(!allowBluetoothIntentApi){
|
||||
LOG.debug("not sending API event due to settings");
|
||||
return;
|
||||
@@ -492,20 +492,21 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
|
||||
FeatureSet features = new FeatureSet();
|
||||
|
||||
for(DeviceStruct struct: deviceStructs){
|
||||
for (DeviceStruct struct: deviceStructs) {
|
||||
final GBDevice device = struct.getDevice();
|
||||
DeviceSupport deviceSupport = struct.getDeviceSupport();
|
||||
if((deviceSupport != null && deviceSupport.useAutoConnect()) || isDeviceInitialized(struct.getDevice())){
|
||||
if ((deviceSupport != null && deviceSupport.useAutoConnect()) || isDeviceInitialized(device)) {
|
||||
enableReceivers = true;
|
||||
}
|
||||
if(isDeviceInitialized(struct.getDevice())){
|
||||
if (isDeviceInitialized(device)) {
|
||||
anyDeviceInitialized = true;
|
||||
}
|
||||
|
||||
DeviceCoordinator coordinator = struct.getCoordinator();
|
||||
if(coordinator != null){
|
||||
features.logicalOr(coordinator);
|
||||
if (coordinator.supportsCalendarEvents()){
|
||||
devicesWithCalendar.add(struct.getDevice());
|
||||
if (coordinator != null){
|
||||
features.logicalOr(coordinator, device);
|
||||
if (coordinator.supportsCalendarEvents(device)) {
|
||||
devicesWithCalendar.add(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class HuamiFetcher {
|
||||
this.fetchOperationQueue.add(new FetchActivityOperation(this));
|
||||
}
|
||||
|
||||
if ((dataTypes & RecordedDataTypes.TYPE_GPS_TRACKS) != 0 && coordinator.supportsActivityTracks()) {
|
||||
if ((dataTypes & RecordedDataTypes.TYPE_GPS_TRACKS) != 0 && coordinator.supportsActivityTracks(gbDevice)) {
|
||||
this.fetchOperationQueue.add(new FetchSportsSummaryOperation(this, 1));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2824,7 +2824,7 @@ public abstract class HuamiSupport extends AbstractBTLESingleDeviceSupport
|
||||
@Override
|
||||
public void onSendWeather(ArrayList<WeatherSpec> weatherSpecs) {
|
||||
final DeviceCoordinator coordinator = gbDevice.getDeviceCoordinator();
|
||||
if (!coordinator.supportsWeather()) {
|
||||
if (!coordinator.supportsWeather(getDevice())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ public class XiaomiSupport extends AbstractDeviceSupport {
|
||||
public void onSetTime() {
|
||||
systemService.setCurrentTime();
|
||||
|
||||
if (getCoordinator().supportsCalendarEvents()) {
|
||||
if (getCoordinator().supportsCalendarEvents(getDevice())) {
|
||||
// TODO this should not be done here
|
||||
calendarService.syncCalendar();
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ public class GB {
|
||||
deviceCommunicationServiceIntent.setAction(DeviceService.ACTION_DISCONNECT);
|
||||
PendingIntent disconnectPendingIntent = PendingIntentUtils.getService(context, 0, deviceCommunicationServiceIntent, PendingIntent.FLAG_ONE_SHOT, false);
|
||||
builder.addAction(R.drawable.ic_notification_disconnected, context.getString(R.string.controlcenter_disconnect), disconnectPendingIntent);
|
||||
if (device.getDeviceCoordinator().supportsActivityDataFetching()) {
|
||||
if (device.getDeviceCoordinator().supportsActivityDataFetching(device)) {
|
||||
deviceCommunicationServiceIntent.setAction(DeviceService.ACTION_FETCH_RECORDED_DATA);
|
||||
deviceCommunicationServiceIntent.putExtra(EXTRA_RECORDED_DATA_TYPES, ActivityKind.ACTIVITY);
|
||||
PendingIntent fetchPendingIntent = PendingIntentUtils.getService(context, 1, deviceCommunicationServiceIntent, PendingIntent.FLAG_ONE_SHOT, false);
|
||||
@@ -241,7 +241,7 @@ public class GB {
|
||||
isConnected = false;
|
||||
}
|
||||
|
||||
anyDeviceSupportesActivityDataFetching |= device.getDeviceCoordinator().supportsActivityDataFetching();
|
||||
anyDeviceSupportesActivityDataFetching |= device.getDeviceCoordinator().supportsActivityDataFetching(device);
|
||||
|
||||
String deviceName = device.getAliasOrName();
|
||||
String text = device.getStateString(context);
|
||||
|
||||
Reference in New Issue
Block a user