• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 com.google.uwb.support.generic;
18 
19 import android.os.Build.VERSION_CODES;
20 import android.os.PersistableBundle;
21 
22 import androidx.annotation.RequiresApi;
23 
24 import com.google.uwb.support.base.FlagEnum;
25 import com.google.uwb.support.base.Params;
26 
27 @RequiresApi(VERSION_CODES.LOLLIPOP)
28 public abstract class GenericParams extends Params {
29     public static final String PROTOCOL_NAME = "generic";
30 
31     @Override
getProtocolName()32     public final String getProtocolName() {
33         return PROTOCOL_NAME;
34     }
35 
isCorrectProtocol(PersistableBundle bundle)36     public static boolean isCorrectProtocol(PersistableBundle bundle) {
37         return isProtocol(bundle, PROTOCOL_NAME);
38     }
39 
40     public enum AntennaModeCapabilityFlag implements FlagEnum {
41         HAS_OMNI_MODE_SUPPORT(1),
42         HAS_DIRECTIONAL_MODE_SUPPORT(1 << 1);
43 
44         private final long mValue;
45 
AntennaModeCapabilityFlag(long value)46         AntennaModeCapabilityFlag(long value) {
47             mValue = value;
48         }
49 
50         @Override
getValue()51         public long getValue() {
52             return mValue;
53         }
54     }
55 }
56