Methods Summary |
---|
public void | cancel()Cancel the authorization request
sendMessage(obtainMessage(AUTH_CANCEL));
|
void | handleAuthRequest(LoadListener loader)Enqueues the loader, if the loader is the only element
in the queue, starts processing the loader
boolean processNext = false;
synchronized (mLoaderQueue) {
mLoaderQueue.offer(loader);
processNext =
(mLoaderQueue.size() == 1);
}
if (processNext) {
processNextLoader();
}
|
public void | handleMessage(android.os.Message msg)
LoadListener loader = null;
synchronized (mLoaderQueue) {
loader = mLoaderQueue.poll();
}
switch (msg.what) {
case AUTH_PROCEED:
String username = msg.getData().getString("username");
String password = msg.getData().getString("password");
loader.handleAuthResponse(username, password);
break;
case AUTH_CANCEL:
loader.handleAuthResponse(null, null);
break;
}
processNextLoader();
|
public void | proceed(java.lang.String username, java.lang.String password)Proceed with the authorization with the given credentials
Message msg = obtainMessage(AUTH_PROCEED);
msg.getData().putString("username", username);
msg.getData().putString("password", password);
sendMessage(msg);
|
private void | processNextLoader()Process the next loader in the queue (helper method)
LoadListener loader = null;
synchronized (mLoaderQueue) {
loader = mLoaderQueue.peek();
}
if (loader != null) {
CallbackProxy proxy = loader.getFrame().getCallbackProxy();
String hostname = loader.proxyAuthenticate() ?
mNetwork.getProxyHostname() : loader.host();
String realm = loader.realm();
proxy.onReceivedHttpAuthRequest(this, hostname, realm);
}
|
public boolean | useHttpAuthUsernamePassword()
LoadListener loader = null;
synchronized (mLoaderQueue) {
loader = mLoaderQueue.peek();
}
if (loader != null) {
return !loader.authCredentialsInvalid();
}
return false;
|