more code formatting
This commit is contained in:
@@ -63,10 +63,11 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback<Bundle> {
|
||||
private final WebView mWebView;
|
||||
|
||||
/**
|
||||
* This listener is invoked when an item in the account list is selected. (It is also used when the 'cancel' button
|
||||
* is clicked, (in which case `index` is <0)
|
||||
* This listener is invoked when an item in the account list is selected.
|
||||
* (It is also used when the 'cancel' button is clicked, (in which case `index` is <0)
|
||||
*/
|
||||
private final DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
|
||||
private final DialogInterface.OnClickListener onClickListener =
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int index) {
|
||||
if (index >= 0 && index < mAccounts.length) {
|
||||
@@ -77,7 +78,8 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback<Bundle> {
|
||||
}
|
||||
};
|
||||
|
||||
public IITC_DeviceAccountLogin(IITC_Mobile activity, WebView webView, WebViewClient webViewClient) {
|
||||
public IITC_DeviceAccountLogin(IITC_Mobile activity, WebView webView,
|
||||
WebViewClient webViewClient) {
|
||||
mActivity = activity;
|
||||
mWebView = webView;
|
||||
mAccountManager = AccountManager.get(activity);
|
||||
@@ -142,16 +144,17 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback<Bundle> {
|
||||
try {
|
||||
Intent launch = (Intent) value.getResult().get(AccountManager.KEY_INTENT);
|
||||
if (launch != null) {
|
||||
// There is a reason we need to start the given activity if we want an authentication token.
|
||||
// (Could be user confirmation or something else. Whatever, we have to start it)
|
||||
// IITC_Mobile will call it using startActivityForResult
|
||||
// There is a reason we need to start the given activity if we want an
|
||||
// authentication token. (Could be user confirmation or something else. Whatever,
|
||||
// we have to start it) IITC_Mobile will call it using startActivityForResult
|
||||
mActivity.startLoginActivity(launch);
|
||||
return;
|
||||
}
|
||||
|
||||
String result = value.getResult().getString(AccountManager.KEY_AUTHTOKEN);
|
||||
if (result != null) {
|
||||
// authentication succeded, we can load the given url, which will redirect back to the intel map
|
||||
// authentication succeded, we can load the given url, which will redirect
|
||||
// back to the intel map
|
||||
mWebView.loadUrl(result);
|
||||
mActivity.loginSucceeded();
|
||||
} else {
|
||||
@@ -165,8 +168,8 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback<Bundle> {
|
||||
/**
|
||||
* start authentication
|
||||
* <p/>
|
||||
* if we already have a username (e.g. because the existing login has timed out), we can directly start
|
||||
* authentication if an account with that username is found.
|
||||
* if we already have a username (e.g. because the existing login has timed out),
|
||||
* we can directly start authentication if an account with that username is found.
|
||||
*/
|
||||
public void startLogin(String realm, String accountName, String args) {
|
||||
mAccounts = mAccountManager.getAccountsByType(realm);
|
||||
|
Reference in New Issue
Block a user