diff --git a/core/java/android/uwb/RangingParams.java b/core/java/android/uwb/RangingParams.java new file mode 100644 index 0000000000000..9727696f03911 --- /dev/null +++ b/core/java/android/uwb/RangingParams.java @@ -0,0 +1,175 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.uwb; + +import android.annotation.IntDef; +import android.annotation.NonNull; +import android.annotation.Nullable; +import android.os.PersistableBundle; +import android.util.Duration; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.util.List; + +/** + * An object used when requesting to open a new {@link RangingSession}. + *
Use {@link RangingParams.Builder} to create an instance of this class. + * + * @hide + */ +public final class RangingParams { + /** + * Standard builder interface as the class is not modifiable + */ + public static class Builder { + // TODO implement + } + + /** + * Get if the local device is the initiator + * + * @return true if the device is the initiator + */ + public boolean isInitiator() { + throw new UnsupportedOperationException(); + } + + /** + * Get if the local device is the controller + * + * @return true if the device is the controller + */ + public boolean isController() { + throw new UnsupportedOperationException(); + } + + /** + * The desired amount of time between two adjacent samples of measurement + * + * @return the ranging sample period + */ + @NonNull + public Duration getSamplingPeriod() { + throw new UnsupportedOperationException(); + } + + /** + * Local device's {@link UwbAddress} + * + *
Simultaneous {@link RangingSession}s on the same device can have different results for
+ * {@link #getLocalDeviceAddress()}.
+ *
+ * @return the local device's {@link UwbAddress}
+ */
+ @NonNull
+ public UwbAddress getLocalDeviceAddress() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Gets a list of all remote device's {@link UwbAddress}
+ *
+ * @return a {@link List} of {@link UwbAddress} representing the remote devices
+ */
+ @NonNull
+ public List Android reserves the '^android.*' namespace
+ *
+ * @return a {@link PersistableBundle} of protocol specific parameters
+ */
+ public @Nullable PersistableBundle getSpecificationParameters() {
+ throw new UnsupportedOperationException();
+ }
+}