mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-11 17:41:57 +01:00
moved getModelName to superclass
This commit is contained in:
parent
afc177078a
commit
e0905703af
@ -43,7 +43,19 @@ public abstract class WatchAdapter {
|
|||||||
public abstract boolean supportsFindDevice();
|
public abstract boolean supportsFindDevice();
|
||||||
public abstract boolean supportsExtendedVibration();
|
public abstract boolean supportsExtendedVibration();
|
||||||
public abstract boolean supportsActivityHand();
|
public abstract boolean supportsActivityHand();
|
||||||
public abstract String getModelName();
|
|
||||||
|
public String getModelName() {
|
||||||
|
String modelNumber = getDeviceSupport().getDevice().getModel();
|
||||||
|
switch (modelNumber) {
|
||||||
|
case "HW.0.0":
|
||||||
|
return "Q Commuter";
|
||||||
|
case "HL.0.0":
|
||||||
|
return "Q Activist";
|
||||||
|
case "DN.1.0":
|
||||||
|
return "Hybrid HR Collider";
|
||||||
|
}
|
||||||
|
return "unknwon Q";
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void onFetchActivityData();
|
public abstract void onFetchActivityData();
|
||||||
|
|
||||||
|
@ -258,20 +258,6 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
throw new UnsupportedOperationException("Model " + modelNumber + " not supported");
|
throw new UnsupportedOperationException("Model " + modelNumber + " not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getModelName() {
|
|
||||||
String modelNumber = getDeviceSupport().getDevice().getModel();
|
|
||||||
switch (modelNumber) {
|
|
||||||
case "HW.0.0":
|
|
||||||
return "Q Commuter";
|
|
||||||
case "HL.0.0":
|
|
||||||
return "Q Activist";
|
|
||||||
case "DN.1.0":
|
|
||||||
return "Hybrid HR";
|
|
||||||
}
|
|
||||||
return "unknwon Q";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFetchActivityData() {
|
public void onFetchActivityData() {
|
||||||
|
|
||||||
|
@ -435,20 +435,6 @@ public class MisfitWatchAdapter extends WatchAdapter {
|
|||||||
throw new UnsupportedOperationException("Model " + modelNumber + " not supported");
|
throw new UnsupportedOperationException("Model " + modelNumber + " not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getModelName() {
|
|
||||||
String modelNumber = getDeviceSupport().getDevice().getModel();
|
|
||||||
switch (modelNumber) {
|
|
||||||
case "HW.0.0":
|
|
||||||
return "Q Commuter";
|
|
||||||
case "HL.0.0":
|
|
||||||
return "Q Activist";
|
|
||||||
case "DN.1.0":
|
|
||||||
return "Hybrid HR";
|
|
||||||
}
|
|
||||||
return "unknwon Q";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFetchActivityData() {
|
public void onFetchActivityData() {
|
||||||
requestQueue.add(new BatteryLevelRequest());
|
requestQueue.add(new BatteryLevelRequest());
|
||||||
|
Loading…
Reference in New Issue
Block a user