Make ControlCenter only ask for version details after device is initialized
This allows removal of a workaround which allowed ACTION_REQUEST_VERSIONINFO to be used in connected state (instead of initialized state)
This commit is contained in:
parent
fe11e6d306
commit
27f88e484d
|
@ -29,16 +29,16 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.activities.charts.ChartsActivity;
|
import nodomain.freeyourgadget.gadgetbridge.activities.charts.ChartsActivity;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.adapter.GBDeviceAdapter;
|
import nodomain.freeyourgadget.gadgetbridge.adapter.GBDeviceAdapter;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst;
|
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||||
|
|
||||||
public class ControlCenter extends Activity {
|
public class ControlCenter extends Activity {
|
||||||
|
|
||||||
|
@ -83,8 +83,8 @@ public class ControlCenter extends Activity {
|
||||||
|
|
||||||
refreshBusyState(dev);
|
refreshBusyState(dev);
|
||||||
|
|
||||||
if (dev.isConnected() && dev.getFirmwareVersion() == null && !dev.isInitializing()) {
|
if (dev.isInitialized() && dev.getFirmwareVersion() == null) {
|
||||||
LOG.info("device connected, requesting more info");
|
LOG.info("device initalized, requesting more info");
|
||||||
requestDeviceInfo();
|
requestDeviceInfo();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class DeviceCommunicationService extends Service {
|
||||||
return START_NOT_STICKY;
|
return START_NOT_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mDeviceSupport == null) || (!(isConnected() && action.equals(ACTION_REQUEST_VERSIONINFO)) && !isInitialized() && !mDeviceSupport.useAutoConnect())) {
|
if (mDeviceSupport == null || (!isInitialized() && !mDeviceSupport.useAutoConnect())) {
|
||||||
// trying to send notification without valid Bluetooth connection
|
// trying to send notification without valid Bluetooth connection
|
||||||
if (mGBDevice != null) {
|
if (mGBDevice != null) {
|
||||||
// at least send back the current device state
|
// at least send back the current device state
|
||||||
|
|
Loading…
Reference in New Issue