Add "Show taps" to development quick settings.

Add "Show taps" tile to development quick setting to allow
developers to quickly turn it on/off.

Bug: 151812916
Test: Settings->System->Developer options->Quick settings developer
tiles->Show taps.

Change-Id: I8bea76dfa6be6970feadb371a4f36b9b4f326251
This commit is contained in:
Chris Ye
2020-06-11 17:57:16 -07:00
parent 6e57b15b2a
commit 39b586ff53
3 changed files with 65 additions and 0 deletions

View File

@@ -432,4 +432,31 @@ public abstract class DevelopmentTiles extends TileService {
enabled ? ADB_SETTING_ON : ADB_SETTING_OFF);
}
}
/**
* Tile to control the "Show taps" developer setting
*/
public static class ShowTaps extends DevelopmentTiles {
private static final int SETTING_VALUE_ON = 1;
private static final int SETTING_VALUE_OFF = 0;
private Context mContext;
@Override
public void onCreate() {
super.onCreate();
mContext = getApplicationContext();
}
@Override
protected boolean isEnabled() {
return Settings.System.getInt(mContext.getContentResolver(),
Settings.System.SHOW_TOUCHES, SETTING_VALUE_OFF) == SETTING_VALUE_ON;
}
@Override
protected void setIsEnabled(boolean isEnabled) {
Settings.System.putInt(mContext.getContentResolver(),
Settings.System.SHOW_TOUCHES, isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF);
}
}
}