mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-01 06:22:55 +01:00
Coordinator: add explicit methods to determine if the device supports app management and which class is responsible for it.
This commit is contained in:
parent
a39e3a035c
commit
1f77e3e84f
@ -140,4 +140,19 @@ public interface DeviceCoordinator {
|
|||||||
* Returns the readable name of the manufacturer.
|
* Returns the readable name of the manufacturer.
|
||||||
*/
|
*/
|
||||||
String getManufacturer();
|
String getManufacturer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this device/coordinator supports managing device apps.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean supportsAppsManagement();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Activity class that will be used to manage device apps.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Class<? extends Activity> getAppsManagementActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -142,4 +142,14 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
public String getManufacturer() {
|
public String getManufacturer() {
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsAppsManagement() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Activity> getAppsManagementActivity() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,16 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator {
|
|||||||
return "Xiaomi";
|
return "Xiaomi";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsAppsManagement() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Activity> getAppsManagementActivity() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean hasValidUserInfo() {
|
public static boolean hasValidUserInfo() {
|
||||||
String dummyMacAddress = MiBandService.MAC_ADDRESS_FILTER_1_1A + ":00:00:00";
|
String dummyMacAddress = MiBandService.MAC_ADDRESS_FILTER_1_1A + ":00:00:00";
|
||||||
try {
|
try {
|
||||||
|
@ -117,4 +117,14 @@ public class PebbleCoordinator extends AbstractDeviceCoordinator {
|
|||||||
public String getManufacturer() {
|
public String getManufacturer() {
|
||||||
return "Pebble";
|
return "Pebble";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsAppsManagement() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Activity> getAppsManagementActivity() {
|
||||||
|
return AppManagerActivity.class;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,16 @@ public class VibratissimoCoordinator extends AbstractDeviceCoordinator {
|
|||||||
return "Amor AG";
|
return "Amor AG";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsAppsManagement() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Activity> getAppsManagementActivity() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@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 {
|
||||||
// nothing to delete, yet
|
// nothing to delete, yet
|
||||||
|
Loading…
Reference in New Issue
Block a user