Methods Summary |
---|
protected java.lang.String | composeChangeAnnouncement()
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_bluetooth_changed_on);
} else {
return mContext.getString(R.string.accessibility_quick_settings_bluetooth_changed_off);
}
|
public DetailAdapter | getDetailAdapter()
return mDetailAdapter;
|
protected void | handleClick()
final boolean isEnabled = (Boolean)mState.value;
mController.setBluetoothEnabled(!isEnabled);
|
protected void | handleSecondaryClick()
if (!mState.value) {
mState.value = true;
mController.setBluetoothEnabled(true);
}
showDetail(true);
|
protected void | handleUpdateState(BooleanState state, java.lang.Object arg)
final boolean supported = mController.isBluetoothSupported();
final boolean enabled = mController.isBluetoothEnabled();
final boolean connected = mController.isBluetoothConnected();
final boolean connecting = mController.isBluetoothConnecting();
state.visible = supported;
state.value = enabled;
state.autoMirrorDrawable = false;
if (enabled) {
state.label = null;
if (connected) {
state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_connected);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_bluetooth_connected);
state.label = mController.getLastDeviceName();
} else if (connecting) {
state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_connecting);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_bluetooth_connecting);
state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
} else {
state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_on);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_bluetooth_on);
}
if (TextUtils.isEmpty(state.label)) {
state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
}
} else {
state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_off);
state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_bluetooth_off);
}
String bluetoothName = state.label;
if (connected) {
bluetoothName = state.dualLabelContentDescription = mContext.getString(
R.string.accessibility_bluetooth_name, state.label);
}
state.dualLabelContentDescription = bluetoothName;
|
protected BooleanState | newTileState()
return new BooleanState();
|
public void | setListening(boolean listening)
if (listening) {
mController.addStateChangedCallback(mCallback);
} else {
mController.removeStateChangedCallback(mCallback);
}
|
public boolean | supportsDualTargets()
return true;
|