Methods Summary |
---|
protected java.lang.String | composeChangeAnnouncement()
if (!mState.value) {
// We only announce when it's turned off to avoid vocal overflow.
return mContext.getString(R.string.accessibility_casting_turned_off);
}
return null;
|
public DetailAdapter | getDetailAdapter()
return mDetailAdapter;
|
private java.lang.String | getDeviceName(com.android.systemui.statusbar.policy.CastController.CastDevice device)
return device.name != null ? device.name
: mContext.getString(R.string.quick_settings_cast_device_default_name);
|
protected void | handleClick()
showDetail(true);
|
protected void | handleUpdateState(BooleanState state, java.lang.Object arg)
state.visible = !(mKeyguard.isSecure() && mKeyguard.isShowing());
state.label = mContext.getString(R.string.quick_settings_cast_title);
state.value = false;
state.autoMirrorDrawable = false;
final Set<CastDevice> devices = mController.getCastDevices();
boolean connecting = false;
for (CastDevice device : devices) {
if (device.state == CastDevice.STATE_CONNECTED) {
state.value = true;
state.label = getDeviceName(device);
} else if (device.state == CastDevice.STATE_CONNECTING) {
connecting = true;
}
}
if (!state.value && connecting) {
state.label = mContext.getString(R.string.quick_settings_connecting);
}
state.icon = ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on
: R.drawable.ic_qs_cast_off);
mDetailAdapter.updateItems(devices);
|
protected void | handleUserSwitch(int newUserId)
super.handleUserSwitch(newUserId);
if (mController == null) return;
mController.setCurrentUserId(newUserId);
|
protected BooleanState | newTileState()
return new BooleanState();
|
public void | setListening(boolean listening)
if (mController == null) return;
if (DEBUG) Log.d(TAG, "setListening " + listening);
if (listening) {
mController.addCallback(mCallback);
mKeyguard.addCallback(mCallback);
} else {
mController.setDiscovering(false);
mController.removeCallback(mCallback);
mKeyguard.removeCallback(mCallback);
}
|