moved getModelName to superclass

This commit is contained in:
dakhnod 2019-11-21 22:17:42 +01:00
parent afc177078a
commit e0905703af
3 changed files with 13 additions and 29 deletions

View File

@ -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();

View File

@ -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() {

View File

@ -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());