Methods Summary |
---|
protected java.lang.String | composeChangeAnnouncement()
if (mState.enabled) {
return mContext.getString(R.string.accessibility_quick_settings_wifi_changed_on);
} else {
return mContext.getString(R.string.accessibility_quick_settings_wifi_changed_off);
}
|
public com.android.systemui.qs.QSTileView | createTileView(android.content.Context context)
return new SignalTileView(context);
|
public DetailAdapter | getDetailAdapter()
return mDetailAdapter;
|
protected void | handleClick()
mState.copyTo(mStateBeforeClick);
mController.setWifiEnabled(!mState.enabled);
|
protected void | handleSecondaryClick()
if (!mWifiController.canConfigWifi()) {
mHost.startSettingsActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
return;
}
if (!mState.enabled) {
mController.setWifiEnabled(true);
mState.enabled = true;
}
showDetail(true);
|
protected void | handleUpdateState(SignalState state, java.lang.Object arg)
state.visible = true;
if (DEBUG) Log.d(TAG, "handleUpdateState arg=" + arg);
if (arg == null) return;
CallbackInfo cb = (CallbackInfo) arg;
boolean wifiConnected = cb.enabled && (cb.wifiSignalIconId > 0) && (cb.enabledDesc != null);
boolean wifiNotConnected = (cb.wifiSignalIconId > 0) && (cb.enabledDesc == null);
boolean enabledChanging = state.enabled != cb.enabled;
if (enabledChanging) {
mDetailAdapter.setItemsVisible(cb.enabled);
fireToggleStateChanged(cb.enabled);
}
state.enabled = cb.enabled;
state.connected = wifiConnected;
state.activityIn = cb.enabled && cb.activityIn;
state.activityOut = cb.enabled && cb.activityOut;
state.filter = true;
final String signalContentDescription;
final Resources r = mContext.getResources();
if (!state.enabled) {
state.icon = ResourceIcon.get(R.drawable.ic_qs_wifi_disabled);
state.label = r.getString(R.string.quick_settings_wifi_label);
signalContentDescription = r.getString(R.string.accessibility_wifi_off);
} else if (wifiConnected) {
state.icon = ResourceIcon.get(cb.wifiSignalIconId);
state.label = removeDoubleQuotes(cb.enabledDesc);
signalContentDescription = cb.wifiSignalContentDescription;
} else if (wifiNotConnected) {
state.icon = ResourceIcon.get(R.drawable.ic_qs_wifi_0);
state.label = r.getString(R.string.quick_settings_wifi_label);
signalContentDescription = r.getString(R.string.accessibility_no_wifi);
} else {
state.icon = ResourceIcon.get(R.drawable.ic_qs_wifi_no_network);
state.label = r.getString(R.string.quick_settings_wifi_label);
signalContentDescription = r.getString(R.string.accessibility_wifi_off);
}
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_wifi,
signalContentDescription);
String wifiName = state.label;
if (state.connected) {
wifiName = r.getString(R.string.accessibility_wifi_name, state.label);
}
state.dualLabelContentDescription = wifiName;
|
protected SignalState | newTileState()
return new SignalState();
|
private static java.lang.String | removeDoubleQuotes(java.lang.String string)
if (string == null) return null;
final int length = string.length();
if ((length > 1) && (string.charAt(0) == '"") && (string.charAt(length - 1) == '"")) {
return string.substring(1, length - 1);
}
return string;
|
public void | setListening(boolean listening)
if (listening) {
mController.addNetworkSignalChangedCallback(mCallback);
mWifiController.addAccessPointCallback(mDetailAdapter);
} else {
mController.removeNetworkSignalChangedCallback(mCallback);
mWifiController.removeAccessPointCallback(mDetailAdapter);
}
|
protected boolean | shouldAnnouncementBeDelayed()
return mStateBeforeClick.enabled == mState.enabled;
|
public boolean | supportsDualTargets()
return true;
|