Methods Summary |
---|
protected java.lang.String | composeChangeAnnouncement()
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_hotspot_changed_on);
} else {
return mContext.getString(R.string.accessibility_quick_settings_hotspot_changed_off);
}
|
protected void | handleClick()
final boolean isEnabled = (Boolean) mState.value;
mController.setHotspotEnabled(!isEnabled);
mEnable.setAllowAnimation(true);
mDisable.setAllowAnimation(true);
|
protected void | handleDestroy()
super.handleDestroy();
mUsageTracker.setListening(false);
|
protected void | handleLongClick()
if (mState.value) return; // don't allow usage reset if hotspot is active
final String title = mContext.getString(R.string.quick_settings_reset_confirmation_title,
mState.label);
mUsageTracker.showResetConfirmation(title, new Runnable() {
@Override
public void run() {
refreshState();
}
});
|
protected void | handleUpdateState(BooleanState state, java.lang.Object arg)
state.visible = mController.isHotspotSupported() && mUsageTracker.isRecentlyUsed();
state.label = mContext.getString(R.string.quick_settings_hotspot_label);
state.value = mController.isHotspotEnabled();
state.icon = state.visible && state.value ? mEnable : mDisable;
|
protected BooleanState | newTileState()
return new BooleanState();
|
private static com.android.systemui.qs.UsageTracker | newUsageTracker(android.content.Context context)
return new UsageTracker(context, HotspotTile.class, R.integer.days_to_show_hotspot_tile);
|
public void | setListening(boolean listening)
if (listening) {
mController.addCallback(mCallback);
} else {
mController.removeCallback(mCallback);
}
|