1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 21:06:50 +01:00

Revert "remove unused getPrimaryActivity() from coodinators, mark Mi Band HRX as non-heartrate"

This reverts commit 495ba81edc.

See discussion in https://github.com/Freeyourgadget/Gadgetbridge/issues/1165
This commit is contained in:
cpfeiffer 2018-07-27 13:14:28 +02:00
parent 55f7120a77
commit 63231ec49a
10 changed files with 57 additions and 0 deletions

View File

@ -123,6 +123,15 @@ public interface DeviceCoordinator {
@Nullable
Class<? extends Activity> getPairingActivity();
/**
* Returns the Activity class that will be used as the primary activity
* for the given device.
*
* @return the primary activity class, or null if none
*/
@Nullable
Class<? extends Activity> getPrimaryActivity();
/**
* Returns true if activity data fetching is supported by the device
* (with this coordinator).

View File

@ -112,6 +112,11 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
return ControlCenterv2.class;
}
@Override
public Class<? extends Activity> getPrimaryActivity() {
return null;
}
@Override
public SampleProvider<?> getSampleProvider(GBDevice device, DaoSession session) {
return new UnknownSampleProvider();

View File

@ -113,6 +113,11 @@ public class HPlusCoordinator extends AbstractDeviceCoordinator {
return null;
}
@Override
public Class<? extends Activity> getPrimaryActivity() {
return ChartsActivity.class;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;

View File

@ -16,10 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami.miband2;
import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -74,4 +76,9 @@ public class MiBand2HRXCoordinator extends HuamiCoordinator {
return false;
}
@Nullable
@Override
public Class<? extends Activity> getPrimaryActivity() {
return null;
}
}

View File

@ -99,6 +99,11 @@ public class TeclastH30Coordinator extends AbstractDeviceCoordinator {
return null;
}
@Override
public Class<? extends Activity> getPrimaryActivity() {
return ChartsActivity.class;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;

View File

@ -54,6 +54,11 @@ public class LiveviewCoordinator extends AbstractDeviceCoordinator {
return null;
}
@Override
public Class<? extends Activity> getPrimaryActivity() {
return null;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;

View File

@ -110,6 +110,11 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator {
return MiBandPairingActivity.class;
}
@Override
public Class<? extends Activity> getPrimaryActivity() {
return ChartsActivity.class;
}
@Override
public SampleProvider<? extends AbstractActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
return new MiBandSampleProvider(device, session);

View File

@ -82,6 +82,12 @@ public class No1F1Coordinator extends AbstractDeviceCoordinator {
return null;
}
@Nullable
@Override
public Class<? extends Activity> getPrimaryActivity() {
return ChartsActivity.class;
}
@Override
public boolean supportsActivityDataFetching() {
return true;

View File

@ -66,6 +66,11 @@ public class PebbleCoordinator extends AbstractDeviceCoordinator {
return PebblePairingActivity.class;
}
@Override
public Class<? extends Activity> getPrimaryActivity() {
return AppManagerActivity.class;
}
@Override
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
Long deviceId = device.getId();

View File

@ -55,6 +55,11 @@ public class VibratissimoCoordinator extends AbstractDeviceCoordinator {
return null;
}
@Override
public Class<? extends Activity> getPrimaryActivity() {
return VibrationActivity.class;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;