1/*
2 * Copyright (C) 2017 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
17package android.net.wifi.hotspot2;
18
19import android.os.Handler;
20
21/**
22 * Base class for provisioning callbacks. Should be extended by applications and set when calling
23 * {@link WifiManager#startSubscriptionProvisiong(OsuProvider, ProvisioningCallback, Handler)}.
24 *
25 * @hide
26 */
27public abstract class ProvisioningCallback {
28
29    /**
30     * The reason code for Provisioning Failure due to connection failure to OSU AP.
31     * @hide
32     */
33    public static final int OSU_FAILURE_AP_CONNECTION      = 1;
34
35    /**
36     * The reason code for Provisioning Failure due to connection failure to OSU AP.
37     * @hide
38     */
39    public static final int OSU_FAILURE_SERVER_URL_INVALID = 2;
40
41    /**
42     * The reason code for Provisioning Failure due to connection failure to OSU AP.
43     * @hide
44     */
45    public static final int OSU_FAILURE_SERVER_CONNECTION  = 3;
46
47    /**
48     * The reason code for Provisioning Failure due to connection failure to OSU AP.
49     * @hide
50     */
51    public static final int OSU_FAILURE_SERVER_VALIDATION  = 4;
52
53    /**
54     * The reason code for Provisioning Failure due to connection failure to OSU AP.
55     * @hide
56     */
57    public static final int OSU_FAILURE_PROVIDER_VERIFICATION = 5;
58
59    /**
60     * The reason code for Provisioning Failure when a provisioning flow is aborted.
61     * @hide
62     */
63    public static final int OSU_FAILURE_PROVISIONING_ABORTED = 6;
64
65    /**
66     * The reason code for Provisioning Failure when a provisioning flow is aborted.
67     * @hide
68     */
69    public static final int OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7;
70
71    /**
72     * The status code for Provisioning flow to indicate connecting to OSU AP
73     * @hide
74     */
75    public static final int OSU_STATUS_AP_CONNECTING       = 1;
76
77    /**
78     * The status code for Provisioning flow to indicate connected to OSU AP
79     * @hide
80     */
81    public static final int OSU_STATUS_AP_CONNECTED        = 2;
82
83    /**
84     * The status code for Provisioning flow to indicate connecting to OSU AP
85     * @hide
86     */
87    public static final int OSU_STATUS_SERVER_CONNECTED    = 3;
88
89    /**
90     * The status code for Provisioning flow to indicate connecting to OSU AP
91     * @hide
92     */
93    public static final int OSU_STATUS_SERVER_VALIDATED    = 4;
94
95    /**
96     * The status code for Provisioning flow to indicate connecting to OSU AP
97     * @hide
98     */
99    public static final int OSU_STATUS_PROVIDER_VERIFIED   = 5;
100
101    /**
102     * Provisioning status for OSU failure
103     * @param status indicates error condition
104     */
105    public abstract void onProvisioningFailure(int status);
106
107    /**
108     * Provisioning status when OSU is in progress
109     * @param status indicates status of OSU flow
110     */
111    public abstract void onProvisioningStatus(int status);
112}
113
114