summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-05-12 15:26:23 -0700
committerAlan Viverette <alanv@google.com>2014-05-12 15:26:23 -0700
commitcfd9d7eec23159c06faccf62d12d9a117a3067ef (patch)
tree89d4f44759b3e5bb4035076edc52992342687632 /packages/SystemUI/src
parent1cb088c1281deec042bdf00e0f2d227f7e5cd718 (diff)
downloadframeworks_base-cfd9d7eec23159c06faccf62d12d9a117a3067ef.zip
frameworks_base-cfd9d7eec23159c06faccf62d12d9a117a3067ef.tar.gz
frameworks_base-cfd9d7eec23159c06faccf62d12d9a117a3067ef.tar.bz2
Simplify accessibility display adjustments in Quick Settings
BUG: 14680114 Change-Id: Ie79aabda8ddf8cd47a556b1b11f6c9e717f99649
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java80
2 files changed, 0 insertions, 88 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
index f3ebf1b..8ce7279 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
@@ -323,14 +323,6 @@ class QuickSettings {
mModel.addInversionTile(inversionTile, inversionTile.getRefreshCallback());
parent.addView(inversionTile);
- // Contrast enhancement tile
- final SystemSettingTile contrastTile = new SystemSettingTile(mContext);
- contrastTile.setUri(Settings.Secure.ACCESSIBILITY_DISPLAY_CONTRAST_ENABLED,
- SystemSettingTile.TYPE_SECURE);
- contrastTile.setFragment("Settings$AccessibilityContrastSettingsActivity");
- mModel.addContrastTile(contrastTile, contrastTile.getRefreshCallback());
- parent.addView(contrastTile);
-
// Color space adjustment tile
final SystemSettingTile colorSpaceTile = new SystemSettingTile(mContext);
colorSpaceTile.setUri(Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
index 005b0d1..9b90d3d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
@@ -95,12 +95,6 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
}
static class InversionState extends State {
boolean toggled;
- int type;
- }
- static class ContrastState extends State {
- boolean toggled;
- float contrast;
- float brightness;
}
static class ColorSpaceState extends State {
boolean toggled;
@@ -237,38 +231,6 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
cr.registerContentObserver(Settings.Secure.getUriFor(
Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_QUICK_SETTING_ENABLED),
false, this, mUserTracker.getCurrentUserId());
- cr.registerContentObserver(Settings.Secure.getUriFor(
- Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION),
- false, this, mUserTracker.getCurrentUserId());
- }
- }
-
- /** ContentObserver to watch display contrast */
- private class DisplayContrastObserver extends ContentObserver {
- public DisplayContrastObserver(Handler handler) {
- super(handler);
- }
-
- @Override
- public void onChange(boolean selfChange) {
- onContrastChanged();
- }
-
- public void startObserving() {
- final ContentResolver cr = mContext.getContentResolver();
- cr.unregisterContentObserver(this);
- cr.registerContentObserver(Settings.Secure.getUriFor(
- Settings.Secure.ACCESSIBILITY_DISPLAY_CONTRAST_ENABLED),
- false, this, mUserTracker.getCurrentUserId());
- cr.registerContentObserver(Settings.Secure.getUriFor(
- Settings.Secure.ACCESSIBILITY_DISPLAY_CONTRAST_QUICK_SETTING_ENABLED),
- false, this, mUserTracker.getCurrentUserId());
- cr.registerContentObserver(Settings.Secure.getUriFor(
- Settings.Secure.ACCESSIBILITY_DISPLAY_CONTRAST),
- false, this, mUserTracker.getCurrentUserId());
- cr.registerContentObserver(Settings.Secure.getUriFor(
- Settings.Secure.ACCESSIBILITY_DISPLAY_BRIGHTNESS),
- false, this, mUserTracker.getCurrentUserId());
}
}
@@ -348,7 +310,6 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
private final BugreportObserver mBugreportObserver;
private final BrightnessObserver mBrightnessObserver;
private final DisplayInversionObserver mInversionObserver;
- private final DisplayContrastObserver mContrastObserver;
private final DisplayColorSpaceObserver mColorSpaceObserver;
private final ZenModeObserver mZenModeObserver;
@@ -417,10 +378,6 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
private RefreshCallback mInversionCallback;
private InversionState mInversionState = new InversionState();
- private QuickSettingsTileView mContrastTile;
- private RefreshCallback mContrastCallback;
- private ContrastState mContrastState = new ContrastState();
-
private QuickSettingsTileView mColorSpaceTile;
private RefreshCallback mColorSpaceCallback;
private ColorSpaceState mColorSpaceState = new ColorSpaceState();
@@ -448,12 +405,10 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
public void onUserSwitched(int newUserId) {
mBrightnessObserver.startObserving();
mInversionObserver.startObserving();
- mContrastObserver.startObserving();
mColorSpaceObserver.startObserving();
refreshRotationLockTile();
onBrightnessLevelChanged();
onInversionChanged();
- onContrastChanged();
onColorSpaceChanged();
onNextAlarmChanged();
onBugreportChanged();
@@ -470,8 +425,6 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
mBrightnessObserver.startObserving();
mInversionObserver = new DisplayInversionObserver(mHandler);
mInversionObserver.startObserving();
- mContrastObserver = new DisplayContrastObserver(mHandler);
- mContrastObserver.startObserving();
mColorSpaceObserver = new DisplayColorSpaceObserver(mHandler);
mColorSpaceObserver.startObserving();
mZenModeObserver = new ZenModeObserver(mHandler);
@@ -1037,11 +990,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
currentUserId) == 1;
final boolean enabled = Settings.Secure.getIntForUser(
cr, Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 0, currentUserId) == 1;
- final int type = Settings.Secure.getIntForUser(
- cr, Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION, 0, currentUserId);
mInversionState.enabled = quickSettingEnabled;
mInversionState.toggled = enabled;
- mInversionState.type = type;
// TODO: Add real icon assets.
mInversionState.iconId = enabled ? R.drawable.ic_qs_inversion_on
: R.drawable.ic_qs_inversion_off;
@@ -1049,36 +999,6 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
mInversionCallback.refreshView(mInversionTile, mInversionState);
}
- // Contrast enhancement
- void addContrastTile(QuickSettingsTileView view, RefreshCallback cb) {
- mContrastTile = view;
- mContrastCallback = cb;
- onContrastChanged();
- }
- public void onContrastChanged() {
- final Resources res = mContext.getResources();
- final ContentResolver cr = mContext.getContentResolver();
- final int currentUserId = mUserTracker.getCurrentUserId();
- final boolean quickSettingEnabled = Settings.Secure.getIntForUser(
- cr, Settings.Secure.ACCESSIBILITY_DISPLAY_CONTRAST_QUICK_SETTING_ENABLED, 0,
- currentUserId) == 1;
- final boolean enabled = Settings.Secure.getIntForUser(
- cr, Settings.Secure.ACCESSIBILITY_DISPLAY_CONTRAST_ENABLED, 0, currentUserId) == 1;
- final float contrast = Settings.Secure.getFloatForUser(
- cr, Settings.Secure.ACCESSIBILITY_DISPLAY_CONTRAST, 1, currentUserId);
- final float brightness = Settings.Secure.getFloatForUser(
- cr, Settings.Secure.ACCESSIBILITY_DISPLAY_BRIGHTNESS, 0, currentUserId);
- mContrastState.enabled = quickSettingEnabled;
- mContrastState.toggled = enabled;
- mContrastState.contrast = contrast;
- mContrastState.brightness = brightness;
- // TODO: Add real icon assets.
- mContrastState.iconId = enabled ? R.drawable.ic_qs_contrast_on
- : R.drawable.ic_qs_contrast_off;
- mContrastState.label = res.getString(R.string.quick_settings_contrast_label);
- mContrastCallback.refreshView(mContrastTile, mContrastState);
- }
-
// Color space adjustment
void addColorSpaceTile(QuickSettingsTileView view, RefreshCallback cb) {
mColorSpaceTile = view;