1 /* 2 * Copyright (C) 2024 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.android.server.uwb.rftest; 18 19 import android.os.PersistableBundle; 20 21 /** 22 * Interface representing a generic RF Notification event in UWB (Ultra-Wideband) testing. 23 * This interface provides methods to retrieve the raw notification data, status, 24 * operation type, and a conversion to a {@link PersistableBundle} for further processing. 25 * 26 * Implementations of this interface will represent specific types of RF test results 27 * and provide the relevant data and functionality required for handling UWB test notifications. 28 */ 29 public interface RfNotificationEvent { 30 31 /** 32 * Retrieves the raw notification data associated with this RF notification event. 33 * 34 * @return a byte array containing the raw notification data. 35 */ getRawNotificationData()36 byte[] getRawNotificationData(); 37 38 /** 39 * Retrieves the status of the RF notification event. 40 * The status typically indicates the result of the test operation. 41 * 42 * @return an integer representing the status of the RF notification event. 43 */ getStatus()44 int getStatus(); 45 46 /** 47 * Retrieves the operation type associated with this RF notification event. 48 * The operation type indicates the type of test being performed. 49 * 50 * @return an integer representing the RF test operation type. 51 */ getOperationType()52 int getOperationType(); 53 54 /** 55 * Converts this RF notification event to a {@link PersistableBundle}. 56 * The bundle can be used for further processing or passing data to other components. 57 * 58 * @return a {@link PersistableBundle} containing the data of this RF notification event. 59 */ toBundle()60 PersistableBundle toBundle(); 61 } 62 63