Methods Summary |
---|
public com.android.systemui.qs.QSTileView | createTileView(android.content.Context context)
return new SignalTileView(context);
|
public DetailAdapter | getDetailAdapter()
return mDetailAdapter;
|
protected void | handleClick()
if (mDataController.isMobileDataSupported()) {
showDetail(true);
} else {
mHost.startSettingsActivity(CELLULAR_SETTINGS);
}
|
protected void | handleUpdateState(SignalState state, java.lang.Object arg)
state.visible = mController.hasMobileDataFeature();
if (!state.visible) return;
final CallbackInfo cb = (CallbackInfo) arg;
if (cb == null) return;
final Resources r = mContext.getResources();
final int iconId = cb.noSim ? R.drawable.ic_qs_no_sim
: !cb.enabled || cb.airplaneModeEnabled ? R.drawable.ic_qs_signal_disabled
: cb.mobileSignalIconId > 0 ? cb.mobileSignalIconId
: R.drawable.ic_qs_signal_no_signal;
state.icon = ResourceIcon.get(iconId);
state.isOverlayIconWide = cb.isDataTypeIconWide;
state.autoMirrorDrawable = !cb.noSim;
state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) ? cb.dataTypeIconId : 0;
state.filter = iconId != R.drawable.ic_qs_no_sim;
state.activityIn = cb.enabled && cb.activityIn;
state.activityOut = cb.enabled && cb.activityOut;
state.label = cb.enabled
? removeTrailingPeriod(cb.enabledDesc)
: r.getString(R.string.quick_settings_rssi_emergency_only);
final String signalContentDesc = cb.enabled && (cb.mobileSignalIconId > 0)
? cb.signalContentDescription
: r.getString(R.string.accessibility_no_signal);
final String dataContentDesc = cb.enabled && (cb.dataTypeIconId > 0) && !cb.wifiEnabled
? cb.dataContentDescription
: r.getString(R.string.accessibility_no_data);
state.contentDescription = r.getString(
R.string.accessibility_quick_settings_mobile,
signalContentDesc, dataContentDesc,
state.label);
|
protected SignalState | newTileState()
return new SignalState();
|
public static java.lang.String | removeTrailingPeriod(java.lang.String string)
if (string == null) return null;
final int length = string.length();
if (string.endsWith(".")) {
return string.substring(0, length - 1);
}
return string;
|
public void | setListening(boolean listening)
if (listening) {
mController.addNetworkSignalChangedCallback(mCallback);
} else {
mController.removeNetworkSignalChangedCallback(mCallback);
}
|