diff --git a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/NativeAutomatorServer.kt b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/NativeAutomatorServer.kt index 24c008793..5b540e5a8 100644 --- a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/NativeAutomatorServer.kt +++ b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/NativeAutomatorServer.kt @@ -63,6 +63,26 @@ class NativeAutomatorServer : NativeAutomatorGrpcKt.NativeAutomatorCoroutineImpl return empty { } } + override suspend fun enableAirplaneMode(request: Contracts.AirplaneModeRequest): Empty { + automation.enableAirplaneMode() + return empty {} + } + + override suspend fun disableAirplaneMode(request: Contracts.AirplaneModeRequest): Contracts.Empty { + automation.disableAirplaneMode() + return empty {} + } + + override suspend fun enableCellular(request: Contracts.CellularRequest): Empty { + automation.enableCellular() + return empty { } + } + + override suspend fun disableCellular(request: Contracts.CellularRequest): Empty { + automation.disableCellular() + return empty { } + } + override suspend fun enableWiFi(request: Contracts.WiFiRequest): Empty { automation.enableWifi() return empty { } @@ -73,13 +93,13 @@ class NativeAutomatorServer : NativeAutomatorGrpcKt.NativeAutomatorCoroutineImpl return empty { } } - override suspend fun enableCellular(request: Contracts.CellularRequest): Empty { - automation.enableCellular() + override suspend fun enableBluetooth(request: Contracts.BluetoothRequest): Contracts.Empty { + automation.enableBluetooth() return empty { } } - override suspend fun disableCellular(request: Contracts.CellularRequest): Empty { - automation.disableCellular() + override suspend fun disableBluetooth(request: Contracts.BluetoothRequest): Contracts.Empty { + automation.disableBluetooth() return empty { } } diff --git a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/PatrolAutomator.kt b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/PatrolAutomator.kt index 6a29faf8d..33231aff2 100644 --- a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/PatrolAutomator.kt +++ b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/PatrolAutomator.kt @@ -109,17 +109,21 @@ class PatrolAutomator private constructor() { fun disableDarkMode() = executeShellCommand("cmd uimode night no") - fun disableWifi() = executeShellCommand("svc wifi disable") + fun enableAirplaneMode(): Unit = TODO() - fun enableWifi() = executeShellCommand("svc wifi enable") + fun disableAirplaneMode(): Unit = TODO() fun disableCellular() = executeShellCommand("svc data disable") fun enableCellular() = executeShellCommand("svc data enable") - fun enableBluetooth() = executeShellCommand("svc bluetooth enable") + fun disableWifi() = executeShellCommand("svc wifi disable") + + fun enableWifi() = executeShellCommand("svc wifi enable") + + fun enableBluetooth(): Unit = TODO() - fun disableBluetooth() = executeShellCommand("svc bluetooth disable") + fun disableBluetooth(): Unit = TODO() fun getNativeWidgets(selector: BySelector): List { Logger.d("getNativeWidgets()") diff --git a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/AirplaneModeRequestKt.kt b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/AirplaneModeRequestKt.kt new file mode 100644 index 000000000..ded7f62ee --- /dev/null +++ b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/AirplaneModeRequestKt.kt @@ -0,0 +1,46 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: contracts.proto + +package pl.leancode.automatorserver.contracts; + +@kotlin.jvm.JvmName("-initializeairplaneModeRequest") +inline fun airplaneModeRequest(block: pl.leancode.automatorserver.contracts.AirplaneModeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest = + pl.leancode.automatorserver.contracts.AirplaneModeRequestKt.Dsl._create(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.newBuilder()).apply { block() }._build() +object AirplaneModeRequestKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest = _builder.build() + + /** + * string appId = 1; + */ + var appId: kotlin.String + @JvmName("getAppId") + get() = _builder.getAppId() + @JvmName("setAppId") + set(value) { + _builder.setAppId(value) + } + /** + * string appId = 1; + */ + fun clearAppId() { + _builder.clearAppId() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.copy(block: pl.leancode.automatorserver.contracts.AirplaneModeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest = + pl.leancode.automatorserver.contracts.AirplaneModeRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() + diff --git a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/BluetoothRequestKt.kt b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/BluetoothRequestKt.kt new file mode 100644 index 000000000..c34f55049 --- /dev/null +++ b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/BluetoothRequestKt.kt @@ -0,0 +1,46 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: contracts.proto + +package pl.leancode.automatorserver.contracts; + +@kotlin.jvm.JvmName("-initializebluetoothRequest") +inline fun bluetoothRequest(block: pl.leancode.automatorserver.contracts.BluetoothRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest = + pl.leancode.automatorserver.contracts.BluetoothRequestKt.Dsl._create(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.newBuilder()).apply { block() }._build() +object BluetoothRequestKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest = _builder.build() + + /** + * string appId = 1; + */ + var appId: kotlin.String + @JvmName("getAppId") + get() = _builder.getAppId() + @JvmName("setAppId") + set(value) { + _builder.setAppId(value) + } + /** + * string appId = 1; + */ + fun clearAppId() { + _builder.clearAppId() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.copy(block: pl.leancode.automatorserver.contracts.BluetoothRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest = + pl.leancode.automatorserver.contracts.BluetoothRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() + diff --git a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/Contracts.java b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/Contracts.java index 1a3cc9c38..5a172dc4b 100644 --- a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/Contracts.java +++ b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/Contracts.java @@ -2265,8 +2265,1148 @@ public pl.leancode.automatorserver.contracts.Contracts.OpenQuickSettingsRequest } - public interface DarkModeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DarkModeRequest) + public interface AirplaneModeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:patrol.AirplaneModeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string appId = 1; + * @return The appId. + */ + java.lang.String getAppId(); + /** + * string appId = 1; + * @return The bytes for appId. + */ + com.google.protobuf.ByteString + getAppIdBytes(); + } + /** + * Protobuf type {@code patrol.AirplaneModeRequest} + */ + public static final class AirplaneModeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:patrol.AirplaneModeRequest) + AirplaneModeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AirplaneModeRequest.newBuilder() to construct. + private AirplaneModeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AirplaneModeRequest() { + appId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AirplaneModeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AirplaneModeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_AirplaneModeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_AirplaneModeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.class, pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.Builder.class); + } + + public static final int APPID_FIELD_NUMBER = 1; + private volatile java.lang.Object appId_; + /** + * string appId = 1; + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + * string appId = 1; + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, appId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, appId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest)) { + return super.equals(obj); + } + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest other = (pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest) obj; + + if (!getAppId() + .equals(other.getAppId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + APPID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code patrol.AirplaneModeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:patrol.AirplaneModeRequest) + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_AirplaneModeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_AirplaneModeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.class, pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.Builder.class); + } + + // Construct using pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + appId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_AirplaneModeRequest_descriptor; + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest getDefaultInstanceForType() { + return pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.getDefaultInstance(); + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest build() { + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest buildPartial() { + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest result = new pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest(this); + result.appId_ = appId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest) { + return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest other) { + if (other == pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.getDefaultInstance()) return this; + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object appId_ = ""; + /** + * string appId = 1; + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string appId = 1; + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string appId = 1; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + * string appId = 1; + * @return This builder for chaining. + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + * string appId = 1; + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:patrol.AirplaneModeRequest) + } + + // @@protoc_insertion_point(class_scope:patrol.AirplaneModeRequest) + private static final pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest(); + } + + public static pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AirplaneModeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AirplaneModeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CellularRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:patrol.CellularRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string appId = 1; + * @return The appId. + */ + java.lang.String getAppId(); + /** + * string appId = 1; + * @return The bytes for appId. + */ + com.google.protobuf.ByteString + getAppIdBytes(); + } + /** + * Protobuf type {@code patrol.CellularRequest} + */ + public static final class CellularRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:patrol.CellularRequest) + CellularRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CellularRequest.newBuilder() to construct. + private CellularRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CellularRequest() { + appId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CellularRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CellularRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pl.leancode.automatorserver.contracts.Contracts.CellularRequest.class, pl.leancode.automatorserver.contracts.Contracts.CellularRequest.Builder.class); + } + + public static final int APPID_FIELD_NUMBER = 1; + private volatile java.lang.Object appId_; + /** + * string appId = 1; + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + * string appId = 1; + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, appId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, appId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.CellularRequest)) { + return super.equals(obj); + } + pl.leancode.automatorserver.contracts.Contracts.CellularRequest other = (pl.leancode.automatorserver.contracts.Contracts.CellularRequest) obj; + + if (!getAppId() + .equals(other.getAppId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + APPID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.CellularRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code patrol.CellularRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:patrol.CellularRequest) + pl.leancode.automatorserver.contracts.Contracts.CellularRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pl.leancode.automatorserver.contracts.Contracts.CellularRequest.class, pl.leancode.automatorserver.contracts.Contracts.CellularRequest.Builder.class); + } + + // Construct using pl.leancode.automatorserver.contracts.Contracts.CellularRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + appId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_descriptor; + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.CellularRequest getDefaultInstanceForType() { + return pl.leancode.automatorserver.contracts.Contracts.CellularRequest.getDefaultInstance(); + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.CellularRequest build() { + pl.leancode.automatorserver.contracts.Contracts.CellularRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.CellularRequest buildPartial() { + pl.leancode.automatorserver.contracts.Contracts.CellularRequest result = new pl.leancode.automatorserver.contracts.Contracts.CellularRequest(this); + result.appId_ = appId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof pl.leancode.automatorserver.contracts.Contracts.CellularRequest) { + return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.CellularRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.CellularRequest other) { + if (other == pl.leancode.automatorserver.contracts.Contracts.CellularRequest.getDefaultInstance()) return this; + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + pl.leancode.automatorserver.contracts.Contracts.CellularRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.CellularRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object appId_ = ""; + /** + * string appId = 1; + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string appId = 1; + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string appId = 1; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + * string appId = 1; + * @return This builder for chaining. + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + * string appId = 1; + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:patrol.CellularRequest) + } + + // @@protoc_insertion_point(class_scope:patrol.CellularRequest) + private static final pl.leancode.automatorserver.contracts.Contracts.CellularRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.CellularRequest(); + } + + public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CellularRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CellularRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public pl.leancode.automatorserver.contracts.Contracts.CellularRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WiFiRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:patrol.WiFiRequest) com.google.protobuf.MessageOrBuilder { /** @@ -2282,18 +3422,18 @@ public interface DarkModeRequestOrBuilder extends getAppIdBytes(); } /** - * Protobuf type {@code patrol.DarkModeRequest} + * Protobuf type {@code patrol.WiFiRequest} */ - public static final class DarkModeRequest extends + public static final class WiFiRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:patrol.DarkModeRequest) - DarkModeRequestOrBuilder { + // @@protoc_insertion_point(message_implements:patrol.WiFiRequest) + WiFiRequestOrBuilder { private static final long serialVersionUID = 0L; - // Use DarkModeRequest.newBuilder() to construct. - private DarkModeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use WiFiRequest.newBuilder() to construct. + private WiFiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DarkModeRequest() { + private WiFiRequest() { appId_ = ""; } @@ -2301,7 +3441,7 @@ private DarkModeRequest() { @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DarkModeRequest(); + return new WiFiRequest(); } @java.lang.Override @@ -2309,7 +3449,7 @@ protected java.lang.Object newInstance( getUnknownFields() { return this.unknownFields; } - private DarkModeRequest( + private WiFiRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2356,15 +3496,15 @@ private DarkModeRequest( } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_fieldAccessorTable + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.Builder.class); + pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.class, pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.Builder.class); } public static final int APPID_FIELD_NUMBER = 1; @@ -2444,10 +3584,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest)) { + if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.WiFiRequest)) { return super.equals(obj); } - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest other = (pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) obj; + pl.leancode.automatorserver.contracts.Contracts.WiFiRequest other = (pl.leancode.automatorserver.contracts.Contracts.WiFiRequest) obj; if (!getAppId() .equals(other.getAppId())) return false; @@ -2469,69 +3609,69 @@ public int hashCode() { return hash; } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom(byte[] data) + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom(java.io.InputStream input) + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseDelimitedFrom(java.io.InputStream input) + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseDelimitedFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2544,7 +3684,7 @@ public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest pa public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest prototype) { + public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.WiFiRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2560,26 +3700,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code patrol.DarkModeRequest} + * Protobuf type {@code patrol.WiFiRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:patrol.DarkModeRequest) - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequestOrBuilder { + // @@protoc_insertion_point(builder_implements:patrol.WiFiRequest) + pl.leancode.automatorserver.contracts.Contracts.WiFiRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_fieldAccessorTable + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.Builder.class); + pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.class, pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.Builder.class); } - // Construct using pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.newBuilder() + // Construct using pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2605,17 +3745,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_descriptor; } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest getDefaultInstanceForType() { - return pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance(); + public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest getDefaultInstanceForType() { + return pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.getDefaultInstance(); } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest build() { - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest result = buildPartial(); + public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest build() { + pl.leancode.automatorserver.contracts.Contracts.WiFiRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2623,8 +3763,8 @@ public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest build() { } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest buildPartial() { - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest result = new pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest(this); + public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest buildPartial() { + pl.leancode.automatorserver.contracts.Contracts.WiFiRequest result = new pl.leancode.automatorserver.contracts.Contracts.WiFiRequest(this); result.appId_ = appId_; onBuilt(); return result; @@ -2664,16 +3804,16 @@ public Builder addRepeatedField( } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) { - return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest)other); + if (other instanceof pl.leancode.automatorserver.contracts.Contracts.WiFiRequest) { + return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.WiFiRequest)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest other) { - if (other == pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance()) return this; + public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.WiFiRequest other) { + if (other == pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.getDefaultInstance()) return this; if (!other.getAppId().isEmpty()) { appId_ = other.appId_; onChanged(); @@ -2693,11 +3833,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parsedMessage = null; + pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) e.getUnfinishedMessage(); + parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.WiFiRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -2795,48 +3935,48 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:patrol.DarkModeRequest) + // @@protoc_insertion_point(builder_scope:patrol.WiFiRequest) } - // @@protoc_insertion_point(class_scope:patrol.DarkModeRequest) - private static final pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:patrol.WiFiRequest) + private static final pl.leancode.automatorserver.contracts.Contracts.WiFiRequest DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest(); + DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.WiFiRequest(); } - public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest getDefaultInstance() { + public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DarkModeRequest parsePartialFrom( + public WiFiRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DarkModeRequest(input, extensionRegistry); + return new WiFiRequest(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest getDefaultInstanceForType() { + public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface WiFiRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.WiFiRequest) + public interface BluetoothRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:patrol.BluetoothRequest) com.google.protobuf.MessageOrBuilder { /** @@ -2852,18 +3992,18 @@ public interface WiFiRequestOrBuilder extends getAppIdBytes(); } /** - * Protobuf type {@code patrol.WiFiRequest} + * Protobuf type {@code patrol.BluetoothRequest} */ - public static final class WiFiRequest extends + public static final class BluetoothRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:patrol.WiFiRequest) - WiFiRequestOrBuilder { + // @@protoc_insertion_point(message_implements:patrol.BluetoothRequest) + BluetoothRequestOrBuilder { private static final long serialVersionUID = 0L; - // Use WiFiRequest.newBuilder() to construct. - private WiFiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use BluetoothRequest.newBuilder() to construct. + private BluetoothRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private WiFiRequest() { + private BluetoothRequest() { appId_ = ""; } @@ -2871,7 +4011,7 @@ private WiFiRequest() { @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new WiFiRequest(); + return new BluetoothRequest(); } @java.lang.Override @@ -2879,7 +4019,7 @@ protected java.lang.Object newInstance( getUnknownFields() { return this.unknownFields; } - private WiFiRequest( + private BluetoothRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2926,15 +4066,15 @@ private WiFiRequest( } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_BluetoothRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_fieldAccessorTable + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_BluetoothRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.class, pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.Builder.class); + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.class, pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.Builder.class); } public static final int APPID_FIELD_NUMBER = 1; @@ -3014,10 +4154,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.WiFiRequest)) { + if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest)) { return super.equals(obj); } - pl.leancode.automatorserver.contracts.Contracts.WiFiRequest other = (pl.leancode.automatorserver.contracts.Contracts.WiFiRequest) obj; + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest other = (pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest) obj; if (!getAppId() .equals(other.getAppId())) return false; @@ -3039,69 +4179,69 @@ public int hashCode() { return hash; } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom(byte[] data) + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom(java.io.InputStream input) + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseDelimitedFrom(java.io.InputStream input) + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseDelimitedFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3114,7 +4254,7 @@ public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parseF public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.WiFiRequest prototype) { + public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3130,26 +4270,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code patrol.WiFiRequest} + * Protobuf type {@code patrol.BluetoothRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:patrol.WiFiRequest) - pl.leancode.automatorserver.contracts.Contracts.WiFiRequestOrBuilder { + // @@protoc_insertion_point(builder_implements:patrol.BluetoothRequest) + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_BluetoothRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_fieldAccessorTable + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_BluetoothRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.class, pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.Builder.class); + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.class, pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.Builder.class); } - // Construct using pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.newBuilder() + // Construct using pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3175,17 +4315,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_WiFiRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_BluetoothRequest_descriptor; } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest getDefaultInstanceForType() { - return pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.getDefaultInstance(); + public pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest getDefaultInstanceForType() { + return pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.getDefaultInstance(); } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest build() { - pl.leancode.automatorserver.contracts.Contracts.WiFiRequest result = buildPartial(); + public pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest build() { + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3193,8 +4333,8 @@ public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest build() { } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest buildPartial() { - pl.leancode.automatorserver.contracts.Contracts.WiFiRequest result = new pl.leancode.automatorserver.contracts.Contracts.WiFiRequest(this); + public pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest buildPartial() { + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest result = new pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest(this); result.appId_ = appId_; onBuilt(); return result; @@ -3234,16 +4374,16 @@ public Builder addRepeatedField( } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof pl.leancode.automatorserver.contracts.Contracts.WiFiRequest) { - return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.WiFiRequest)other); + if (other instanceof pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest) { + return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.WiFiRequest other) { - if (other == pl.leancode.automatorserver.contracts.Contracts.WiFiRequest.getDefaultInstance()) return this; + public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest other) { + if (other == pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.getDefaultInstance()) return this; if (!other.getAppId().isEmpty()) { appId_ = other.appId_; onChanged(); @@ -3263,11 +4403,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - pl.leancode.automatorserver.contracts.Contracts.WiFiRequest parsedMessage = null; + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.WiFiRequest) e.getUnfinishedMessage(); + parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -3365,48 +4505,48 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:patrol.WiFiRequest) + // @@protoc_insertion_point(builder_scope:patrol.BluetoothRequest) } - // @@protoc_insertion_point(class_scope:patrol.WiFiRequest) - private static final pl.leancode.automatorserver.contracts.Contracts.WiFiRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:patrol.BluetoothRequest) + private static final pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.WiFiRequest(); + DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest(); } - public static pl.leancode.automatorserver.contracts.Contracts.WiFiRequest getDefaultInstance() { + public static pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public WiFiRequest parsePartialFrom( + public BluetoothRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new WiFiRequest(input, extensionRegistry); + return new BluetoothRequest(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.WiFiRequest getDefaultInstanceForType() { + public pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface CellularRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.CellularRequest) + public interface DarkModeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:patrol.DarkModeRequest) com.google.protobuf.MessageOrBuilder { /** @@ -3422,18 +4562,18 @@ public interface CellularRequestOrBuilder extends getAppIdBytes(); } /** - * Protobuf type {@code patrol.CellularRequest} + * Protobuf type {@code patrol.DarkModeRequest} */ - public static final class CellularRequest extends + public static final class DarkModeRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:patrol.CellularRequest) - CellularRequestOrBuilder { + // @@protoc_insertion_point(message_implements:patrol.DarkModeRequest) + DarkModeRequestOrBuilder { private static final long serialVersionUID = 0L; - // Use CellularRequest.newBuilder() to construct. - private CellularRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use DarkModeRequest.newBuilder() to construct. + private DarkModeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private CellularRequest() { + private DarkModeRequest() { appId_ = ""; } @@ -3441,7 +4581,7 @@ private CellularRequest() { @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new CellularRequest(); + return new DarkModeRequest(); } @java.lang.Override @@ -3449,7 +4589,7 @@ protected java.lang.Object newInstance( getUnknownFields() { return this.unknownFields; } - private CellularRequest( + private DarkModeRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3496,15 +4636,15 @@ private CellularRequest( } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_fieldAccessorTable + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - pl.leancode.automatorserver.contracts.Contracts.CellularRequest.class, pl.leancode.automatorserver.contracts.Contracts.CellularRequest.Builder.class); + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.Builder.class); } public static final int APPID_FIELD_NUMBER = 1; @@ -3584,10 +4724,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.CellularRequest)) { + if (!(obj instanceof pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest)) { return super.equals(obj); } - pl.leancode.automatorserver.contracts.Contracts.CellularRequest other = (pl.leancode.automatorserver.contracts.Contracts.CellularRequest) obj; + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest other = (pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) obj; if (!getAppId() .equals(other.getAppId())) return false; @@ -3609,69 +4749,69 @@ public int hashCode() { return hash; } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom(byte[] data) + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom(java.io.InputStream input) + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseDelimitedFrom(java.io.InputStream input) + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseDelimitedFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest parseFrom( + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3684,7 +4824,7 @@ public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest pa public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.CellularRequest prototype) { + public static Builder newBuilder(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3700,26 +4840,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code patrol.CellularRequest} + * Protobuf type {@code patrol.DarkModeRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:patrol.CellularRequest) - pl.leancode.automatorserver.contracts.Contracts.CellularRequestOrBuilder { + // @@protoc_insertion_point(builder_implements:patrol.DarkModeRequest) + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_fieldAccessorTable + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - pl.leancode.automatorserver.contracts.Contracts.CellularRequest.class, pl.leancode.automatorserver.contracts.Contracts.CellularRequest.Builder.class); + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.Builder.class); } - // Construct using pl.leancode.automatorserver.contracts.Contracts.CellularRequest.newBuilder() + // Construct using pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3745,17 +4885,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_CellularRequest_descriptor; + return pl.leancode.automatorserver.contracts.Contracts.internal_static_patrol_DarkModeRequest_descriptor; } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.CellularRequest getDefaultInstanceForType() { - return pl.leancode.automatorserver.contracts.Contracts.CellularRequest.getDefaultInstance(); + public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest getDefaultInstanceForType() { + return pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance(); } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.CellularRequest build() { - pl.leancode.automatorserver.contracts.Contracts.CellularRequest result = buildPartial(); + public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest build() { + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3763,8 +4903,8 @@ public pl.leancode.automatorserver.contracts.Contracts.CellularRequest build() { } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.CellularRequest buildPartial() { - pl.leancode.automatorserver.contracts.Contracts.CellularRequest result = new pl.leancode.automatorserver.contracts.Contracts.CellularRequest(this); + public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest buildPartial() { + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest result = new pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest(this); result.appId_ = appId_; onBuilt(); return result; @@ -3804,16 +4944,16 @@ public Builder addRepeatedField( } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof pl.leancode.automatorserver.contracts.Contracts.CellularRequest) { - return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.CellularRequest)other); + if (other instanceof pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) { + return mergeFrom((pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.CellularRequest other) { - if (other == pl.leancode.automatorserver.contracts.Contracts.CellularRequest.getDefaultInstance()) return this; + public Builder mergeFrom(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest other) { + if (other == pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance()) return this; if (!other.getAppId().isEmpty()) { appId_ = other.appId_; onChanged(); @@ -3833,11 +4973,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - pl.leancode.automatorserver.contracts.Contracts.CellularRequest parsedMessage = null; + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.CellularRequest) e.getUnfinishedMessage(); + parsedMessage = (pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -3935,41 +5075,41 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:patrol.CellularRequest) + // @@protoc_insertion_point(builder_scope:patrol.DarkModeRequest) } - // @@protoc_insertion_point(class_scope:patrol.CellularRequest) - private static final pl.leancode.automatorserver.contracts.Contracts.CellularRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:patrol.DarkModeRequest) + private static final pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.CellularRequest(); + DEFAULT_INSTANCE = new pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest(); } - public static pl.leancode.automatorserver.contracts.Contracts.CellularRequest getDefaultInstance() { + public static pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public CellularRequest parsePartialFrom( + public DarkModeRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CellularRequest(input, extensionRegistry); + return new DarkModeRequest(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public pl.leancode.automatorserver.contracts.Contracts.CellularRequest getDefaultInstanceForType() { + public pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -15600,20 +16740,30 @@ public pl.leancode.automatorserver.contracts.Contracts.Notification getDefaultIn com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_patrol_OpenQuickSettingsRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_patrol_DarkModeRequest_descriptor; + internal_static_patrol_AirplaneModeRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_patrol_DarkModeRequest_fieldAccessorTable; + internal_static_patrol_AirplaneModeRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_patrol_CellularRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_patrol_CellularRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_patrol_WiFiRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_patrol_WiFiRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_patrol_CellularRequest_descriptor; + internal_static_patrol_BluetoothRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_patrol_CellularRequest_fieldAccessorTable; + internal_static_patrol_BluetoothRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_patrol_DarkModeRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_patrol_DarkModeRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_patrol_GetNativeWidgetsRequest_descriptor; private static final @@ -15687,86 +16837,94 @@ public pl.leancode.automatorserver.contracts.Contracts.Notification getDefaultIn "est\022\r\n\005appId\030\001 \001(\t\"[\n\030TapOnNotificationR" + "equest\022\017\n\005index\030\001 \001(\rH\000\022$\n\010selector\030\002 \001(" + "\0132\020.patrol.SelectorH\000B\010\n\006findBy\"\007\n\005Empty" + - "\"\032\n\030OpenQuickSettingsRequest\" \n\017DarkMode" + - "Request\022\r\n\005appId\030\001 \001(\t\"\034\n\013WiFiRequest\022\r\n" + - "\005appId\030\001 \001(\t\" \n\017CellularRequest\022\r\n\005appId" + - "\030\001 \001(\t\"=\n\027GetNativeWidgetsRequest\022\"\n\010sel" + - "ector\030\001 \001(\0132\020.patrol.Selector\"G\n\030GetNati" + - "veWidgetsResponse\022+\n\rnativeWidgets\030\001 \003(\013" + - "2\024.patrol.NativeWidget\"\031\n\027GetNotificatio" + - "nsRequest\"G\n\030GetNotificationsResponse\022+\n" + - "\rnotifications\030\001 \003(\0132\024.patrol.Notificati" + - "on\"?\n\nTapRequest\022\"\n\010Selector\030\001 \001(\0132\020.pat" + - "rol.Selector\022\r\n\005appId\030\002 \001(\t\"p\n\020EnterText" + - "Request\022\014\n\004data\030\001 \001(\t\022\r\n\005appId\030\002 \001(\t\022\017\n\005" + - "index\030\003 \001(\rH\000\022$\n\010selector\030\004 \001(\0132\020.patrol" + - ".SelectorH\000B\010\n\006findBy\"Y\n\014SwipeRequest\022\016\n" + - "\006startX\030\001 \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 " + - "\001(\002\022\014\n\004endY\030\004 \001(\002\022\r\n\005steps\030\005 \001(\r\"\206\001\n\027Han" + - "dlePermissionRequest\0222\n\004code\030\001 \001(\0162$.pat" + - "rol.HandlePermissionRequest.Code\"7\n\004Code" + - "\022\017\n\013WHILE_USING\020\000\022\022\n\016ONLY_THIS_TIME\020\001\022\n\n" + - "\006DENIED\020\002\"\225\001\n\032SetLocationAccuracyRequest" + - "\022M\n\020locationAccuracy\030\001 \001(\01623.patrol.SetL" + - "ocationAccuracyRequest.LocationAccuracy\"" + - "(\n\020LocationAccuracy\022\n\n\006COARSE\020\000\022\010\n\004FINE\020" + - "\001\"\236\004\n\010Selector\022\021\n\004text\030\001 \001(\tH\000\210\001\001\022\033\n\016tex" + - "tStartsWith\030\002 \001(\tH\001\210\001\001\022\031\n\014textContains\030\003" + - " \001(\tH\002\210\001\001\022\026\n\tclassName\030\004 \001(\tH\003\210\001\001\022\037\n\022con" + - "tentDescription\030\005 \001(\tH\004\210\001\001\022)\n\034contentDes" + - "criptionStartsWith\030\006 \001(\tH\005\210\001\001\022\'\n\032content" + - "DescriptionContains\030\007 \001(\tH\006\210\001\001\022\027\n\nresour" + - "ceId\030\010 \001(\tH\007\210\001\001\022\025\n\010instance\030\t \001(\rH\010\210\001\001\022\024" + - "\n\007enabled\030\n \001(\010H\t\210\001\001\022\024\n\007focused\030\013 \001(\010H\n\210" + - "\001\001\022\020\n\003pkg\030\014 \001(\tH\013\210\001\001B\007\n\005_textB\021\n\017_textSt" + - "artsWithB\017\n\r_textContainsB\014\n\n_classNameB" + - "\025\n\023_contentDescriptionB\037\n\035_contentDescri" + - "ptionStartsWithB\035\n\033_contentDescriptionCo" + - "ntainsB\r\n\013_resourceIdB\013\n\t_instanceB\n\n\010_e" + - "nabledB\n\n\010_focusedB\006\n\004_pkg\"\333\001\n\014NativeWid" + - "get\022\021\n\tclassName\030\001 \001(\t\022\014\n\004text\030\002 \001(\t\022\032\n\022" + - "contentDescription\030\003 \001(\t\022\017\n\007focused\030\004 \001(" + - "\010\022\017\n\007enabled\030\005 \001(\010\022\022\n\nchildCount\030\006 \001(\005\022\024" + - "\n\014resourceName\030\007 \001(\t\022\032\n\022applicationPacka" + - "ge\030\010 \001(\t\022&\n\010children\030\t \003(\0132\024.patrol.Nati" + - "veWidget\"P\n\014Notification\022\024\n\007appName\030\001 \001(" + - "\tH\000\210\001\001\022\r\n\005title\030\002 \001(\t\022\017\n\007content\030\003 \001(\tB\n" + - "\n\010_appName2\273\n\n\017NativeAutomator\022+\n\tpressH" + - "ome\022\r.patrol.Empty\032\r.patrol.Empty\"\000\022+\n\tp" + - "ressBack\022\r.patrol.Empty\032\r.patrol.Empty\"\000" + - "\0221\n\017pressRecentApps\022\r.patrol.Empty\032\r.pat" + - "rol.Empty\"\000\0227\n\025doublePressRecentApps\022\r.p" + - "atrol.Empty\032\r.patrol.Empty\"\000\0222\n\007openApp\022" + - "\026.patrol.OpenAppRequest\032\r.patrol.Empty\"\000" + - "\0223\n\021openNotifications\022\r.patrol.Empty\032\r.p" + - "atrol.Empty\"\000\022F\n\021openQuickSettings\022 .pat" + - "rol.OpenQuickSettingsRequest\032\r.patrol.Em" + - "pty\"\000\022:\n\016enableDarkMode\022\027.patrol.DarkMod" + - "eRequest\032\r.patrol.Empty\"\000\022;\n\017disableDark" + - "Mode\022\027.patrol.DarkModeRequest\032\r.patrol.E" + - "mpty\"\000\0222\n\nenableWiFi\022\023.patrol.WiFiReques" + - "t\032\r.patrol.Empty\"\000\0223\n\013disableWiFi\022\023.patr" + - "ol.WiFiRequest\032\r.patrol.Empty\"\000\022:\n\016enabl" + - "eCellular\022\027.patrol.CellularRequest\032\r.pat" + - "rol.Empty\"\000\022;\n\017disableCellular\022\027.patrol." + - "CellularRequest\032\r.patrol.Empty\"\000\022W\n\020getN" + - "ativeWidgets\022\037.patrol.GetNativeWidgetsRe" + - "quest\032 .patrol.GetNativeWidgetsResponse\"" + - "\000\022W\n\020getNotifications\022\037.patrol.GetNotifi" + - "cationsRequest\032 .patrol.GetNotifications" + - "Response\"\000\022*\n\003tap\022\022.patrol.TapRequest\032\r." + - "patrol.Empty\"\000\0220\n\tdoubleTap\022\022.patrol.Tap" + - "Request\032\r.patrol.Empty\"\000\0226\n\tenterText\022\030." + - "patrol.EnterTextRequest\032\r.patrol.Empty\"\000" + - "\022.\n\005swipe\022\024.patrol.SwipeRequest\032\r.patrol" + - ".Empty\"\000\022J\n\026handlePermissionDialog\022\037.pat" + - "rol.HandlePermissionRequest\032\r.patrol.Emp" + - "ty\"\000\022J\n\023setLocationAccuracy\022\".patrol.Set" + - "LocationAccuracyRequest\032\r.patrol.Empty\"\000" + - "\022F\n\021tapOnNotification\022 .patrol.TapOnNoti" + - "ficationRequest\032\r.patrol.Empty\"\000B\'\n%pl.l" + - "eancode.automatorserver.contractsb\006proto" + - "3" + "\"\032\n\030OpenQuickSettingsRequest\"$\n\023Airplane" + + "ModeRequest\022\r\n\005appId\030\001 \001(\t\" \n\017CellularRe" + + "quest\022\r\n\005appId\030\001 \001(\t\"\034\n\013WiFiRequest\022\r\n\005a" + + "ppId\030\001 \001(\t\"!\n\020BluetoothRequest\022\r\n\005appId\030" + + "\001 \001(\t\" \n\017DarkModeRequest\022\r\n\005appId\030\001 \001(\t\"" + + "=\n\027GetNativeWidgetsRequest\022\"\n\010selector\030\001" + + " \001(\0132\020.patrol.Selector\"G\n\030GetNativeWidge" + + "tsResponse\022+\n\rnativeWidgets\030\001 \003(\0132\024.patr" + + "ol.NativeWidget\"\031\n\027GetNotificationsReque" + + "st\"G\n\030GetNotificationsResponse\022+\n\rnotifi" + + "cations\030\001 \003(\0132\024.patrol.Notification\"?\n\nT" + + "apRequest\022\"\n\010Selector\030\001 \001(\0132\020.patrol.Sel" + + "ector\022\r\n\005appId\030\002 \001(\t\"p\n\020EnterTextRequest" + + "\022\014\n\004data\030\001 \001(\t\022\r\n\005appId\030\002 \001(\t\022\017\n\005index\030\003" + + " \001(\rH\000\022$\n\010selector\030\004 \001(\0132\020.patrol.Select" + + "orH\000B\010\n\006findBy\"Y\n\014SwipeRequest\022\016\n\006startX" + + "\030\001 \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 \001(\002\022\014\n\004" + + "endY\030\004 \001(\002\022\r\n\005steps\030\005 \001(\r\"\206\001\n\027HandlePerm" + + "issionRequest\0222\n\004code\030\001 \001(\0162$.patrol.Han" + + "dlePermissionRequest.Code\"7\n\004Code\022\017\n\013WHI" + + "LE_USING\020\000\022\022\n\016ONLY_THIS_TIME\020\001\022\n\n\006DENIED" + + "\020\002\"\225\001\n\032SetLocationAccuracyRequest\022M\n\020loc" + + "ationAccuracy\030\001 \001(\01623.patrol.SetLocation" + + "AccuracyRequest.LocationAccuracy\"(\n\020Loca" + + "tionAccuracy\022\n\n\006COARSE\020\000\022\010\n\004FINE\020\001\"\236\004\n\010S" + + "elector\022\021\n\004text\030\001 \001(\tH\000\210\001\001\022\033\n\016textStarts" + + "With\030\002 \001(\tH\001\210\001\001\022\031\n\014textContains\030\003 \001(\tH\002\210" + + "\001\001\022\026\n\tclassName\030\004 \001(\tH\003\210\001\001\022\037\n\022contentDes" + + "cription\030\005 \001(\tH\004\210\001\001\022)\n\034contentDescriptio" + + "nStartsWith\030\006 \001(\tH\005\210\001\001\022\'\n\032contentDescrip" + + "tionContains\030\007 \001(\tH\006\210\001\001\022\027\n\nresourceId\030\010 " + + "\001(\tH\007\210\001\001\022\025\n\010instance\030\t \001(\rH\010\210\001\001\022\024\n\007enabl" + + "ed\030\n \001(\010H\t\210\001\001\022\024\n\007focused\030\013 \001(\010H\n\210\001\001\022\020\n\003p" + + "kg\030\014 \001(\tH\013\210\001\001B\007\n\005_textB\021\n\017_textStartsWit" + + "hB\017\n\r_textContainsB\014\n\n_classNameB\025\n\023_con" + + "tentDescriptionB\037\n\035_contentDescriptionSt" + + "artsWithB\035\n\033_contentDescriptionContainsB" + + "\r\n\013_resourceIdB\013\n\t_instanceB\n\n\010_enabledB" + + "\n\n\010_focusedB\006\n\004_pkg\"\333\001\n\014NativeWidget\022\021\n\t" + + "className\030\001 \001(\t\022\014\n\004text\030\002 \001(\t\022\032\n\022content" + + "Description\030\003 \001(\t\022\017\n\007focused\030\004 \001(\010\022\017\n\007en" + + "abled\030\005 \001(\010\022\022\n\nchildCount\030\006 \001(\005\022\024\n\014resou" + + "rceName\030\007 \001(\t\022\032\n\022applicationPackage\030\010 \001(" + + "\t\022&\n\010children\030\t \003(\0132\024.patrol.NativeWidge" + + "t\"P\n\014Notification\022\024\n\007appName\030\001 \001(\tH\000\210\001\001\022" + + "\r\n\005title\030\002 \001(\t\022\017\n\007content\030\003 \001(\tB\n\n\010_appN" + + "ame2\301\014\n\017NativeAutomator\022+\n\tpressHome\022\r.p" + + "atrol.Empty\032\r.patrol.Empty\"\000\022+\n\tpressBac" + + "k\022\r.patrol.Empty\032\r.patrol.Empty\"\000\0221\n\017pre" + + "ssRecentApps\022\r.patrol.Empty\032\r.patrol.Emp" + + "ty\"\000\0227\n\025doublePressRecentApps\022\r.patrol.E" + + "mpty\032\r.patrol.Empty\"\000\0222\n\007openApp\022\026.patro" + + "l.OpenAppRequest\032\r.patrol.Empty\"\000\0223\n\021ope" + + "nNotifications\022\r.patrol.Empty\032\r.patrol.E" + + "mpty\"\000\022F\n\021openQuickSettings\022 .patrol.Ope" + + "nQuickSettingsRequest\032\r.patrol.Empty\"\000\022B" + + "\n\022enableAirplaneMode\022\033.patrol.AirplaneMo" + + "deRequest\032\r.patrol.Empty\"\000\022C\n\023disableAir" + + "planeMode\022\033.patrol.AirplaneModeRequest\032\r" + + ".patrol.Empty\"\000\0222\n\nenableWiFi\022\023.patrol.W" + + "iFiRequest\032\r.patrol.Empty\"\000\0223\n\013disableWi" + + "Fi\022\023.patrol.WiFiRequest\032\r.patrol.Empty\"\000" + + "\022:\n\016enableCellular\022\027.patrol.CellularRequ" + + "est\032\r.patrol.Empty\"\000\022;\n\017disableCellular\022" + + "\027.patrol.CellularRequest\032\r.patrol.Empty\"" + + "\000\022<\n\017enableBluetooth\022\030.patrol.BluetoothR" + + "equest\032\r.patrol.Empty\"\000\022=\n\020disableBlueto" + + "oth\022\030.patrol.BluetoothRequest\032\r.patrol.E" + + "mpty\"\000\022:\n\016enableDarkMode\022\027.patrol.DarkMo" + + "deRequest\032\r.patrol.Empty\"\000\022;\n\017disableDar" + + "kMode\022\027.patrol.DarkModeRequest\032\r.patrol." + + "Empty\"\000\022W\n\020getNativeWidgets\022\037.patrol.Get" + + "NativeWidgetsRequest\032 .patrol.GetNativeW" + + "idgetsResponse\"\000\022W\n\020getNotifications\022\037.p" + + "atrol.GetNotificationsRequest\032 .patrol.G" + + "etNotificationsResponse\"\000\022*\n\003tap\022\022.patro" + + "l.TapRequest\032\r.patrol.Empty\"\000\0220\n\tdoubleT" + + "ap\022\022.patrol.TapRequest\032\r.patrol.Empty\"\000\022" + + "6\n\tenterText\022\030.patrol.EnterTextRequest\032\r" + + ".patrol.Empty\"\000\022.\n\005swipe\022\024.patrol.SwipeR" + + "equest\032\r.patrol.Empty\"\000\022J\n\026handlePermiss" + + "ionDialog\022\037.patrol.HandlePermissionReque" + + "st\032\r.patrol.Empty\"\000\022J\n\023setLocationAccura" + + "cy\022\".patrol.SetLocationAccuracyRequest\032\r" + + ".patrol.Empty\"\000\022F\n\021tapOnNotification\022 .p" + + "atrol.TapOnNotificationRequest\032\r.patrol." + + "Empty\"\000B\'\n%pl.leancode.automatorserver.c" + + "ontractsb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -15796,92 +16954,104 @@ public pl.leancode.automatorserver.contracts.Contracts.Notification getDefaultIn com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_OpenQuickSettingsRequest_descriptor, new java.lang.String[] { }); - internal_static_patrol_DarkModeRequest_descriptor = + internal_static_patrol_AirplaneModeRequest_descriptor = getDescriptor().getMessageTypes().get(4); - internal_static_patrol_DarkModeRequest_fieldAccessorTable = new + internal_static_patrol_AirplaneModeRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_patrol_DarkModeRequest_descriptor, + internal_static_patrol_AirplaneModeRequest_descriptor, new java.lang.String[] { "AppId", }); - internal_static_patrol_WiFiRequest_descriptor = + internal_static_patrol_CellularRequest_descriptor = getDescriptor().getMessageTypes().get(5); + internal_static_patrol_CellularRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_patrol_CellularRequest_descriptor, + new java.lang.String[] { "AppId", }); + internal_static_patrol_WiFiRequest_descriptor = + getDescriptor().getMessageTypes().get(6); internal_static_patrol_WiFiRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_WiFiRequest_descriptor, new java.lang.String[] { "AppId", }); - internal_static_patrol_CellularRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_patrol_CellularRequest_fieldAccessorTable = new + internal_static_patrol_BluetoothRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_patrol_BluetoothRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_patrol_CellularRequest_descriptor, + internal_static_patrol_BluetoothRequest_descriptor, + new java.lang.String[] { "AppId", }); + internal_static_patrol_DarkModeRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_patrol_DarkModeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_patrol_DarkModeRequest_descriptor, new java.lang.String[] { "AppId", }); internal_static_patrol_GetNativeWidgetsRequest_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(9); internal_static_patrol_GetNativeWidgetsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_GetNativeWidgetsRequest_descriptor, new java.lang.String[] { "Selector", }); internal_static_patrol_GetNativeWidgetsResponse_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(10); internal_static_patrol_GetNativeWidgetsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_GetNativeWidgetsResponse_descriptor, new java.lang.String[] { "NativeWidgets", }); internal_static_patrol_GetNotificationsRequest_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_patrol_GetNotificationsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_GetNotificationsRequest_descriptor, new java.lang.String[] { }); internal_static_patrol_GetNotificationsResponse_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_patrol_GetNotificationsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_GetNotificationsResponse_descriptor, new java.lang.String[] { "Notifications", }); internal_static_patrol_TapRequest_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_patrol_TapRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_TapRequest_descriptor, new java.lang.String[] { "Selector", "AppId", }); internal_static_patrol_EnterTextRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_patrol_EnterTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_EnterTextRequest_descriptor, new java.lang.String[] { "Data", "AppId", "Index", "Selector", "FindBy", }); internal_static_patrol_SwipeRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_patrol_SwipeRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_SwipeRequest_descriptor, new java.lang.String[] { "StartX", "StartY", "EndX", "EndY", "Steps", }); internal_static_patrol_HandlePermissionRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_patrol_HandlePermissionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_HandlePermissionRequest_descriptor, new java.lang.String[] { "Code", }); internal_static_patrol_SetLocationAccuracyRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_patrol_SetLocationAccuracyRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_SetLocationAccuracyRequest_descriptor, new java.lang.String[] { "LocationAccuracy", }); internal_static_patrol_Selector_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(18); internal_static_patrol_Selector_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_Selector_descriptor, new java.lang.String[] { "Text", "TextStartsWith", "TextContains", "ClassName", "ContentDescription", "ContentDescriptionStartsWith", "ContentDescriptionContains", "ResourceId", "Instance", "Enabled", "Focused", "Pkg", "Text", "TextStartsWith", "TextContains", "ClassName", "ContentDescription", "ContentDescriptionStartsWith", "ContentDescriptionContains", "ResourceId", "Instance", "Enabled", "Focused", "Pkg", }); internal_static_patrol_NativeWidget_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(19); internal_static_patrol_NativeWidget_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_NativeWidget_descriptor, new java.lang.String[] { "ClassName", "Text", "ContentDescription", "Focused", "Enabled", "ChildCount", "ResourceName", "ApplicationPackage", "Children", }); internal_static_patrol_Notification_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(20); internal_static_patrol_Notification_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_patrol_Notification_descriptor, diff --git a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/ContractsGrpcKt.kt b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/ContractsGrpcKt.kt index 1b6146ea7..beef38f06 100644 --- a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/ContractsGrpcKt.kt +++ b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/ContractsGrpcKt.kt @@ -64,13 +64,15 @@ public object NativeAutomatorGrpcKt { @JvmStatic get() = NativeAutomatorGrpc.getOpenQuickSettingsMethod() - public val enableDarkModeMethod: MethodDescriptor + public val enableAirplaneModeMethod: + MethodDescriptor @JvmStatic - get() = NativeAutomatorGrpc.getEnableDarkModeMethod() + get() = NativeAutomatorGrpc.getEnableAirplaneModeMethod() - public val disableDarkModeMethod: MethodDescriptor + public val disableAirplaneModeMethod: + MethodDescriptor @JvmStatic - get() = NativeAutomatorGrpc.getDisableDarkModeMethod() + get() = NativeAutomatorGrpc.getDisableAirplaneModeMethod() public val enableWiFiMethod: MethodDescriptor @JvmStatic @@ -88,6 +90,22 @@ public object NativeAutomatorGrpcKt { @JvmStatic get() = NativeAutomatorGrpc.getDisableCellularMethod() + public val enableBluetoothMethod: MethodDescriptor + @JvmStatic + get() = NativeAutomatorGrpc.getEnableBluetoothMethod() + + public val disableBluetoothMethod: MethodDescriptor + @JvmStatic + get() = NativeAutomatorGrpc.getDisableBluetoothMethod() + + public val enableDarkModeMethod: MethodDescriptor + @JvmStatic + get() = NativeAutomatorGrpc.getEnableDarkModeMethod() + + public val disableDarkModeMethod: MethodDescriptor + @JvmStatic + get() = NativeAutomatorGrpc.getDisableDarkModeMethod() + public val getNativeWidgetsMethod: MethodDescriptor @JvmStatic @@ -299,10 +317,10 @@ public object NativeAutomatorGrpcKt { * * @return The single response from the server. */ - public suspend fun enableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( + public suspend fun enableAirplaneMode(request: Contracts.AirplaneModeRequest, headers: Metadata + = Metadata()): Contracts.Empty = unaryRpc( channel, - NativeAutomatorGrpc.getEnableDarkModeMethod(), + NativeAutomatorGrpc.getEnableAirplaneModeMethod(), request, callOptions, headers @@ -320,10 +338,10 @@ public object NativeAutomatorGrpcKt { * * @return The single response from the server. */ - public suspend fun disableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( + public suspend fun disableAirplaneMode(request: Contracts.AirplaneModeRequest, headers: Metadata + = Metadata()): Contracts.Empty = unaryRpc( channel, - NativeAutomatorGrpc.getDisableDarkModeMethod(), + NativeAutomatorGrpc.getDisableAirplaneModeMethod(), request, callOptions, headers @@ -413,6 +431,90 @@ public object NativeAutomatorGrpcKt { headers ) + /** + * Executes this RPC and returns the response message, suspending until the RPC completes + * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding + * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled + * with the corresponding exception as a cause. + * + * @param request The request message to send to the server. + * + * @param headers Metadata to attach to the request. Most users will not need this. + * + * @return The single response from the server. + */ + public suspend fun enableBluetooth(request: Contracts.BluetoothRequest, headers: Metadata = + Metadata()): Contracts.Empty = unaryRpc( + channel, + NativeAutomatorGrpc.getEnableBluetoothMethod(), + request, + callOptions, + headers + ) + + /** + * Executes this RPC and returns the response message, suspending until the RPC completes + * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding + * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled + * with the corresponding exception as a cause. + * + * @param request The request message to send to the server. + * + * @param headers Metadata to attach to the request. Most users will not need this. + * + * @return The single response from the server. + */ + public suspend fun disableBluetooth(request: Contracts.BluetoothRequest, headers: Metadata = + Metadata()): Contracts.Empty = unaryRpc( + channel, + NativeAutomatorGrpc.getDisableBluetoothMethod(), + request, + callOptions, + headers + ) + + /** + * Executes this RPC and returns the response message, suspending until the RPC completes + * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding + * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled + * with the corresponding exception as a cause. + * + * @param request The request message to send to the server. + * + * @param headers Metadata to attach to the request. Most users will not need this. + * + * @return The single response from the server. + */ + public suspend fun enableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = + Metadata()): Contracts.Empty = unaryRpc( + channel, + NativeAutomatorGrpc.getEnableDarkModeMethod(), + request, + callOptions, + headers + ) + + /** + * Executes this RPC and returns the response message, suspending until the RPC completes + * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding + * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled + * with the corresponding exception as a cause. + * + * @param request The request message to send to the server. + * + * @param headers Metadata to attach to the request. Most users will not need this. + * + * @return The single response from the server. + */ + public suspend fun disableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = + Metadata()): Contracts.Empty = unaryRpc( + channel, + NativeAutomatorGrpc.getDisableDarkModeMethod(), + request, + callOptions, + headers + ) + /** * Executes this RPC and returns the response message, suspending until the RPC completes * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding @@ -709,7 +811,7 @@ public object NativeAutomatorGrpcKt { StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.openQuickSettings is unimplemented")) /** - * Returns the response to an RPC for patrol.NativeAutomator.enableDarkMode. + * Returns the response to an RPC for patrol.NativeAutomator.enableAirplaneMode. * * If this method fails with a [StatusException], the RPC will fail with the corresponding * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC @@ -719,12 +821,12 @@ public object NativeAutomatorGrpcKt { * * @param request The request from the client. */ - public open suspend fun enableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableDarkMode is unimplemented")) + public open suspend fun enableAirplaneMode(request: Contracts.AirplaneModeRequest): + Contracts.Empty = throw + StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableAirplaneMode is unimplemented")) /** - * Returns the response to an RPC for patrol.NativeAutomator.disableDarkMode. + * Returns the response to an RPC for patrol.NativeAutomator.disableAirplaneMode. * * If this method fails with a [StatusException], the RPC will fail with the corresponding * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC @@ -734,9 +836,9 @@ public object NativeAutomatorGrpcKt { * * @param request The request from the client. */ - public open suspend fun disableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableDarkMode is unimplemented")) + public open suspend fun disableAirplaneMode(request: Contracts.AirplaneModeRequest): + Contracts.Empty = throw + StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableAirplaneMode is unimplemented")) /** * Returns the response to an RPC for patrol.NativeAutomator.enableWiFi. @@ -796,6 +898,66 @@ public object NativeAutomatorGrpcKt { throw StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableCellular is unimplemented")) + /** + * Returns the response to an RPC for patrol.NativeAutomator.enableBluetooth. + * + * If this method fails with a [StatusException], the RPC will fail with the corresponding + * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC + * will fail + * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will + * fail with `Status.UNKNOWN` with the exception as a cause. + * + * @param request The request from the client. + */ + public open suspend fun enableBluetooth(request: Contracts.BluetoothRequest): Contracts.Empty = + throw + StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableBluetooth is unimplemented")) + + /** + * Returns the response to an RPC for patrol.NativeAutomator.disableBluetooth. + * + * If this method fails with a [StatusException], the RPC will fail with the corresponding + * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC + * will fail + * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will + * fail with `Status.UNKNOWN` with the exception as a cause. + * + * @param request The request from the client. + */ + public open suspend fun disableBluetooth(request: Contracts.BluetoothRequest): Contracts.Empty = + throw + StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableBluetooth is unimplemented")) + + /** + * Returns the response to an RPC for patrol.NativeAutomator.enableDarkMode. + * + * If this method fails with a [StatusException], the RPC will fail with the corresponding + * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC + * will fail + * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will + * fail with `Status.UNKNOWN` with the exception as a cause. + * + * @param request The request from the client. + */ + public open suspend fun enableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = + throw + StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableDarkMode is unimplemented")) + + /** + * Returns the response to an RPC for patrol.NativeAutomator.disableDarkMode. + * + * If this method fails with a [StatusException], the RPC will fail with the corresponding + * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC + * will fail + * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will + * fail with `Status.UNKNOWN` with the exception as a cause. + * + * @param request The request from the client. + */ + public open suspend fun disableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = + throw + StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableDarkMode is unimplemented")) + /** * Returns the response to an RPC for patrol.NativeAutomator.getNativeWidgets. * @@ -966,13 +1128,13 @@ public object NativeAutomatorGrpcKt { )) .addMethod(unaryServerMethodDefinition( context = this.context, - descriptor = NativeAutomatorGrpc.getEnableDarkModeMethod(), - implementation = ::enableDarkMode + descriptor = NativeAutomatorGrpc.getEnableAirplaneModeMethod(), + implementation = ::enableAirplaneMode )) .addMethod(unaryServerMethodDefinition( context = this.context, - descriptor = NativeAutomatorGrpc.getDisableDarkModeMethod(), - implementation = ::disableDarkMode + descriptor = NativeAutomatorGrpc.getDisableAirplaneModeMethod(), + implementation = ::disableAirplaneMode )) .addMethod(unaryServerMethodDefinition( context = this.context, @@ -993,6 +1155,26 @@ public object NativeAutomatorGrpcKt { context = this.context, descriptor = NativeAutomatorGrpc.getDisableCellularMethod(), implementation = ::disableCellular + )) + .addMethod(unaryServerMethodDefinition( + context = this.context, + descriptor = NativeAutomatorGrpc.getEnableBluetoothMethod(), + implementation = ::enableBluetooth + )) + .addMethod(unaryServerMethodDefinition( + context = this.context, + descriptor = NativeAutomatorGrpc.getDisableBluetoothMethod(), + implementation = ::disableBluetooth + )) + .addMethod(unaryServerMethodDefinition( + context = this.context, + descriptor = NativeAutomatorGrpc.getEnableDarkModeMethod(), + implementation = ::enableDarkMode + )) + .addMethod(unaryServerMethodDefinition( + context = this.context, + descriptor = NativeAutomatorGrpc.getDisableDarkModeMethod(), + implementation = ::disableDarkMode )) .addMethod(unaryServerMethodDefinition( context = this.context, diff --git a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/NativeAutomatorGrpc.java b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/NativeAutomatorGrpc.java index fec19c609..7c0b5d3a7 100644 --- a/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/NativeAutomatorGrpc.java +++ b/AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/contracts/NativeAutomatorGrpc.java @@ -235,66 +235,66 @@ pl.leancode.automatorserver.contracts.Contracts.Empty> getOpenQuickSettingsMetho return getOpenQuickSettingsMethod; } - private static volatile io.grpc.MethodDescriptor getEnableDarkModeMethod; + private static volatile io.grpc.MethodDescriptor getEnableAirplaneModeMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableDarkMode", - requestType = pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, + fullMethodName = SERVICE_NAME + '/' + "enableAirplaneMode", + requestType = pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.class, responseType = pl.leancode.automatorserver.contracts.Contracts.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableDarkModeMethod() { - io.grpc.MethodDescriptor getEnableDarkModeMethod; - if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { + public static io.grpc.MethodDescriptor getEnableAirplaneModeMethod() { + io.grpc.MethodDescriptor getEnableAirplaneModeMethod; + if ((getEnableAirplaneModeMethod = NativeAutomatorGrpc.getEnableAirplaneModeMethod) == null) { synchronized (NativeAutomatorGrpc.class) { - if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { - NativeAutomatorGrpc.getEnableDarkModeMethod = getEnableDarkModeMethod = - io.grpc.MethodDescriptor.newBuilder() + if ((getEnableAirplaneModeMethod = NativeAutomatorGrpc.getEnableAirplaneModeMethod) == null) { + NativeAutomatorGrpc.getEnableAirplaneModeMethod = getEnableAirplaneModeMethod = + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableDarkMode")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableAirplaneMode")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance())) + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( pl.leancode.automatorserver.contracts.Contracts.Empty.getDefaultInstance())) - .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("enableDarkMode")) + .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("enableAirplaneMode")) .build(); } } } - return getEnableDarkModeMethod; + return getEnableAirplaneModeMethod; } - private static volatile io.grpc.MethodDescriptor getDisableDarkModeMethod; + private static volatile io.grpc.MethodDescriptor getDisableAirplaneModeMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableDarkMode", - requestType = pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, + fullMethodName = SERVICE_NAME + '/' + "disableAirplaneMode", + requestType = pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.class, responseType = pl.leancode.automatorserver.contracts.Contracts.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableDarkModeMethod() { - io.grpc.MethodDescriptor getDisableDarkModeMethod; - if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { + public static io.grpc.MethodDescriptor getDisableAirplaneModeMethod() { + io.grpc.MethodDescriptor getDisableAirplaneModeMethod; + if ((getDisableAirplaneModeMethod = NativeAutomatorGrpc.getDisableAirplaneModeMethod) == null) { synchronized (NativeAutomatorGrpc.class) { - if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { - NativeAutomatorGrpc.getDisableDarkModeMethod = getDisableDarkModeMethod = - io.grpc.MethodDescriptor.newBuilder() + if ((getDisableAirplaneModeMethod = NativeAutomatorGrpc.getDisableAirplaneModeMethod) == null) { + NativeAutomatorGrpc.getDisableAirplaneModeMethod = getDisableAirplaneModeMethod = + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableDarkMode")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableAirplaneMode")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance())) + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( pl.leancode.automatorserver.contracts.Contracts.Empty.getDefaultInstance())) - .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("disableDarkMode")) + .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("disableAirplaneMode")) .build(); } } } - return getDisableDarkModeMethod; + return getDisableAirplaneModeMethod; } private static volatile io.grpc.MethodDescriptor getDisableCellularMethod( return getDisableCellularMethod; } + private static volatile io.grpc.MethodDescriptor getEnableBluetoothMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "enableBluetooth", + requestType = pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.class, + responseType = pl.leancode.automatorserver.contracts.Contracts.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEnableBluetoothMethod() { + io.grpc.MethodDescriptor getEnableBluetoothMethod; + if ((getEnableBluetoothMethod = NativeAutomatorGrpc.getEnableBluetoothMethod) == null) { + synchronized (NativeAutomatorGrpc.class) { + if ((getEnableBluetoothMethod = NativeAutomatorGrpc.getEnableBluetoothMethod) == null) { + NativeAutomatorGrpc.getEnableBluetoothMethod = getEnableBluetoothMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableBluetooth")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.Empty.getDefaultInstance())) + .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("enableBluetooth")) + .build(); + } + } + } + return getEnableBluetoothMethod; + } + + private static volatile io.grpc.MethodDescriptor getDisableBluetoothMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "disableBluetooth", + requestType = pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.class, + responseType = pl.leancode.automatorserver.contracts.Contracts.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDisableBluetoothMethod() { + io.grpc.MethodDescriptor getDisableBluetoothMethod; + if ((getDisableBluetoothMethod = NativeAutomatorGrpc.getDisableBluetoothMethod) == null) { + synchronized (NativeAutomatorGrpc.class) { + if ((getDisableBluetoothMethod = NativeAutomatorGrpc.getDisableBluetoothMethod) == null) { + NativeAutomatorGrpc.getDisableBluetoothMethod = getDisableBluetoothMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableBluetooth")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.Empty.getDefaultInstance())) + .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("disableBluetooth")) + .build(); + } + } + } + return getDisableBluetoothMethod; + } + + private static volatile io.grpc.MethodDescriptor getEnableDarkModeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "enableDarkMode", + requestType = pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, + responseType = pl.leancode.automatorserver.contracts.Contracts.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEnableDarkModeMethod() { + io.grpc.MethodDescriptor getEnableDarkModeMethod; + if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { + synchronized (NativeAutomatorGrpc.class) { + if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { + NativeAutomatorGrpc.getEnableDarkModeMethod = getEnableDarkModeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableDarkMode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.Empty.getDefaultInstance())) + .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("enableDarkMode")) + .build(); + } + } + } + return getEnableDarkModeMethod; + } + + private static volatile io.grpc.MethodDescriptor getDisableDarkModeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "disableDarkMode", + requestType = pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.class, + responseType = pl.leancode.automatorserver.contracts.Contracts.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDisableDarkModeMethod() { + io.grpc.MethodDescriptor getDisableDarkModeMethod; + if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { + synchronized (NativeAutomatorGrpc.class) { + if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { + NativeAutomatorGrpc.getDisableDarkModeMethod = getDisableDarkModeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableDarkMode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pl.leancode.automatorserver.contracts.Contracts.Empty.getDefaultInstance())) + .setSchemaDescriptor(new NativeAutomatorMethodDescriptorSupplier("disableDarkMode")) + .build(); + } + } + } + return getDisableDarkModeMethod; + } + private static volatile io.grpc.MethodDescriptor getGetNativeWidgetsMethod; @@ -801,17 +925,20 @@ public void openQuickSettings(pl.leancode.automatorserver.contracts.Contracts.Op } /** + *
+     * services
+     * 
*/ - public void enableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + public void enableAirplaneMode(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request, io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableDarkModeMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableAirplaneModeMethod(), responseObserver); } /** */ - public void disableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + public void disableAirplaneMode(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request, io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableDarkModeMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableAirplaneModeMethod(), responseObserver); } /** @@ -842,6 +969,34 @@ public void disableCellular(pl.leancode.automatorserver.contracts.Contracts.Cell io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableCellularMethod(), responseObserver); } + /** + */ + public void enableBluetooth(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableBluetoothMethod(), responseObserver); + } + + /** + */ + public void disableBluetooth(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableBluetoothMethod(), responseObserver); + } + + /** + */ + public void enableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableDarkModeMethod(), responseObserver); + } + + /** + */ + public void disableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableDarkModeMethod(), responseObserver); + } + /** */ public void getNativeWidgets(pl.leancode.automatorserver.contracts.Contracts.GetNativeWidgetsRequest request, @@ -957,19 +1112,19 @@ public void tapOnNotification(pl.leancode.automatorserver.contracts.Contracts.Ta pl.leancode.automatorserver.contracts.Contracts.Empty>( this, METHODID_OPEN_QUICK_SETTINGS))) .addMethod( - getEnableDarkModeMethod(), + getEnableAirplaneModeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest, + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest, pl.leancode.automatorserver.contracts.Contracts.Empty>( - this, METHODID_ENABLE_DARK_MODE))) + this, METHODID_ENABLE_AIRPLANE_MODE))) .addMethod( - getDisableDarkModeMethod(), + getDisableAirplaneModeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest, + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest, pl.leancode.automatorserver.contracts.Contracts.Empty>( - this, METHODID_DISABLE_DARK_MODE))) + this, METHODID_DISABLE_AIRPLANE_MODE))) .addMethod( getEnableWiFiMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -998,6 +1153,34 @@ public void tapOnNotification(pl.leancode.automatorserver.contracts.Contracts.Ta pl.leancode.automatorserver.contracts.Contracts.CellularRequest, pl.leancode.automatorserver.contracts.Contracts.Empty>( this, METHODID_DISABLE_CELLULAR))) + .addMethod( + getEnableBluetoothMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest, + pl.leancode.automatorserver.contracts.Contracts.Empty>( + this, METHODID_ENABLE_BLUETOOTH))) + .addMethod( + getDisableBluetoothMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest, + pl.leancode.automatorserver.contracts.Contracts.Empty>( + this, METHODID_DISABLE_BLUETOOTH))) + .addMethod( + getEnableDarkModeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest, + pl.leancode.automatorserver.contracts.Contracts.Empty>( + this, METHODID_ENABLE_DARK_MODE))) + .addMethod( + getDisableDarkModeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest, + pl.leancode.automatorserver.contracts.Contracts.Empty>( + this, METHODID_DISABLE_DARK_MODE))) .addMethod( getGetNativeWidgetsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -1139,19 +1322,22 @@ public void openQuickSettings(pl.leancode.automatorserver.contracts.Contracts.Op } /** + *
+     * services
+     * 
*/ - public void enableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + public void enableAirplaneMode(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getEnableAirplaneModeMethod(), getCallOptions()), request, responseObserver); } /** */ - public void disableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + public void disableAirplaneMode(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getDisableAirplaneModeMethod(), getCallOptions()), request, responseObserver); } /** @@ -1186,6 +1372,38 @@ public void disableCellular(pl.leancode.automatorserver.contracts.Contracts.Cell getChannel().newCall(getDisableCellularMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void enableBluetooth(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEnableBluetoothMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void disableBluetooth(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDisableBluetoothMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void enableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void disableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void getNativeWidgets(pl.leancode.automatorserver.contracts.Contracts.GetNativeWidgetsRequest request, @@ -1326,17 +1544,20 @@ public pl.leancode.automatorserver.contracts.Contracts.Empty openQuickSettings(p } /** + *
+     * services
+     * 
*/ - public pl.leancode.automatorserver.contracts.Contracts.Empty enableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + public pl.leancode.automatorserver.contracts.Contracts.Empty enableAirplaneMode(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableDarkModeMethod(), getCallOptions(), request); + getChannel(), getEnableAirplaneModeMethod(), getCallOptions(), request); } /** */ - public pl.leancode.automatorserver.contracts.Contracts.Empty disableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + public pl.leancode.automatorserver.contracts.Contracts.Empty disableAirplaneMode(pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableDarkModeMethod(), getCallOptions(), request); + getChannel(), getDisableAirplaneModeMethod(), getCallOptions(), request); } /** @@ -1367,6 +1588,34 @@ public pl.leancode.automatorserver.contracts.Contracts.Empty disableCellular(pl. getChannel(), getDisableCellularMethod(), getCallOptions(), request); } + /** + */ + public pl.leancode.automatorserver.contracts.Contracts.Empty enableBluetooth(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEnableBluetoothMethod(), getCallOptions(), request); + } + + /** + */ + public pl.leancode.automatorserver.contracts.Contracts.Empty disableBluetooth(pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDisableBluetoothMethod(), getCallOptions(), request); + } + + /** + */ + public pl.leancode.automatorserver.contracts.Contracts.Empty enableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEnableDarkModeMethod(), getCallOptions(), request); + } + + /** + */ + public pl.leancode.automatorserver.contracts.Contracts.Empty disableDarkMode(pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDisableDarkModeMethod(), getCallOptions(), request); + } + /** */ public pl.leancode.automatorserver.contracts.Contracts.GetNativeWidgetsResponse getNativeWidgets(pl.leancode.automatorserver.contracts.Contracts.GetNativeWidgetsRequest request) { @@ -1505,19 +1754,22 @@ public com.google.common.util.concurrent.ListenableFuture + * services + * */ - public com.google.common.util.concurrent.ListenableFuture enableDarkMode( - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + public com.google.common.util.concurrent.ListenableFuture enableAirplaneMode( + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request); + getChannel().newCall(getEnableAirplaneModeMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture disableDarkMode( - pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + public com.google.common.util.concurrent.ListenableFuture disableAirplaneMode( + pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request); + getChannel().newCall(getDisableAirplaneModeMethod(), getCallOptions()), request); } /** @@ -1552,6 +1804,38 @@ public com.google.common.util.concurrent.ListenableFuture enableBluetooth( + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEnableBluetoothMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture disableBluetooth( + pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDisableBluetoothMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture enableDarkMode( + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture disableDarkMode( + pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture getNativeWidgets( @@ -1632,21 +1916,25 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1693,12 +1981,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.openQuickSettings((pl.leancode.automatorserver.contracts.Contracts.OpenQuickSettingsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_ENABLE_DARK_MODE: - serviceImpl.enableDarkMode((pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) request, + case METHODID_ENABLE_AIRPLANE_MODE: + serviceImpl.enableAirplaneMode((pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_DISABLE_DARK_MODE: - serviceImpl.disableDarkMode((pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) request, + case METHODID_DISABLE_AIRPLANE_MODE: + serviceImpl.disableAirplaneMode((pl.leancode.automatorserver.contracts.Contracts.AirplaneModeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_ENABLE_WI_FI: @@ -1717,6 +2005,22 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.disableCellular((pl.leancode.automatorserver.contracts.Contracts.CellularRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_ENABLE_BLUETOOTH: + serviceImpl.enableBluetooth((pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DISABLE_BLUETOOTH: + serviceImpl.disableBluetooth((pl.leancode.automatorserver.contracts.Contracts.BluetoothRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ENABLE_DARK_MODE: + serviceImpl.enableDarkMode((pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DISABLE_DARK_MODE: + serviceImpl.disableDarkMode((pl.leancode.automatorserver.contracts.Contracts.DarkModeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_GET_NATIVE_WIDGETS: serviceImpl.getNativeWidgets((pl.leancode.automatorserver.contracts.Contracts.GetNativeWidgetsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -1821,12 +2125,16 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getOpenAppMethod()) .addMethod(getOpenNotificationsMethod()) .addMethod(getOpenQuickSettingsMethod()) - .addMethod(getEnableDarkModeMethod()) - .addMethod(getDisableDarkModeMethod()) + .addMethod(getEnableAirplaneModeMethod()) + .addMethod(getDisableAirplaneModeMethod()) .addMethod(getEnableWiFiMethod()) .addMethod(getDisableWiFiMethod()) .addMethod(getEnableCellularMethod()) .addMethod(getDisableCellularMethod()) + .addMethod(getEnableBluetoothMethod()) + .addMethod(getDisableBluetoothMethod()) + .addMethod(getEnableDarkModeMethod()) + .addMethod(getDisableDarkModeMethod()) .addMethod(getGetNativeWidgetsMethod()) .addMethod(getGetNotificationsMethod()) .addMethod(getTapMethod()) diff --git a/AutomatorServer/ios/AutomatorServerUITests/NativeAutomatorServer.swift b/AutomatorServer/ios/AutomatorServerUITests/NativeAutomatorServer.swift index 9abe35a8c..60e8daf01 100644 --- a/AutomatorServer/ios/AutomatorServerUITests/NativeAutomatorServer.swift +++ b/AutomatorServer/ios/AutomatorServerUITests/NativeAutomatorServer.swift @@ -54,7 +54,8 @@ final class NativeAutomatorServer: Patrol_NativeAutomatorAsyncProvider { request: Patrol_OpenQuickSettingsRequest, context: GRPCAsyncServerCallContext ) async throws -> Empty { - throw PatrolError.generic("openQuickSettings() is not supported on iOS") + automation.openControlCenter() + return Empty() } func enableDarkMode( @@ -73,19 +74,19 @@ final class NativeAutomatorServer: Patrol_NativeAutomatorAsyncProvider { return Empty() } - func enableWiFi( - request: Patrol_WiFiRequest, + func enableAirplaneMode( + request: Patrol_AirplaneModeRequest, context: GRPCAsyncServerCallContext - ) async throws -> Empty { - automation.enableWiFi(request.appID) + ) async throws -> Patrol_Empty { + try automation.enableAirplaneMode(request.appID) return Empty() } - func disableWiFi( - request: Patrol_WiFiRequest, + func disableAirplaneMode( + request: Patrol_AirplaneModeRequest, context: GRPCAsyncServerCallContext - ) async throws -> Empty { - automation.disableWiFi(request.appID) + ) async throws -> Patrol_Empty { + try automation.disableAirplaneMode(request.appID) return Empty() } @@ -105,6 +106,38 @@ final class NativeAutomatorServer: Patrol_NativeAutomatorAsyncProvider { return Empty() } + func enableWiFi( + request: Patrol_WiFiRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Empty { + try automation.enableWiFi(request.appID) + return Empty() + } + + func disableWiFi( + request: Patrol_WiFiRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Empty { + try automation.disableWiFi(request.appID) + return Empty() + } + + func enableBluetooth( + request: Patrol_BluetoothRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Patrol_Empty { + try automation.enableBluetooth(request.appID) + return Empty() + } + + func disableBluetooth( + request: Patrol_BluetoothRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Patrol_Empty { + try automation.disableBluetooth(request.appID) + return Empty() + } + func getNativeWidgets( request: Patrol_GetNativeWidgetsRequest, context: GRPCAsyncServerCallContext diff --git a/AutomatorServer/ios/AutomatorServerUITests/PatrolAutomation.swift b/AutomatorServer/ios/AutomatorServerUITests/PatrolAutomation.swift index 37308c41c..c8c33ee8b 100644 --- a/AutomatorServer/ios/AutomatorServerUITests/PatrolAutomation.swift +++ b/AutomatorServer/ios/AutomatorServerUITests/PatrolAutomation.swift @@ -6,10 +6,6 @@ struct NativeWidget: Codable { } class PatrolAutomation { - private lazy var app: XCUIApplication = { - return XCUIApplication() - }() - private lazy var device: XCUIDevice = { return XCUIDevice.shared }() @@ -42,6 +38,16 @@ class PatrolAutomation { swipeStart.press(forDuration: 0.1, thenDragTo: swipeEnd) } } + + func openControlCenter() { + // FIXME: implement for iPhones without notch + + runAction("opening control center") { + let start = self.springboard.coordinate(withNormalizedOffset: CGVector(dx: 0.9, dy: 0.01)) + let end = self.springboard.coordinate(withNormalizedOffset: CGVector(dx: 0.9, dy: 0.2)) + start.press(forDuration: 0.1, thenDragTo: end) + } + } func enableDarkMode(_ bundleIdentifier: String) { runSettingsAction("enabling dark mode", bundleIdentifier) { @@ -74,51 +80,78 @@ class PatrolAutomation { #endif } } - - func enableWiFi(_ bundleIdentifier: String) { - runSettingsAction("enabling wifi", bundleIdentifier) { - self.preferences.descendants(matching: .any)["Wi-Fi"].firstMatch.tap() - let value = self.preferences.switches.firstMatch.value! as! String - if value == "0" { - self.preferences.switches.firstMatch.tap() + + // MARK: Services + + func enableAirplaneMode(_ bundleIdentifier: String) throws { + try runControlCenterAction("enabling airplane mode") { + let toggle = self.springboard.switches["airplane-mode-button"] + if toggle.value! as! String == "0" { + toggle.tap() } } } - - func disableWiFi(_ bundleIdentifier: String) { - runSettingsAction("disabling wifi", bundleIdentifier) { - self.preferences.descendants(matching: .any)["Wi-Fi"].firstMatch.tap() - let value = self.preferences.switches.firstMatch.value! as! String - if value == "1" { - self.preferences.switches.firstMatch.tap() + + func disableAirplaneMode(_ bundleIdentifier: String) throws { + try runControlCenterAction("disabling airplane mode") { + let toggle = self.springboard.switches["airplane-mode-button"] + if toggle.value! as! String == "1" { + toggle.tap() } } } + func enableCellular(_ bundleIdentifier: String) throws { - #if targetEnvironment(simulator) - throw PatrolError.generic("cellular is not supported on simulator") - #endif - - runSettingsAction("enabling cellular", bundleIdentifier) { - self.preferences.descendants(matching: .any)["Cellular"].firstMatch.tap() - let value = self.preferences.switches.firstMatch.value! as! String - if value == "0" { - self.preferences.switches.firstMatch.tap() + try runControlCenterAction("enabling cellular") { + let toggle = self.springboard.switches["cellular-data-button"] + if toggle.value! as! String == "0" { + toggle.tap() } } } func disableCellular(_ bundleIdentifier: String) throws { - #if targetEnvironment(simulator) - throw PatrolError.generic("cellular is not supported on simulator") - #endif - - runSettingsAction("disabling cellular", bundleIdentifier) { - self.preferences.descendants(matching: .any)["Cellular"].firstMatch.tap() - let value = self.preferences.switches.firstMatch.value! as! String - if value == "1" { - self.preferences.switches.firstMatch.tap() + try runControlCenterAction("disabling cellular") { + let toggle = self.springboard.switches["cellular-data-button"] + if toggle.value! as! String == "1" { + toggle.tap() + } + } + } + + func enableWiFi(_ bundleIdentifier: String) throws { + try runControlCenterAction("enabling wifi") { + let toggle = self.springboard.switches["wifi-button"] + if toggle.value! as! String == "0" { + toggle.tap() + } + } + } + + func disableWiFi(_ bundleIdentifier: String) throws { + try runControlCenterAction("disabling wifi") { + let toggle = self.springboard.switches["wifi-button"] + if toggle.value! as! String == "1" { + toggle.tap() + } + } + } + + func enableBluetooth(_ bundleIdentifier: String) throws { + try runControlCenterAction("enabling bluetooth") { + let toggle = self.springboard.switches["bluetooth-button"] + if toggle.value! as! String == "0" { + toggle.tap() + } + } + } + + func disableBluetooth(_ bundleIdentifier: String) throws { + try runControlCenterAction("disabling bluetooth") { + let toggle = self.springboard.switches["bluetooth-button"] + if toggle.value! as! String == "1" { + toggle.tap() } } } @@ -219,6 +252,34 @@ class PatrolAutomation { } } + private func runControlCenterAction(_ log: String,block: @escaping () -> Void) throws { + #if targetEnvironment(simulator) + throw PatrolError.generic("Control Center is not available on Simulator") + #endif + + runAction(log) { + self.openControlCenter() + + // perform the action + block() + + // hide control center + let empty = self.springboard.coordinate(withNormalizedOffset: CGVector(dx: 0.9, dy: 0.1)) + empty.tap() + } + } + + func getNativeWidgets() throws { + // TODO: Remove later + for i in 0...10 { + let toggle = self.springboard.switches.element(boundBy: i) + let label = toggle.label as String + let accLabel = toggle.accessibilityLabel as String? + let ident = toggle.identifier + Logger.shared.i("index: \(i), label: \(label), accLabel: \(String(describing: accLabel)), ident: \(ident)") + } + } + private func runSettingsAction( _ log: String, _ bundleIdentifier: String, diff --git a/AutomatorServer/ios/AutomatorServerUITests/contracts.grpc.swift b/AutomatorServer/ios/AutomatorServerUITests/contracts.grpc.swift index 3bb7ee65c..edc4be213 100644 --- a/AutomatorServer/ios/AutomatorServerUITests/contracts.grpc.swift +++ b/AutomatorServer/ios/AutomatorServerUITests/contracts.grpc.swift @@ -68,15 +68,15 @@ internal protocol Patrol_NativeAutomatorClientProtocol: GRPCClient { callOptions: CallOptions? ) -> UnaryCall - func enableDarkMode( - _ request: Patrol_DarkModeRequest, + func enableAirplaneMode( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? - ) -> UnaryCall + ) -> UnaryCall - func disableDarkMode( - _ request: Patrol_DarkModeRequest, + func disableAirplaneMode( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? - ) -> UnaryCall + ) -> UnaryCall func enableWiFi( _ request: Patrol_WiFiRequest, @@ -98,6 +98,26 @@ internal protocol Patrol_NativeAutomatorClientProtocol: GRPCClient { callOptions: CallOptions? ) -> UnaryCall + func enableBluetooth( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func disableBluetooth( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func enableDarkMode( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? + ) -> UnaryCall + + func disableDarkMode( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? + ) -> UnaryCall + func getNativeWidgets( _ request: Patrol_GetNativeWidgetsRequest, callOptions: CallOptions? @@ -275,39 +295,39 @@ extension Patrol_NativeAutomatorClientProtocol { ) } - /// Unary call to enableDarkMode + /// services /// /// - Parameters: - /// - request: Request to send to enableDarkMode. + /// - request: Request to send to enableAirplaneMode. /// - callOptions: Call options. /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableDarkMode( - _ request: Patrol_DarkModeRequest, + internal func enableAirplaneMode( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? = nil - ) -> UnaryCall { + ) -> UnaryCall { return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, + path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, request: request, callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] + interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] ) } - /// Unary call to disableDarkMode + /// Unary call to disableAirplaneMode /// /// - Parameters: - /// - request: Request to send to disableDarkMode. + /// - request: Request to send to disableAirplaneMode. /// - callOptions: Call options. /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableDarkMode( - _ request: Patrol_DarkModeRequest, + internal func disableAirplaneMode( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? = nil - ) -> UnaryCall { + ) -> UnaryCall { return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, + path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, request: request, callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] + interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] ) } @@ -383,6 +403,78 @@ extension Patrol_NativeAutomatorClientProtocol { ) } + /// Unary call to enableBluetooth + /// + /// - Parameters: + /// - request: Request to send to enableBluetooth. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func enableBluetooth( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] + ) + } + + /// Unary call to disableBluetooth + /// + /// - Parameters: + /// - request: Request to send to disableBluetooth. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func disableBluetooth( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] + ) + } + + /// Unary call to enableDarkMode + /// + /// - Parameters: + /// - request: Request to send to enableDarkMode. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func enableDarkMode( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] + ) + } + + /// Unary call to disableDarkMode + /// + /// - Parameters: + /// - request: Request to send to disableDarkMode. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + internal func disableDarkMode( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] + ) + } + /// Unary call to getNativeWidgets /// /// - Parameters: @@ -647,15 +739,15 @@ internal protocol Patrol_NativeAutomatorAsyncClientProtocol: GRPCClient { callOptions: CallOptions? ) -> GRPCAsyncUnaryCall - func makeEnableDarkModeCall( - _ request: Patrol_DarkModeRequest, + func makeEnableAirplaneModeCall( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + ) -> GRPCAsyncUnaryCall - func makeDisableDarkModeCall( - _ request: Patrol_DarkModeRequest, + func makeDisableAirplaneModeCall( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + ) -> GRPCAsyncUnaryCall func makeEnableWiFiCall( _ request: Patrol_WiFiRequest, @@ -677,6 +769,26 @@ internal protocol Patrol_NativeAutomatorAsyncClientProtocol: GRPCClient { callOptions: CallOptions? ) -> GRPCAsyncUnaryCall + func makeEnableBluetoothCall( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? + ) -> GRPCAsyncUnaryCall + + func makeDisableBluetoothCall( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? + ) -> GRPCAsyncUnaryCall + + func makeEnableDarkModeCall( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? + ) -> GRPCAsyncUnaryCall + + func makeDisableDarkModeCall( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? + ) -> GRPCAsyncUnaryCall + func makeGetNativeWidgetsCall( _ request: Patrol_GetNativeWidgetsRequest, callOptions: CallOptions? @@ -817,27 +929,27 @@ extension Patrol_NativeAutomatorAsyncClientProtocol { ) } - internal func makeEnableDarkModeCall( - _ request: Patrol_DarkModeRequest, + internal func makeEnableAirplaneModeCall( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { + ) -> GRPCAsyncUnaryCall { return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, + path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, request: request, callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] + interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] ) } - internal func makeDisableDarkModeCall( - _ request: Patrol_DarkModeRequest, + internal func makeDisableAirplaneModeCall( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { + ) -> GRPCAsyncUnaryCall { return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, + path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, request: request, callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] + interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] ) } @@ -889,6 +1001,54 @@ extension Patrol_NativeAutomatorAsyncClientProtocol { ) } + internal func makeEnableBluetoothCall( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? = nil + ) -> GRPCAsyncUnaryCall { + return self.makeAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] + ) + } + + internal func makeDisableBluetoothCall( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? = nil + ) -> GRPCAsyncUnaryCall { + return self.makeAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] + ) + } + + internal func makeEnableDarkModeCall( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? = nil + ) -> GRPCAsyncUnaryCall { + return self.makeAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] + ) + } + + internal func makeDisableDarkModeCall( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? = nil + ) -> GRPCAsyncUnaryCall { + return self.makeAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] + ) + } + internal func makeGetNativeWidgetsCall( _ request: Patrol_GetNativeWidgetsRequest, callOptions: CallOptions? = nil @@ -1084,27 +1244,27 @@ extension Patrol_NativeAutomatorAsyncClientProtocol { ) } - internal func enableDarkMode( - _ request: Patrol_DarkModeRequest, + internal func enableAirplaneMode( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? = nil ) async throws -> Patrol_Empty { return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, + path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, request: request, callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] + interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] ) } - internal func disableDarkMode( - _ request: Patrol_DarkModeRequest, + internal func disableAirplaneMode( + _ request: Patrol_AirplaneModeRequest, callOptions: CallOptions? = nil ) async throws -> Patrol_Empty { return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, + path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, request: request, callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] + interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] ) } @@ -1156,6 +1316,54 @@ extension Patrol_NativeAutomatorAsyncClientProtocol { ) } + internal func enableBluetooth( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? = nil + ) async throws -> Patrol_Empty { + return try await self.performAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] + ) + } + + internal func disableBluetooth( + _ request: Patrol_BluetoothRequest, + callOptions: CallOptions? = nil + ) async throws -> Patrol_Empty { + return try await self.performAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] + ) + } + + internal func enableDarkMode( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? = nil + ) async throws -> Patrol_Empty { + return try await self.performAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] + ) + } + + internal func disableDarkMode( + _ request: Patrol_DarkModeRequest, + callOptions: CallOptions? = nil + ) async throws -> Patrol_Empty { + return try await self.performAsyncUnaryCall( + path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] + ) + } + internal func getNativeWidgets( _ request: Patrol_GetNativeWidgetsRequest, callOptions: CallOptions? = nil @@ -1307,11 +1515,11 @@ internal protocol Patrol_NativeAutomatorClientInterceptorFactoryProtocol: GRPCSe /// - Returns: Interceptors to use when invoking 'openQuickSettings'. func makeopenQuickSettingsInterceptors() -> [ClientInterceptor] - /// - Returns: Interceptors to use when invoking 'enableDarkMode'. - func makeenableDarkModeInterceptors() -> [ClientInterceptor] + /// - Returns: Interceptors to use when invoking 'enableAirplaneMode'. + func makeenableAirplaneModeInterceptors() -> [ClientInterceptor] - /// - Returns: Interceptors to use when invoking 'disableDarkMode'. - func makedisableDarkModeInterceptors() -> [ClientInterceptor] + /// - Returns: Interceptors to use when invoking 'disableAirplaneMode'. + func makedisableAirplaneModeInterceptors() -> [ClientInterceptor] /// - Returns: Interceptors to use when invoking 'enableWiFi'. func makeenableWiFiInterceptors() -> [ClientInterceptor] @@ -1325,6 +1533,18 @@ internal protocol Patrol_NativeAutomatorClientInterceptorFactoryProtocol: GRPCSe /// - Returns: Interceptors to use when invoking 'disableCellular'. func makedisableCellularInterceptors() -> [ClientInterceptor] + /// - Returns: Interceptors to use when invoking 'enableBluetooth'. + func makeenableBluetoothInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'disableBluetooth'. + func makedisableBluetoothInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'enableDarkMode'. + func makeenableDarkModeInterceptors() -> [ClientInterceptor] + + /// - Returns: Interceptors to use when invoking 'disableDarkMode'. + func makedisableDarkModeInterceptors() -> [ClientInterceptor] + /// - Returns: Interceptors to use when invoking 'getNativeWidgets'. func makegetNativeWidgetsInterceptors() -> [ClientInterceptor] @@ -1365,12 +1585,16 @@ internal enum Patrol_NativeAutomatorClientMetadata { Patrol_NativeAutomatorClientMetadata.Methods.openApp, Patrol_NativeAutomatorClientMetadata.Methods.openNotifications, Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings, - Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode, - Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode, + Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode, + Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode, Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi, Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi, Patrol_NativeAutomatorClientMetadata.Methods.enableCellular, Patrol_NativeAutomatorClientMetadata.Methods.disableCellular, + Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth, + Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth, + Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode, + Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode, Patrol_NativeAutomatorClientMetadata.Methods.getNativeWidgets, Patrol_NativeAutomatorClientMetadata.Methods.getNotifications, Patrol_NativeAutomatorClientMetadata.Methods.tap, @@ -1426,15 +1650,15 @@ internal enum Patrol_NativeAutomatorClientMetadata { type: GRPCCallType.unary ) - internal static let enableDarkMode = GRPCMethodDescriptor( - name: "enableDarkMode", - path: "/patrol.NativeAutomator/enableDarkMode", + internal static let enableAirplaneMode = GRPCMethodDescriptor( + name: "enableAirplaneMode", + path: "/patrol.NativeAutomator/enableAirplaneMode", type: GRPCCallType.unary ) - internal static let disableDarkMode = GRPCMethodDescriptor( - name: "disableDarkMode", - path: "/patrol.NativeAutomator/disableDarkMode", + internal static let disableAirplaneMode = GRPCMethodDescriptor( + name: "disableAirplaneMode", + path: "/patrol.NativeAutomator/disableAirplaneMode", type: GRPCCallType.unary ) @@ -1462,6 +1686,30 @@ internal enum Patrol_NativeAutomatorClientMetadata { type: GRPCCallType.unary ) + internal static let enableBluetooth = GRPCMethodDescriptor( + name: "enableBluetooth", + path: "/patrol.NativeAutomator/enableBluetooth", + type: GRPCCallType.unary + ) + + internal static let disableBluetooth = GRPCMethodDescriptor( + name: "disableBluetooth", + path: "/patrol.NativeAutomator/disableBluetooth", + type: GRPCCallType.unary + ) + + internal static let enableDarkMode = GRPCMethodDescriptor( + name: "enableDarkMode", + path: "/patrol.NativeAutomator/enableDarkMode", + type: GRPCCallType.unary + ) + + internal static let disableDarkMode = GRPCMethodDescriptor( + name: "disableDarkMode", + path: "/patrol.NativeAutomator/disableDarkMode", + type: GRPCCallType.unary + ) + internal static let getNativeWidgets = GRPCMethodDescriptor( name: "getNativeWidgets", path: "/patrol.NativeAutomator/getNativeWidgets", @@ -1538,9 +1786,10 @@ internal protocol Patrol_NativeAutomatorProvider: CallHandlerProvider { func openQuickSettings(request: Patrol_OpenQuickSettingsRequest, context: StatusOnlyCallContext) -> EventLoopFuture - func enableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture + /// services + func enableAirplaneMode(request: Patrol_AirplaneModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - func disableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture + func disableAirplaneMode(request: Patrol_AirplaneModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture func enableWiFi(request: Patrol_WiFiRequest, context: StatusOnlyCallContext) -> EventLoopFuture @@ -1550,6 +1799,14 @@ internal protocol Patrol_NativeAutomatorProvider: CallHandlerProvider { func disableCellular(request: Patrol_CellularRequest, context: StatusOnlyCallContext) -> EventLoopFuture + func enableBluetooth(request: Patrol_BluetoothRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + func disableBluetooth(request: Patrol_BluetoothRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + func enableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture + + func disableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture + func getNativeWidgets(request: Patrol_GetNativeWidgetsRequest, context: StatusOnlyCallContext) -> EventLoopFuture func getNotifications(request: Patrol_GetNotificationsRequest, context: StatusOnlyCallContext) -> EventLoopFuture @@ -1644,22 +1901,22 @@ extension Patrol_NativeAutomatorProvider { userFunction: self.openQuickSettings(request:context:) ) - case "enableDarkMode": + case "enableAirplaneMode": return UnaryServerHandler( context: context, - requestDeserializer: ProtobufDeserializer(), + requestDeserializer: ProtobufDeserializer(), responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], - userFunction: self.enableDarkMode(request:context:) + interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [], + userFunction: self.enableAirplaneMode(request:context:) ) - case "disableDarkMode": + case "disableAirplaneMode": return UnaryServerHandler( context: context, - requestDeserializer: ProtobufDeserializer(), + requestDeserializer: ProtobufDeserializer(), responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], - userFunction: self.disableDarkMode(request:context:) + interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [], + userFunction: self.disableAirplaneMode(request:context:) ) case "enableWiFi": @@ -1698,6 +1955,42 @@ extension Patrol_NativeAutomatorProvider { userFunction: self.disableCellular(request:context:) ) + case "enableBluetooth": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [], + userFunction: self.enableBluetooth(request:context:) + ) + + case "disableBluetooth": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [], + userFunction: self.disableBluetooth(request:context:) + ) + + case "enableDarkMode": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], + userFunction: self.enableDarkMode(request:context:) + ) + + case "disableDarkMode": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], + userFunction: self.disableDarkMode(request:context:) + ) + case "getNativeWidgets": return UnaryServerHandler( context: context, @@ -1830,13 +2123,14 @@ internal protocol Patrol_NativeAutomatorAsyncProvider: CallHandlerProvider { context: GRPCAsyncServerCallContext ) async throws -> Patrol_Empty - @Sendable func enableDarkMode( - request: Patrol_DarkModeRequest, + /// services + @Sendable func enableAirplaneMode( + request: Patrol_AirplaneModeRequest, context: GRPCAsyncServerCallContext ) async throws -> Patrol_Empty - @Sendable func disableDarkMode( - request: Patrol_DarkModeRequest, + @Sendable func disableAirplaneMode( + request: Patrol_AirplaneModeRequest, context: GRPCAsyncServerCallContext ) async throws -> Patrol_Empty @@ -1860,6 +2154,26 @@ internal protocol Patrol_NativeAutomatorAsyncProvider: CallHandlerProvider { context: GRPCAsyncServerCallContext ) async throws -> Patrol_Empty + @Sendable func enableBluetooth( + request: Patrol_BluetoothRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Patrol_Empty + + @Sendable func disableBluetooth( + request: Patrol_BluetoothRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Patrol_Empty + + @Sendable func enableDarkMode( + request: Patrol_DarkModeRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Patrol_Empty + + @Sendable func disableDarkMode( + request: Patrol_DarkModeRequest, + context: GRPCAsyncServerCallContext + ) async throws -> Patrol_Empty + @Sendable func getNativeWidgets( request: Patrol_GetNativeWidgetsRequest, context: GRPCAsyncServerCallContext @@ -1988,22 +2302,22 @@ extension Patrol_NativeAutomatorAsyncProvider { wrapping: self.openQuickSettings(request:context:) ) - case "enableDarkMode": + case "enableAirplaneMode": return GRPCAsyncServerHandler( context: context, - requestDeserializer: ProtobufDeserializer(), + requestDeserializer: ProtobufDeserializer(), responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], - wrapping: self.enableDarkMode(request:context:) + interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [], + wrapping: self.enableAirplaneMode(request:context:) ) - case "disableDarkMode": + case "disableAirplaneMode": return GRPCAsyncServerHandler( context: context, - requestDeserializer: ProtobufDeserializer(), + requestDeserializer: ProtobufDeserializer(), responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], - wrapping: self.disableDarkMode(request:context:) + interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [], + wrapping: self.disableAirplaneMode(request:context:) ) case "enableWiFi": @@ -2042,6 +2356,42 @@ extension Patrol_NativeAutomatorAsyncProvider { wrapping: self.disableCellular(request:context:) ) + case "enableBluetooth": + return GRPCAsyncServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [], + wrapping: self.enableBluetooth(request:context:) + ) + + case "disableBluetooth": + return GRPCAsyncServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [], + wrapping: self.disableBluetooth(request:context:) + ) + + case "enableDarkMode": + return GRPCAsyncServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], + wrapping: self.enableDarkMode(request:context:) + ) + + case "disableDarkMode": + return GRPCAsyncServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], + wrapping: self.disableDarkMode(request:context:) + ) + case "getNativeWidgets": return GRPCAsyncServerHandler( context: context, @@ -2161,13 +2511,13 @@ internal protocol Patrol_NativeAutomatorServerInterceptorFactoryProtocol { /// Defaults to calling `self.makeInterceptors()`. func makeopenQuickSettingsInterceptors() -> [ServerInterceptor] - /// - Returns: Interceptors to use when handling 'enableDarkMode'. + /// - Returns: Interceptors to use when handling 'enableAirplaneMode'. /// Defaults to calling `self.makeInterceptors()`. - func makeenableDarkModeInterceptors() -> [ServerInterceptor] + func makeenableAirplaneModeInterceptors() -> [ServerInterceptor] - /// - Returns: Interceptors to use when handling 'disableDarkMode'. + /// - Returns: Interceptors to use when handling 'disableAirplaneMode'. /// Defaults to calling `self.makeInterceptors()`. - func makedisableDarkModeInterceptors() -> [ServerInterceptor] + func makedisableAirplaneModeInterceptors() -> [ServerInterceptor] /// - Returns: Interceptors to use when handling 'enableWiFi'. /// Defaults to calling `self.makeInterceptors()`. @@ -2185,6 +2535,22 @@ internal protocol Patrol_NativeAutomatorServerInterceptorFactoryProtocol { /// Defaults to calling `self.makeInterceptors()`. func makedisableCellularInterceptors() -> [ServerInterceptor] + /// - Returns: Interceptors to use when handling 'enableBluetooth'. + /// Defaults to calling `self.makeInterceptors()`. + func makeenableBluetoothInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'disableBluetooth'. + /// Defaults to calling `self.makeInterceptors()`. + func makedisableBluetoothInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'enableDarkMode'. + /// Defaults to calling `self.makeInterceptors()`. + func makeenableDarkModeInterceptors() -> [ServerInterceptor] + + /// - Returns: Interceptors to use when handling 'disableDarkMode'. + /// Defaults to calling `self.makeInterceptors()`. + func makedisableDarkModeInterceptors() -> [ServerInterceptor] + /// - Returns: Interceptors to use when handling 'getNativeWidgets'. /// Defaults to calling `self.makeInterceptors()`. func makegetNativeWidgetsInterceptors() -> [ServerInterceptor] @@ -2234,12 +2600,16 @@ internal enum Patrol_NativeAutomatorServerMetadata { Patrol_NativeAutomatorServerMetadata.Methods.openApp, Patrol_NativeAutomatorServerMetadata.Methods.openNotifications, Patrol_NativeAutomatorServerMetadata.Methods.openQuickSettings, - Patrol_NativeAutomatorServerMetadata.Methods.enableDarkMode, - Patrol_NativeAutomatorServerMetadata.Methods.disableDarkMode, + Patrol_NativeAutomatorServerMetadata.Methods.enableAirplaneMode, + Patrol_NativeAutomatorServerMetadata.Methods.disableAirplaneMode, Patrol_NativeAutomatorServerMetadata.Methods.enableWiFi, Patrol_NativeAutomatorServerMetadata.Methods.disableWiFi, Patrol_NativeAutomatorServerMetadata.Methods.enableCellular, Patrol_NativeAutomatorServerMetadata.Methods.disableCellular, + Patrol_NativeAutomatorServerMetadata.Methods.enableBluetooth, + Patrol_NativeAutomatorServerMetadata.Methods.disableBluetooth, + Patrol_NativeAutomatorServerMetadata.Methods.enableDarkMode, + Patrol_NativeAutomatorServerMetadata.Methods.disableDarkMode, Patrol_NativeAutomatorServerMetadata.Methods.getNativeWidgets, Patrol_NativeAutomatorServerMetadata.Methods.getNotifications, Patrol_NativeAutomatorServerMetadata.Methods.tap, @@ -2295,15 +2665,15 @@ internal enum Patrol_NativeAutomatorServerMetadata { type: GRPCCallType.unary ) - internal static let enableDarkMode = GRPCMethodDescriptor( - name: "enableDarkMode", - path: "/patrol.NativeAutomator/enableDarkMode", + internal static let enableAirplaneMode = GRPCMethodDescriptor( + name: "enableAirplaneMode", + path: "/patrol.NativeAutomator/enableAirplaneMode", type: GRPCCallType.unary ) - internal static let disableDarkMode = GRPCMethodDescriptor( - name: "disableDarkMode", - path: "/patrol.NativeAutomator/disableDarkMode", + internal static let disableAirplaneMode = GRPCMethodDescriptor( + name: "disableAirplaneMode", + path: "/patrol.NativeAutomator/disableAirplaneMode", type: GRPCCallType.unary ) @@ -2331,6 +2701,30 @@ internal enum Patrol_NativeAutomatorServerMetadata { type: GRPCCallType.unary ) + internal static let enableBluetooth = GRPCMethodDescriptor( + name: "enableBluetooth", + path: "/patrol.NativeAutomator/enableBluetooth", + type: GRPCCallType.unary + ) + + internal static let disableBluetooth = GRPCMethodDescriptor( + name: "disableBluetooth", + path: "/patrol.NativeAutomator/disableBluetooth", + type: GRPCCallType.unary + ) + + internal static let enableDarkMode = GRPCMethodDescriptor( + name: "enableDarkMode", + path: "/patrol.NativeAutomator/enableDarkMode", + type: GRPCCallType.unary + ) + + internal static let disableDarkMode = GRPCMethodDescriptor( + name: "disableDarkMode", + path: "/patrol.NativeAutomator/disableDarkMode", + type: GRPCCallType.unary + ) + internal static let getNativeWidgets = GRPCMethodDescriptor( name: "getNativeWidgets", path: "/patrol.NativeAutomator/getNativeWidgets", diff --git a/AutomatorServer/ios/AutomatorServerUITests/contracts.pb.swift b/AutomatorServer/ios/AutomatorServerUITests/contracts.pb.swift index d5bfd6807..6a58c7bc7 100644 --- a/AutomatorServer/ios/AutomatorServerUITests/contracts.pb.swift +++ b/AutomatorServer/ios/AutomatorServerUITests/contracts.pb.swift @@ -109,7 +109,19 @@ public struct Patrol_OpenQuickSettingsRequest { public init() {} } -public struct Patrol_DarkModeRequest { +public struct Patrol_AirplaneModeRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var appID: String = String() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +public struct Patrol_CellularRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -133,7 +145,19 @@ public struct Patrol_WiFiRequest { public init() {} } -public struct Patrol_CellularRequest { +public struct Patrol_BluetoothRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var appID: String = String() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +public struct Patrol_DarkModeRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -601,9 +625,11 @@ extension Patrol_TapOnNotificationRequest: @unchecked Sendable {} extension Patrol_TapOnNotificationRequest.OneOf_FindBy: @unchecked Sendable {} extension Patrol_Empty: @unchecked Sendable {} extension Patrol_OpenQuickSettingsRequest: @unchecked Sendable {} -extension Patrol_DarkModeRequest: @unchecked Sendable {} -extension Patrol_WiFiRequest: @unchecked Sendable {} +extension Patrol_AirplaneModeRequest: @unchecked Sendable {} extension Patrol_CellularRequest: @unchecked Sendable {} +extension Patrol_WiFiRequest: @unchecked Sendable {} +extension Patrol_BluetoothRequest: @unchecked Sendable {} +extension Patrol_DarkModeRequest: @unchecked Sendable {} extension Patrol_GetNativeWidgetsRequest: @unchecked Sendable {} extension Patrol_GetNativeWidgetsResponse: @unchecked Sendable {} extension Patrol_GetNotificationsRequest: @unchecked Sendable {} @@ -760,8 +786,8 @@ extension Patrol_OpenQuickSettingsRequest: SwiftProtobuf.Message, SwiftProtobuf. } } -extension Patrol_DarkModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DarkModeRequest" +extension Patrol_AirplaneModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".AirplaneModeRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "appId"), ] @@ -785,7 +811,39 @@ extension Patrol_DarkModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageI try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Patrol_DarkModeRequest, rhs: Patrol_DarkModeRequest) -> Bool { + public static func ==(lhs: Patrol_AirplaneModeRequest, rhs: Patrol_AirplaneModeRequest) -> Bool { + if lhs.appID != rhs.appID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Patrol_CellularRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CellularRequest" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "appId"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.appID) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.appID.isEmpty { + try visitor.visitSingularStringField(value: self.appID, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Patrol_CellularRequest, rhs: Patrol_CellularRequest) -> Bool { if lhs.appID != rhs.appID {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true @@ -824,8 +882,8 @@ extension Patrol_WiFiRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImple } } -extension Patrol_CellularRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CellularRequest" +extension Patrol_BluetoothRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BluetoothRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "appId"), ] @@ -849,7 +907,39 @@ extension Patrol_CellularRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageI try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Patrol_CellularRequest, rhs: Patrol_CellularRequest) -> Bool { + public static func ==(lhs: Patrol_BluetoothRequest, rhs: Patrol_BluetoothRequest) -> Bool { + if lhs.appID != rhs.appID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Patrol_DarkModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".DarkModeRequest" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "appId"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.appID) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.appID.isEmpty { + try visitor.visitSingularStringField(value: self.appID, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Patrol_DarkModeRequest, rhs: Patrol_DarkModeRequest) -> Bool { if lhs.appID != rhs.appID {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true diff --git a/contracts.proto b/contracts.proto index f18667360..05ca0206f 100644 --- a/contracts.proto +++ b/contracts.proto @@ -15,13 +15,16 @@ service NativeAutomator { rpc openQuickSettings(OpenQuickSettingsRequest) returns (Empty) {} // services - - rpc enableDarkMode(DarkModeRequest) returns (Empty) {} - rpc disableDarkMode(DarkModeRequest) returns (Empty) {} + rpc enableAirplaneMode(AirplaneModeRequest) returns (Empty) {} + rpc disableAirplaneMode(AirplaneModeRequest) returns (Empty) {} rpc enableWiFi(WiFiRequest) returns (Empty) {} rpc disableWiFi(WiFiRequest) returns (Empty) {} rpc enableCellular(CellularRequest) returns (Empty) {} rpc disableCellular(CellularRequest) returns (Empty) {} + rpc enableBluetooth(BluetoothRequest) returns (Empty) {} + rpc disableBluetooth(BluetoothRequest) returns (Empty) {} + rpc enableDarkMode(DarkModeRequest) returns (Empty) {} + rpc disableDarkMode(DarkModeRequest) returns (Empty) {} // UI interaction @@ -54,11 +57,11 @@ message Empty {} message OpenQuickSettingsRequest {} -message DarkModeRequest { string appId = 1; } - -message WiFiRequest { string appId = 1; } - +message AirplaneModeRequest { string appId = 1; } message CellularRequest { string appId = 1; } +message WiFiRequest { string appId = 1; } +message BluetoothRequest { string appId = 1; } +message DarkModeRequest { string appId = 1; } message GetNativeWidgetsRequest { Selector selector = 1; } message GetNativeWidgetsResponse { repeated NativeWidget nativeWidgets = 1; } diff --git a/docs/native/feature-parity.mdx b/docs/native/feature-parity.mdx index 6518fb340..89010bbd8 100644 --- a/docs/native/feature-parity.mdx +++ b/docs/native/feature-parity.mdx @@ -6,23 +6,24 @@ implemented. We hope that it will help you evaluate Patrol. We strive for high feature parity across iOS and Android, but unfortunately it's impossible to reach 100%. -| **Feature** | **Android** | **iOS** | -| ------------------------- | ------------- | ------------- | -| Press home | ✅ | ✅ | -| Press back | ✅ | ❌ (no API) | -| Open any app | ✅ | ✅ | -| Open notifications | ✅ | ❌ see [#327] | -| Tap on notification | ✅ | ❌ see [#319] | -| Open quick settings | ✅ | ❌ | -| Toggle dark mode | ✅ | ✅ | -| Toggle Wi-Fi | ✅ | ✅ | -| Toggle Cellular | ✅ | ✅ | -| Toggle Location | ❌ see [#283] | ❌ see [#326] | -| Toggle Bluetooth | ❌ see [#282] | ❌ | -| Tap | ✅ | ✅ | -| Double tap | ✅ | ✅ | -| Enter text | ✅ | ✅ | -| Handle permission dialogs | ✅ | ✅ | +| **Feature** | **Android** | **iOS** | +| ------------------------------------ | ------------- | ------------- | +| Press home | ✅ | ✅ | +| Press back | ✅ | ❌ (no API) | +| Open any app | ✅ | ✅ | +| Open notifications | ✅ | ❌ see [#327] | +| Tap on notification | ✅ | ❌ see [#319] | +| Open quick settings / Control Center | ✅ | ✅ | +| Toggle dark mode | ✅ | ✅ | +| Toggle airplane mode | ❌ | ✅ | +| Toggle cellular | ✅ | ✅ | +| Toggle Wi-Fi | ✅ | ✅ | +| Toggle Bluetooth | ❌ see [#282] | ✅ | +| Toggle location | ❌ see [#283] | ❌ see [#326] | +| Tap | ✅ | ✅ | +| Double tap | ✅ | ✅ | +| Enter text | ✅ | ✅ | +| Handle permission dialogs | ✅ | ✅ | [#282]: https://github.com/leancodepl/patrol/issues/282 [#283]: https://github.com/leancodepl/patrol/issues/283 diff --git a/packages/patrol/example/integration_test/features/all_test.dart b/packages/patrol/example/integration_test/features/all_test.dart new file mode 100644 index 000000000..c7c67c228 --- /dev/null +++ b/packages/patrol/example/integration_test/features/all_test.dart @@ -0,0 +1,41 @@ +import 'package:example/main.dart'; +import 'package:patrol/patrol.dart'; + +import '../config.dart'; + +void main() { + patrolTest( + 'disables and enables all services', + config: patrolConfig, + nativeAutomation: true, + ($) async { + await $.pumpWidgetAndSettle(ExampleApp()); + + await repeat(() async { + await $.native.disableAirplaneMode(); + await $.native.enableAirplaneMode(); + }); + + await repeat(() async { + await $.native.disableCellular(); + await $.native.enableCellular(); + }); + + await repeat(() async { + await $.native.disableWifi(); + await $.native.enableWifi(); + }); + + await repeat(() async { + await $.native.disableBluetooth(); + await $.native.enableBluetooth(); + }); + }, + ); +} + +Future repeat(Future Function() callback, {int times = 2}) async { + for (var i = 0; i < times; i++) { + await callback(); + } +} diff --git a/packages/patrol/example/integration_test/features/quick_settings_test.dart b/packages/patrol/example/integration_test/features/quick_settings_test.dart new file mode 100644 index 000000000..09773b999 --- /dev/null +++ b/packages/patrol/example/integration_test/features/quick_settings_test.dart @@ -0,0 +1,17 @@ +import 'package:example/main.dart'; +import 'package:patrol/patrol.dart'; + +import '../config.dart'; + +void main() { + patrolTest( + 'opens quick settings', + config: patrolConfig, + nativeAutomation: true, + ($) async { + await $.pumpWidgetAndSettle(ExampleApp()); + + await $.native.openQuickSettings(); + }, + ); +} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pb.dart b/packages/patrol/lib/src/native/contracts/contracts.pb.dart index e5d57946f..149477811 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pb.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pb.dart @@ -273,11 +273,11 @@ class OpenQuickSettingsRequest extends $pb.GeneratedMessage { static OpenQuickSettingsRequest? _defaultInstance; } -class DarkModeRequest extends $pb.GeneratedMessage { +class AirplaneModeRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo( const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' - : 'DarkModeRequest', + : 'AirplaneModeRequest', package: const $pb.PackageName( const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' @@ -291,8 +291,8 @@ class DarkModeRequest extends $pb.GeneratedMessage { protoName: 'appId') ..hasRequiredFields = false; - DarkModeRequest._() : super(); - factory DarkModeRequest({ + AirplaneModeRequest._() : super(); + factory AirplaneModeRequest({ $core.String? appId, }) { final _result = create(); @@ -301,32 +301,100 @@ class DarkModeRequest extends $pb.GeneratedMessage { } return _result; } - factory DarkModeRequest.fromBuffer($core.List<$core.int> i, + factory AirplaneModeRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory DarkModeRequest.fromJson($core.String i, + factory AirplaneModeRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') - DarkModeRequest clone() => DarkModeRequest()..mergeFromMessage(this); + AirplaneModeRequest clone() => AirplaneModeRequest()..mergeFromMessage(this); @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - DarkModeRequest copyWith(void Function(DarkModeRequest) updates) => - super.copyWith((message) => updates(message as DarkModeRequest)) - as DarkModeRequest; // ignore: deprecated_member_use + AirplaneModeRequest copyWith(void Function(AirplaneModeRequest) updates) => + super.copyWith((message) => updates(message as AirplaneModeRequest)) + as AirplaneModeRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static DarkModeRequest create() => DarkModeRequest._(); - DarkModeRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static AirplaneModeRequest create() => AirplaneModeRequest._(); + AirplaneModeRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static DarkModeRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DarkModeRequest? _defaultInstance; + static AirplaneModeRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static AirplaneModeRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get appId => $_getSZ(0); + @$pb.TagNumber(1) + set appId($core.String v) { + $_setString(0, v); + } + + @$pb.TagNumber(1) + $core.bool hasAppId() => $_has(0); + @$pb.TagNumber(1) + void clearAppId() => clearField(1); +} + +class CellularRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'CellularRequest', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'patrol'), + createEmptyInstance: create) + ..aOS( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'appId', + protoName: 'appId') + ..hasRequiredFields = false; + + CellularRequest._() : super(); + factory CellularRequest({ + $core.String? appId, + }) { + final _result = create(); + if (appId != null) { + _result.appId = appId; + } + return _result; + } + factory CellularRequest.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory CellularRequest.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + CellularRequest clone() => CellularRequest()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CellularRequest copyWith(void Function(CellularRequest) updates) => + super.copyWith((message) => updates(message as CellularRequest)) + as CellularRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CellularRequest create() => CellularRequest._(); + CellularRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CellularRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static CellularRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get appId => $_getSZ(0); @@ -408,11 +476,11 @@ class WiFiRequest extends $pb.GeneratedMessage { void clearAppId() => clearField(1); } -class CellularRequest extends $pb.GeneratedMessage { +class BluetoothRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo( const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' - : 'CellularRequest', + : 'BluetoothRequest', package: const $pb.PackageName( const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' @@ -426,8 +494,8 @@ class CellularRequest extends $pb.GeneratedMessage { protoName: 'appId') ..hasRequiredFields = false; - CellularRequest._() : super(); - factory CellularRequest({ + BluetoothRequest._() : super(); + factory BluetoothRequest({ $core.String? appId, }) { final _result = create(); @@ -436,32 +504,100 @@ class CellularRequest extends $pb.GeneratedMessage { } return _result; } - factory CellularRequest.fromBuffer($core.List<$core.int> i, + factory BluetoothRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CellularRequest.fromJson($core.String i, + factory BluetoothRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') - CellularRequest clone() => CellularRequest()..mergeFromMessage(this); + BluetoothRequest clone() => BluetoothRequest()..mergeFromMessage(this); @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - CellularRequest copyWith(void Function(CellularRequest) updates) => - super.copyWith((message) => updates(message as CellularRequest)) - as CellularRequest; // ignore: deprecated_member_use + BluetoothRequest copyWith(void Function(BluetoothRequest) updates) => + super.copyWith((message) => updates(message as BluetoothRequest)) + as BluetoothRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static CellularRequest create() => CellularRequest._(); - CellularRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static BluetoothRequest create() => BluetoothRequest._(); + BluetoothRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static CellularRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static CellularRequest? _defaultInstance; + static BluetoothRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static BluetoothRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get appId => $_getSZ(0); + @$pb.TagNumber(1) + set appId($core.String v) { + $_setString(0, v); + } + + @$pb.TagNumber(1) + $core.bool hasAppId() => $_has(0); + @$pb.TagNumber(1) + void clearAppId() => clearField(1); +} + +class DarkModeRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'DarkModeRequest', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'patrol'), + createEmptyInstance: create) + ..aOS( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'appId', + protoName: 'appId') + ..hasRequiredFields = false; + + DarkModeRequest._() : super(); + factory DarkModeRequest({ + $core.String? appId, + }) { + final _result = create(); + if (appId != null) { + _result.appId = appId; + } + return _result; + } + factory DarkModeRequest.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory DarkModeRequest.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + DarkModeRequest clone() => DarkModeRequest()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + DarkModeRequest copyWith(void Function(DarkModeRequest) updates) => + super.copyWith((message) => updates(message as DarkModeRequest)) + as DarkModeRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static DarkModeRequest create() => DarkModeRequest._(); + DarkModeRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); + @$core.pragma('dart2js:noInline') + static DarkModeRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static DarkModeRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get appId => $_getSZ(0); diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart b/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart index a631cfa07..eb04b9a0c 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart @@ -43,15 +43,15 @@ class NativeAutomatorClient extends $grpc.Client { '/patrol.NativeAutomator/openQuickSettings', ($0.OpenQuickSettingsRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableDarkMode = - $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( - '/patrol.NativeAutomator/enableDarkMode', - ($0.DarkModeRequest value) => value.writeToBuffer(), + static final _$enableAirplaneMode = + $grpc.ClientMethod<$0.AirplaneModeRequest, $0.Empty>( + '/patrol.NativeAutomator/enableAirplaneMode', + ($0.AirplaneModeRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableDarkMode = - $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( - '/patrol.NativeAutomator/disableDarkMode', - ($0.DarkModeRequest value) => value.writeToBuffer(), + static final _$disableAirplaneMode = + $grpc.ClientMethod<$0.AirplaneModeRequest, $0.Empty>( + '/patrol.NativeAutomator/disableAirplaneMode', + ($0.AirplaneModeRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); static final _$enableWiFi = $grpc.ClientMethod<$0.WiFiRequest, $0.Empty>( '/patrol.NativeAutomator/enableWiFi', @@ -71,6 +71,26 @@ class NativeAutomatorClient extends $grpc.Client { '/patrol.NativeAutomator/disableCellular', ($0.CellularRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); + static final _$enableBluetooth = + $grpc.ClientMethod<$0.BluetoothRequest, $0.Empty>( + '/patrol.NativeAutomator/enableBluetooth', + ($0.BluetoothRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); + static final _$disableBluetooth = + $grpc.ClientMethod<$0.BluetoothRequest, $0.Empty>( + '/patrol.NativeAutomator/disableBluetooth', + ($0.BluetoothRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); + static final _$enableDarkMode = + $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( + '/patrol.NativeAutomator/enableDarkMode', + ($0.DarkModeRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); + static final _$disableDarkMode = + $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( + '/patrol.NativeAutomator/disableDarkMode', + ($0.DarkModeRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); static final _$getNativeWidgets = $grpc.ClientMethod< $0.GetNativeWidgetsRequest, $0.GetNativeWidgetsResponse>( '/patrol.NativeAutomator/getNativeWidgets', @@ -156,14 +176,16 @@ class NativeAutomatorClient extends $grpc.Client { return $createUnaryCall(_$openQuickSettings, request, options: options); } - $grpc.ResponseFuture<$0.Empty> enableDarkMode($0.DarkModeRequest request, + $grpc.ResponseFuture<$0.Empty> enableAirplaneMode( + $0.AirplaneModeRequest request, {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableDarkMode, request, options: options); + return $createUnaryCall(_$enableAirplaneMode, request, options: options); } - $grpc.ResponseFuture<$0.Empty> disableDarkMode($0.DarkModeRequest request, + $grpc.ResponseFuture<$0.Empty> disableAirplaneMode( + $0.AirplaneModeRequest request, {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableDarkMode, request, options: options); + return $createUnaryCall(_$disableAirplaneMode, request, options: options); } $grpc.ResponseFuture<$0.Empty> enableWiFi($0.WiFiRequest request, @@ -186,6 +208,26 @@ class NativeAutomatorClient extends $grpc.Client { return $createUnaryCall(_$disableCellular, request, options: options); } + $grpc.ResponseFuture<$0.Empty> enableBluetooth($0.BluetoothRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$enableBluetooth, request, options: options); + } + + $grpc.ResponseFuture<$0.Empty> disableBluetooth($0.BluetoothRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$disableBluetooth, request, options: options); + } + + $grpc.ResponseFuture<$0.Empty> enableDarkMode($0.DarkModeRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$enableDarkMode, request, options: options); + } + + $grpc.ResponseFuture<$0.Empty> disableDarkMode($0.DarkModeRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$disableDarkMode, request, options: options); + } + $grpc.ResponseFuture<$0.GetNativeWidgetsResponse> getNativeWidgets( $0.GetNativeWidgetsRequest request, {$grpc.CallOptions? options}) { @@ -292,19 +334,21 @@ abstract class NativeAutomatorServiceBase extends $grpc.Service { ($core.List<$core.int> value) => $0.OpenQuickSettingsRequest.fromBuffer(value), ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( - 'enableDarkMode', - enableDarkMode_Pre, + $addMethod($grpc.ServiceMethod<$0.AirplaneModeRequest, $0.Empty>( + 'enableAirplaneMode', + enableAirplaneMode_Pre, false, false, - ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.AirplaneModeRequest.fromBuffer(value), ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( - 'disableDarkMode', - disableDarkMode_Pre, + $addMethod($grpc.ServiceMethod<$0.AirplaneModeRequest, $0.Empty>( + 'disableAirplaneMode', + disableAirplaneMode_Pre, false, false, - ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.AirplaneModeRequest.fromBuffer(value), ($0.Empty value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.WiFiRequest, $0.Empty>( 'enableWiFi', @@ -334,6 +378,34 @@ abstract class NativeAutomatorServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $0.CellularRequest.fromBuffer(value), ($0.Empty value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.BluetoothRequest, $0.Empty>( + 'enableBluetooth', + enableBluetooth_Pre, + false, + false, + ($core.List<$core.int> value) => $0.BluetoothRequest.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.BluetoothRequest, $0.Empty>( + 'disableBluetooth', + disableBluetooth_Pre, + false, + false, + ($core.List<$core.int> value) => $0.BluetoothRequest.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( + 'enableDarkMode', + enableDarkMode_Pre, + false, + false, + ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( + 'disableDarkMode', + disableDarkMode_Pre, + false, + false, + ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.GetNativeWidgetsRequest, $0.GetNativeWidgetsResponse>( 'getNativeWidgets', @@ -441,14 +513,14 @@ abstract class NativeAutomatorServiceBase extends $grpc.Service { return openQuickSettings(call, await request); } - $async.Future<$0.Empty> enableDarkMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { - return enableDarkMode(call, await request); + $async.Future<$0.Empty> enableAirplaneMode_Pre($grpc.ServiceCall call, + $async.Future<$0.AirplaneModeRequest> request) async { + return enableAirplaneMode(call, await request); } - $async.Future<$0.Empty> disableDarkMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { - return disableDarkMode(call, await request); + $async.Future<$0.Empty> disableAirplaneMode_Pre($grpc.ServiceCall call, + $async.Future<$0.AirplaneModeRequest> request) async { + return disableAirplaneMode(call, await request); } $async.Future<$0.Empty> enableWiFi_Pre( @@ -471,6 +543,26 @@ abstract class NativeAutomatorServiceBase extends $grpc.Service { return disableCellular(call, await request); } + $async.Future<$0.Empty> enableBluetooth_Pre($grpc.ServiceCall call, + $async.Future<$0.BluetoothRequest> request) async { + return enableBluetooth(call, await request); + } + + $async.Future<$0.Empty> disableBluetooth_Pre($grpc.ServiceCall call, + $async.Future<$0.BluetoothRequest> request) async { + return disableBluetooth(call, await request); + } + + $async.Future<$0.Empty> enableDarkMode_Pre( + $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { + return enableDarkMode(call, await request); + } + + $async.Future<$0.Empty> disableDarkMode_Pre( + $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { + return disableDarkMode(call, await request); + } + $async.Future<$0.GetNativeWidgetsResponse> getNativeWidgets_Pre( $grpc.ServiceCall call, $async.Future<$0.GetNativeWidgetsRequest> request) async { @@ -530,10 +622,10 @@ abstract class NativeAutomatorServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.Empty request); $async.Future<$0.Empty> openQuickSettings( $grpc.ServiceCall call, $0.OpenQuickSettingsRequest request); - $async.Future<$0.Empty> enableDarkMode( - $grpc.ServiceCall call, $0.DarkModeRequest request); - $async.Future<$0.Empty> disableDarkMode( - $grpc.ServiceCall call, $0.DarkModeRequest request); + $async.Future<$0.Empty> enableAirplaneMode( + $grpc.ServiceCall call, $0.AirplaneModeRequest request); + $async.Future<$0.Empty> disableAirplaneMode( + $grpc.ServiceCall call, $0.AirplaneModeRequest request); $async.Future<$0.Empty> enableWiFi( $grpc.ServiceCall call, $0.WiFiRequest request); $async.Future<$0.Empty> disableWiFi( @@ -542,6 +634,14 @@ abstract class NativeAutomatorServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.CellularRequest request); $async.Future<$0.Empty> disableCellular( $grpc.ServiceCall call, $0.CellularRequest request); + $async.Future<$0.Empty> enableBluetooth( + $grpc.ServiceCall call, $0.BluetoothRequest request); + $async.Future<$0.Empty> disableBluetooth( + $grpc.ServiceCall call, $0.BluetoothRequest request); + $async.Future<$0.Empty> enableDarkMode( + $grpc.ServiceCall call, $0.DarkModeRequest request); + $async.Future<$0.Empty> disableDarkMode( + $grpc.ServiceCall call, $0.DarkModeRequest request); $async.Future<$0.GetNativeWidgetsResponse> getNativeWidgets( $grpc.ServiceCall call, $0.GetNativeWidgetsRequest request); $async.Future<$0.GetNotificationsResponse> getNotifications( diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart index a8e43f1c5..2fd8cbefd 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart @@ -60,17 +60,29 @@ const OpenQuickSettingsRequest$json = const { /// Descriptor for `OpenQuickSettingsRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List openQuickSettingsRequestDescriptor = $convert.base64Decode('ChhPcGVuUXVpY2tTZXR0aW5nc1JlcXVlc3Q='); -@$core.Deprecated('Use darkModeRequestDescriptor instead') -const DarkModeRequest$json = const { - '1': 'DarkModeRequest', +@$core.Deprecated('Use airplaneModeRequestDescriptor instead') +const AirplaneModeRequest$json = const { + '1': 'AirplaneModeRequest', '2': const [ const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, ], }; -/// Descriptor for `DarkModeRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List darkModeRequestDescriptor = $convert - .base64Decode('Cg9EYXJrTW9kZVJlcXVlc3QSFAoFYXBwSWQYASABKAlSBWFwcElk'); +/// Descriptor for `AirplaneModeRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List airplaneModeRequestDescriptor = + $convert.base64Decode( + 'ChNBaXJwbGFuZU1vZGVSZXF1ZXN0EhQKBWFwcElkGAEgASgJUgVhcHBJZA=='); +@$core.Deprecated('Use cellularRequestDescriptor instead') +const CellularRequest$json = const { + '1': 'CellularRequest', + '2': const [ + const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, + ], +}; + +/// Descriptor for `CellularRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List cellularRequestDescriptor = $convert + .base64Decode('Cg9DZWxsdWxhclJlcXVlc3QSFAoFYXBwSWQYASABKAlSBWFwcElk'); @$core.Deprecated('Use wiFiRequestDescriptor instead') const WiFiRequest$json = const { '1': 'WiFiRequest', @@ -82,17 +94,28 @@ const WiFiRequest$json = const { /// Descriptor for `WiFiRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List wiFiRequestDescriptor = $convert.base64Decode('CgtXaUZpUmVxdWVzdBIUCgVhcHBJZBgBIAEoCVIFYXBwSWQ='); -@$core.Deprecated('Use cellularRequestDescriptor instead') -const CellularRequest$json = const { - '1': 'CellularRequest', +@$core.Deprecated('Use bluetoothRequestDescriptor instead') +const BluetoothRequest$json = const { + '1': 'BluetoothRequest', '2': const [ const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, ], }; -/// Descriptor for `CellularRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List cellularRequestDescriptor = $convert - .base64Decode('Cg9DZWxsdWxhclJlcXVlc3QSFAoFYXBwSWQYASABKAlSBWFwcElk'); +/// Descriptor for `BluetoothRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List bluetoothRequestDescriptor = $convert + .base64Decode('ChBCbHVldG9vdGhSZXF1ZXN0EhQKBWFwcElkGAEgASgJUgVhcHBJZA=='); +@$core.Deprecated('Use darkModeRequestDescriptor instead') +const DarkModeRequest$json = const { + '1': 'DarkModeRequest', + '2': const [ + const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, + ], +}; + +/// Descriptor for `DarkModeRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List darkModeRequestDescriptor = $convert + .base64Decode('Cg9EYXJrTW9kZVJlcXVlc3QSFAoFYXBwSWQYASABKAlSBWFwcElk'); @$core.Deprecated('Use getNativeWidgetsRequestDescriptor instead') const GetNativeWidgetsRequest$json = const { '1': 'GetNativeWidgetsRequest', diff --git a/packages/patrol/lib/src/native/native_automator.dart b/packages/patrol/lib/src/native/native_automator.dart index b06e488c6..51a38e9c4 100644 --- a/packages/patrol/lib/src/native/native_automator.dart +++ b/packages/patrol/lib/src/native/native_automator.dart @@ -260,19 +260,23 @@ class NativeAutomator { ); } - /// Enables Wi-Fi. - Future enableWifi({String? appId}) async { + /// Enables airplane mode. + Future enableAirplaneMode({String? appId}) async { await _wrapRequest( - 'enableWifi', - () => _client.enableWiFi(WiFiRequest(appId: appId ?? resolvedAppId)), + 'enableAirplaneMode', + () => _client.enableAirplaneMode( + AirplaneModeRequest(appId: appId ?? resolvedAppId), + ), ); } - /// Disables Wi-Fi. - Future disableWifi({String? appId}) async { + /// Enables airplane mode. + Future disableAirplaneMode({String? appId}) async { await _wrapRequest( - 'disableWifi', - () => _client.disableWiFi(WiFiRequest(appId: appId ?? resolvedAppId)), + 'disableAirplaneMode', + () => _client.disableAirplaneMode( + AirplaneModeRequest(appId: appId ?? resolvedAppId), + ), ); } @@ -296,6 +300,42 @@ class NativeAutomator { ); } + /// Enables Wi-Fi. + Future enableWifi({String? appId}) async { + await _wrapRequest( + 'enableWifi', + () => _client.enableWiFi(WiFiRequest(appId: appId ?? resolvedAppId)), + ); + } + + /// Disables Wi-Fi. + Future disableWifi({String? appId}) async { + await _wrapRequest( + 'disableWifi', + () => _client.disableWiFi(WiFiRequest(appId: appId ?? resolvedAppId)), + ); + } + + /// Enables bluetooth. + Future enableBluetooth({String? appId}) async { + await _wrapRequest( + 'enableBluetooth', + () => _client.enableBluetooth( + BluetoothRequest(appId: appId ?? resolvedAppId), + ), + ); + } + + /// Disables bluetooth. + Future disableBluetooth({String? appId}) async { + await _wrapRequest( + 'disableBluetooth', + () => _client.disableBluetooth( + BluetoothRequest(appId: appId ?? resolvedAppId), + ), + ); + } + /// Taps on the native widget specified by [selector]. /// /// If the native widget is not found, an exception is thrown.