1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-02 23:12:57 +01:00

Code refactoring: introduced GBDevice.State.equalsOrHigherThan

This commit is contained in:
Daniel Dakhno 2024-02-26 01:01:46 +01:00
parent 7219bd377b
commit a75b3afc84

View File

@ -318,7 +318,7 @@ public class GBDevice implements Parcelable {
} }
public boolean isInitialized() { public boolean isInitialized() {
return mState.ordinal() >= State.INITIALIZED.ordinal(); return mState.equalsOrHigherThan(State.INITIALIZED);
} }
public boolean isConnecting() { public boolean isConnecting() {
@ -760,5 +760,9 @@ public class GBDevice implements Parcelable {
public int getSimpleStringId() { public int getSimpleStringId() {
return simpleStringId; return simpleStringId;
} }
boolean equalsOrHigherThan(State otherState){
return ordinal() >= otherState.ordinal();
}
} }
} }