1package com.android.hotspot2.osu;
2
3import android.net.Network;
4
5import java.net.URL;
6
7public interface UserInputListener {
8    /**
9     * Launch an appropriate application to handle user input and HTTP exchanges to the target
10     * URL. Under normal circumstances this implies that a web-browser is started and pointed at
11     * the target URL from which it is supposed to perform an initial HTTP GET operation.
12     * This call must not block beyond the time it takes to launch the user agent, i.e. must return
13     * well before the HTTP exchange terminates.
14     * @param target A fully encoded URL to which to send an initial HTTP GET and then handle
15     *               subsequent HTTP exchanges.
16     * @param endRedirect A URL to which the user agent will be redirected upon completion of
17     *                    the HTTP exchange. This parameter is for informational purposes only
18     *                    as the redirect to the URL is the responsibility of the remote server.
19     */
20    public void requestUserInput(URL target, Network network, URL endRedirect);
21
22    /**
23     * Notification that status of the OSU operation has changed. The implementation may choose to
24     * return a string that will be passed to the user agent. Please note that the string is
25     * passed as the payload of (the redirect) HTTP connection to the agent and must be formatted
26     * appropriately (e.g. as well formed HTML).
27     * Returning a null string on the initial status update of UserInputComplete or UserInputAborted
28     * will cause the local "redirect" web-server to terminate and any further strings returned will
29     * be ignored.
30     * If programmatic termination of the user agent is desired, it should be initiated from within
31     * the implementation of this method.
32     * @param status
33     * @param message
34     * @return
35     */
36    public String operationStatus(String spIdentity, OSUOperationStatus status, String message);
37
38    /**
39     * Notify the user that a de-authentication event is imminent.
40     * @param ess set to indicate that the de-authentication is for an ESS instead of a BSS
41     * @param delay delay the number of seconds that the user will have to wait before
42     *              reassociating with the BSS or ESS.
43     * @param url a URL to which to redirect the user
44     */
45    public void deAuthNotification(String spIdentity, boolean ess, int delay, URL url);
46}
47