1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Replace CRLF with LF (no content changes)

This commit is contained in:
Newline Bot 2018-09-17 18:28:56 +02:00 committed by Daniele Gobbetti
parent b9944ec028
commit a55c3d7220
2 changed files with 150 additions and 150 deletions

View File

@ -15,124 +15,124 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.xwatch; package nodomain.freeyourgadget.gadgetbridge.devices.xwatch;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.net.Uri; import android.net.Uri;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import nodomain.freeyourgadget.gadgetbridge.GBException; import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider; import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession; import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device; import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample; import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class XWatchCoordinator extends AbstractDeviceCoordinator { public class XWatchCoordinator extends AbstractDeviceCoordinator {
@NonNull @NonNull
@Override @Override
public DeviceType getSupportedType(GBDeviceCandidate candidate) { public DeviceType getSupportedType(GBDeviceCandidate candidate) {
String name = candidate.getDevice().getName(); String name = candidate.getDevice().getName();
if (name != null && name.startsWith("XWatch")) { if (name != null && name.startsWith("XWatch")) {
return DeviceType.XWATCH; return DeviceType.XWATCH;
} }
return DeviceType.UNKNOWN; return DeviceType.UNKNOWN;
} }
@Override @Override
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException { protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
} }
@Override @Override
public DeviceType getDeviceType() { public DeviceType getDeviceType() {
return DeviceType.XWATCH; return DeviceType.XWATCH;
} }
@Nullable @Nullable
@Override @Override
public Class<? extends Activity> getPairingActivity() { public Class<? extends Activity> getPairingActivity() {
return null; return null;
} }
@Override @Override
public boolean supportsActivityDataFetching() { public boolean supportsActivityDataFetching() {
return true; return true;
} }
@Override @Override
public boolean supportsActivityTracking() { public boolean supportsActivityTracking() {
return true; return true;
} }
@Override @Override
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) { public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
return new XWatchSampleProvider(device, session); return new XWatchSampleProvider(device, session);
} }
@Override @Override
public InstallHandler findInstallHandler(Uri uri, Context context) { public InstallHandler findInstallHandler(Uri uri, Context context) {
return null; return null;
} }
@Override @Override
public boolean supportsScreenshots() { public boolean supportsScreenshots() {
return false; return false;
} }
@Override @Override
public boolean supportsAlarmConfiguration() { public boolean supportsAlarmConfiguration() {
return true; return true;
} }
@Override @Override
public boolean supportsSmartWakeup(GBDevice device) { public boolean supportsSmartWakeup(GBDevice device) {
return false; return false;
} }
@Override @Override
public boolean supportsHeartRateMeasurement(GBDevice device) { public boolean supportsHeartRateMeasurement(GBDevice device) {
return false; return false;
} }
@Override @Override
public String getManufacturer() { public String getManufacturer() {
return "Generic"; return "Generic";
} }
@Override @Override
public boolean supportsAppsManagement() { public boolean supportsAppsManagement() {
return false; return false;
} }
@Override @Override
public Class<? extends Activity> getAppsManagementActivity() { public Class<? extends Activity> getAppsManagementActivity() {
return null; return null;
} }
@Override @Override
public boolean supportsCalendarEvents() { public boolean supportsCalendarEvents() {
return false; return false;
} }
@Override @Override
public boolean supportsRealtimeData() { public boolean supportsRealtimeData() {
return false; return false;
} }
@Override @Override
public boolean supportsWeather() { public boolean supportsWeather() {
return false; return false;
} }
@Override @Override
public boolean supportsFindDevice() { public boolean supportsFindDevice() {
return true; return true;
} }
} }

View File

@ -14,37 +14,37 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.xwatch; package nodomain.freeyourgadget.gadgetbridge.devices.xwatch;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
public class XWatchService { public class XWatchService {
public static final UUID UUID_NOTIFY = UUID.fromString("0000fff7-0000-1000-8000-00805f9b34fb"); public static final UUID UUID_NOTIFY = UUID.fromString("0000fff7-0000-1000-8000-00805f9b34fb");
public static final UUID UUID_SERVICE = UUID.fromString("0000fff0-0000-1000-8000-00805f9b34fb"); public static final UUID UUID_SERVICE = UUID.fromString("0000fff0-0000-1000-8000-00805f9b34fb");
public static final UUID UUID_WRITE = UUID.fromString("0000fff6-0000-1000-8000-00805f9b34fb"); public static final UUID UUID_WRITE = UUID.fromString("0000fff6-0000-1000-8000-00805f9b34fb");
public static final byte COMMAND_CONNECTED = 0x01; public static final byte COMMAND_CONNECTED = 0x01;
public static final byte COMMAND_ACTION_BUTTON = 0x4c; public static final byte COMMAND_ACTION_BUTTON = 0x4c;
public static final byte COMMAND_ACTIVITY_DATA = 0x43; public static final byte COMMAND_ACTIVITY_DATA = 0x43;
public static final byte COMMAND_ACTIVITY_TOTALS = 0x46; public static final byte COMMAND_ACTIVITY_TOTALS = 0x46;
private static final Map<UUID, String> XWATCH_DEBUG; private static final Map<UUID, String> XWATCH_DEBUG;
static { static {
XWATCH_DEBUG = new HashMap<>(); XWATCH_DEBUG = new HashMap<>();
XWATCH_DEBUG.put(UUID_NOTIFY, "Read data"); XWATCH_DEBUG.put(UUID_NOTIFY, "Read data");
XWATCH_DEBUG.put(UUID_WRITE, "Write data"); XWATCH_DEBUG.put(UUID_WRITE, "Write data");
XWATCH_DEBUG.put(UUID_SERVICE, "Get service"); XWATCH_DEBUG.put(UUID_SERVICE, "Get service");
} }
public static String lookup(UUID uuid, String fallback) { public static String lookup(UUID uuid, String fallback) {
String name = XWATCH_DEBUG.get(uuid); String name = XWATCH_DEBUG.get(uuid);
if (name == null) { if (name == null) {
name = fallback; name = fallback;
} }
return name; return name;
} }
} }