Methods Summary |
---|
protected java.lang.String | composeChangeAnnouncement()
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_location_changed_on);
} else {
return mContext.getString(R.string.accessibility_quick_settings_location_changed_off);
}
|
protected void | handleClick()
final boolean wasEnabled = (Boolean) mState.value;
mController.setLocationEnabled(!wasEnabled);
mEnable.setAllowAnimation(true);
mDisable.setAllowAnimation(true);
|
protected void | handleUpdateState(BooleanState state, java.lang.Object arg)
final boolean locationEnabled = mController.isLocationEnabled();
// Work around for bug 15916487: don't show location tile on top of lock screen. After the
// bug is fixed, this should be reverted to only hiding it on secure lock screens:
// state.visible = !(mKeyguard.isSecure() && mKeyguard.isShowing());
state.visible = !mKeyguard.isShowing();
state.value = locationEnabled;
if (locationEnabled) {
state.icon = mEnable;
state.label = mContext.getString(R.string.quick_settings_location_label);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_location_on);
} else {
state.icon = mDisable;
state.label = mContext.getString(R.string.quick_settings_location_label);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_location_off);
}
|
protected BooleanState | newTileState()
return new BooleanState();
|
public void | setListening(boolean listening)
if (listening) {
mController.addSettingsChangedCallback(mCallback);
mKeyguard.addCallback(mCallback);
} else {
mController.removeSettingsChangedCallback(mCallback);
mKeyguard.removeCallback(mCallback);
}
|