1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.core.uwb.backend.impl.internal; 18 19 import androidx.annotation.IntDef; 20 21 /** Callback for UWB availability change events. */ 22 public interface UwbAvailabilityCallback { onUwbAvailabilityChanged(boolean isUwbAvailable, int reason)23 void onUwbAvailabilityChanged(boolean isUwbAvailable, int reason); 24 25 /** Reason why UWB state changed */ 26 @IntDef({ 27 /* The state has changed because of an unknown reason */ 28 REASON_UNKNOWN, 29 30 /* The state has changed because UWB is turned on/off */ 31 REASON_SYSTEM_POLICY, 32 33 /* 34 * The state has changed either because no country code has been configured or due to 35 * UWB being 36 * unavailable as a result of regulatory constraints. 37 */ 38 REASON_COUNTRY_CODE_ERROR, 39 }) 40 @interface UwbStateChangeReason { 41 } 42 43 int REASON_UNKNOWN = 0; 44 int REASON_SYSTEM_POLICY = 1; 45 int REASON_COUNTRY_CODE_ERROR = 2; 46 } 47 48