From 070876db068f524ad951dc6029cf53d52db095ca Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Mon, 24 Aug 2015 13:19:17 +0200 Subject: [PATCH] Allow disconnecting when device is connecting Also require "initialized" state for "find device" --- .../freeyourgadget/gadgetbridge/activities/ControlCenter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java index 0ce5a426..6a97fe90 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java @@ -170,8 +170,10 @@ public class ControlCenter extends Activity { menu.removeItem(R.id.controlcenter_take_screenshot); } - if (!selectedDevice.isConnected()) { + if (selectedDevice.getState() == GBDevice.State.NOT_CONNECTED) { menu.removeItem(R.id.controlcenter_disconnect); + } + if (!selectedDevice.isInitialized()) { menu.removeItem(R.id.controlcenter_find_device); }