FileDocCategorySizeDatePackage
WifiStatus.javaAPI DocAndroid 1.5 API3963Wed May 06 22:42:48 BST 2009com.android.settings.wifi

WifiStatus

public class WifiStatus extends Object

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringgetPrintable(android.content.Context context, NetworkInfo.DetailedState detailedState)

        
        switch (detailedState) {
            case AUTHENTICATING:
                return context.getString(R.string.status_authenticating);
            case CONNECTED:
                return context.getString(R.string.status_connected);
            case CONNECTING:
                return context.getString(R.string.status_connecting);
            case DISCONNECTED:
                return context.getString(R.string.status_disconnected);
            case DISCONNECTING:
                return context.getString(R.string.status_disconnecting);
            case FAILED:
                return context.getString(R.string.status_failed);
            case OBTAINING_IPADDR:
                return context.getString(R.string.status_obtaining_ip);
            case SCANNING:
                return context.getString(R.string.status_scanning);
            default:
                return null;
        }
    
public static java.lang.StringgetPrintableFragment(android.content.Context context, NetworkInfo.DetailedState detailedState, java.lang.String apName)

        
        String fragment = null;
        switch (detailedState) {
            case AUTHENTICATING:
                fragment = context.getString(R.string.fragment_status_authenticating);
                break;
            case CONNECTED:
                fragment = context.getString(R.string.fragment_status_connected);
                break;
            case CONNECTING:
                fragment = context.getString(R.string.fragment_status_connecting);
                break;
            case DISCONNECTED:
                fragment = context.getString(R.string.fragment_status_disconnected);
                break;
            case DISCONNECTING:
                fragment = context.getString(R.string.fragment_status_disconnecting);
                break;
            case FAILED:
                fragment = context.getString(R.string.fragment_status_failed);
                break;
            case OBTAINING_IPADDR:
                fragment = context.getString(R.string.fragment_status_obtaining_ip);
                break;
            case SCANNING:
                fragment = context.getString(R.string.fragment_status_scanning);
                break;
        }
        
        return String.format(fragment, apName);
    
public static java.lang.StringgetStatus(android.content.Context context, java.lang.String ssid, NetworkInfo.DetailedState detailedState)

        
        if (!TextUtils.isEmpty(ssid) && isLiveConnection(detailedState)) {
            return getPrintableFragment(context, detailedState, ssid);
        } else {
            return getPrintable(context, detailedState);
        }
    
public static booleanisLiveConnection(NetworkInfo.DetailedState detailedState)

        return detailedState != NetworkInfo.DetailedState.DISCONNECTED
                && detailedState != NetworkInfo.DetailedState.FAILED
                && detailedState != NetworkInfo.DetailedState.IDLE
                && detailedState != NetworkInfo.DetailedState.SCANNING;