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 android.net.wifi.usd; 18 19 import android.annotation.FlaggedApi; 20 import android.annotation.NonNull; 21 import android.annotation.RequiresApi; 22 import android.annotation.SystemApi; 23 import android.net.wifi.flags.Flags; 24 import android.os.Build; 25 26 27 /** 28 * USD subscribe session callbacks. Should be extended by applications wanting notifications. 29 * 30 * @hide 31 */ 32 @RequiresApi(Build.VERSION_CODES.BAKLAVA) 33 @SystemApi 34 @FlaggedApi(Flags.FLAG_USD) 35 public class SubscribeSessionCallback extends SessionCallback { 36 37 /** 38 * Called when a subscribe session cannot be created. 39 * 40 * @param reason reason code as defined in {@code FAILURE_XXX} 41 */ onSubscribeFailed(@ailureCode int reason)42 public void onSubscribeFailed(@FailureCode int reason) { 43 } 44 45 /** 46 * Called when a subscribe operation is started successfully. 47 * 48 * @param session subscribe session 49 */ onSubscribeStarted(@onNull SubscribeSession session)50 public void onSubscribeStarted(@NonNull SubscribeSession session) { 51 } 52 53 /** 54 * Called when a subscribe operation results in a service discovery. 55 * 56 * @param discoveryResult A structure containing information of the discovery session and 57 * discovered peer 58 */ onServiceDiscovered(@onNull DiscoveryResult discoveryResult)59 public void onServiceDiscovered(@NonNull DiscoveryResult discoveryResult) { 60 } 61 } 62