summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2015-11-12 10:52:11 -0800
committerDanesh M <daneshm90@gmail.com>2015-11-12 11:18:21 -0800
commit11feb561aa1b34263ce200d696a02c0e6f8234a5 (patch)
treeda0f1c457f038ee64d8afd7008595ab0d77da762 /packages/SystemUI/src
parentaa782a28f1a75c3d9bdfdc23b5aa29f039fe085b (diff)
downloadframeworks_base-11feb561aa1b34263ce200d696a02c0e6f8234a5.zip
frameworks_base-11feb561aa1b34263ce200d696a02c0e6f8234a5.tar.gz
frameworks_base-11feb561aa1b34263ce200d696a02c0e6f8234a5.tar.bz2
Framework : Move System settings to CMSettings
Change-Id: I4e9fb06db7b9ba05e4a7bbe11916bb2271af4727
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/settings/NotificationBrightnessController.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java8
6 files changed, 35 insertions, 25 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 24cc396..3755a01 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -47,6 +47,8 @@ import com.android.systemui.statusbar.policy.BrightnessMirrorController;
import java.util.ArrayList;
import java.util.Collection;
+import cyanogenmod.providers.CMSettings;
+
/** View that represents the quick settings tile panel. **/
public class QSPanel extends ViewGroup {
private static final float TILE_ASPECT = 1.2f;
@@ -124,8 +126,8 @@ public class QSPanel extends ViewGroup {
* Enable/disable brightness slider.
*/
private boolean showBrightnessSlider() {
- boolean brightnessSliderEnabled = Settings.System.getIntForUser(
- mContext.getContentResolver(), Settings.System.QS_SHOW_BRIGHTNESS_SLIDER,
+ boolean brightnessSliderEnabled = CMSettings.System.getIntForUser(
+ mContext.getContentResolver(), CMSettings.System.QS_SHOW_BRIGHTNESS_SLIDER,
1, UserHandle.USER_CURRENT) == 1;
ToggleSlider brightnessSlider = (ToggleSlider) findViewById(R.id.brightness_slider);
if (brightnessSliderEnabled) {
diff --git a/packages/SystemUI/src/com/android/systemui/settings/NotificationBrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/NotificationBrightnessController.java
index 61abbb2..0637ff4 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/NotificationBrightnessController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/NotificationBrightnessController.java
@@ -31,6 +31,8 @@ import android.provider.Settings;
import java.lang.Exception;
import java.util.ArrayList;
+import cyanogenmod.providers.CMSettings;
+
public class NotificationBrightnessController implements ToggleSlider.Listener {
private static final String TAG = "StatusBar.NotificationBrightnessController";
@@ -66,7 +68,7 @@ public class NotificationBrightnessController implements ToggleSlider.Listener {
private class NotificationBrightnessObserver extends ContentObserver {
private final Uri NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL_URI =
- Settings.System.getUriFor(Settings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL);
+ CMSettings.System.getUriFor(CMSettings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL);
public NotificationBrightnessObserver(Handler handler) {
super(handler);
@@ -175,8 +177,8 @@ public class NotificationBrightnessController implements ToggleSlider.Listener {
mNotificationManager.cancel(1);
mListening = false;
- Settings.System.putIntForUser(mContext.getContentResolver(),
- Settings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL,
+ CMSettings.System.putIntForUser(mContext.getContentResolver(),
+ CMSettings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL,
mCurrentBrightness, UserHandle.USER_CURRENT);
}
@@ -195,12 +197,12 @@ public class NotificationBrightnessController implements ToggleSlider.Listener {
/** Fetch the brightness from the system settings and update the slider */
private void updateSlider() {
- mCurrentBrightness = Settings.System.getIntForUser(mContext.getContentResolver(),
- Settings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL,
+ mCurrentBrightness = CMSettings.System.getIntForUser(mContext.getContentResolver(),
+ CMSettings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL,
mMaximumBrightness, UserHandle.USER_CURRENT);
- Settings.System.putIntForUser(mContext.getContentResolver(),
- Settings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL,
+ CMSettings.System.putIntForUser(mContext.getContentResolver(),
+ CMSettings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL,
mMaximumBrightness, UserHandle.USER_CURRENT);
mControl.setMax(mMaximumBrightness - mMinimumBrightness);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index b109f96..4371cce 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -43,6 +43,8 @@ import com.android.systemui.cm.UserContentObserver;
import java.text.NumberFormat;
import java.util.ArrayList;
+import cyanogenmod.providers.CMSettings;
+
public class StatusBarIconView extends AnimatedImageView {
private static final String TAG = "StatusBarIconView";
@@ -87,8 +89,8 @@ public class StatusBarIconView extends AnimatedImageView {
public void setNotification(Notification notification) {
mNotification = notification;
- mShowNotificationCount = Settings.System.getIntForUser(mContext.getContentResolver(),
- Settings.System.STATUS_BAR_NOTIF_COUNT, 0, UserHandle.USER_CURRENT) == 1;
+ mShowNotificationCount = CMSettings.System.getIntForUser(mContext.getContentResolver(),
+ CMSettings.System.STATUS_BAR_NOTIF_COUNT, 0, UserHandle.USER_CURRENT) == 1;
setContentDescription(notification);
}
@@ -372,7 +374,7 @@ public class StatusBarIconView extends AnimatedImageView {
super.observe();
mContext.getContentResolver().registerContentObserver(
- Settings.System.getUriFor(Settings.System.STATUS_BAR_NOTIF_COUNT),
+ CMSettings.System.getUriFor(CMSettings.System.STATUS_BAR_NOTIF_COUNT),
false, this);
}
@@ -385,8 +387,8 @@ public class StatusBarIconView extends AnimatedImageView {
@Override
public void update() {
- boolean showIconCount = Settings.System.getIntForUser(mContext.getContentResolver(),
- Settings.System.STATUS_BAR_NOTIF_COUNT, 0, UserHandle.USER_CURRENT) == 1;
+ boolean showIconCount = CMSettings.System.getIntForUser(mContext.getContentResolver(),
+ CMSettings.System.STATUS_BAR_NOTIF_COUNT, 0, UserHandle.USER_CURRENT) == 1;
for (StatusBarIconView sbiv : mIconViews) {
sbiv.mShowNotificationCount = showIconCount;
sbiv.set(sbiv.mIcon, true);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 548e8a6..206bf44 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -74,6 +74,8 @@ import cyanogenmod.providers.CMSettings;
import java.util.List;
+import cyanogenmod.providers.CMSettings;
+
public class NotificationPanelView extends PanelView implements
ExpandableView.OnHeightChangedListener, ObservableScrollView.Listener,
View.OnClickListener, NotificationStackScrollLayout.OnOverscrollTopChangedListener,
@@ -2443,8 +2445,8 @@ public class NotificationPanelView extends PanelView implements
void observe() {
ContentResolver resolver = mContext.getContentResolver();
- resolver.registerContentObserver(Settings.System.getUriFor(
- Settings.System.STATUS_BAR_QUICK_QS_PULLDOWN), false, this);
+ resolver.registerContentObserver(CMSettings.System.getUriFor(
+ CMSettings.System.STATUS_BAR_QUICK_QS_PULLDOWN), false, this);
resolver.registerContentObserver(CMSettings.System.getUriFor(
CMSettings.System.DOUBLE_TAP_SLEEP_GESTURE), false, this);
update();
@@ -2467,8 +2469,8 @@ public class NotificationPanelView extends PanelView implements
public void update() {
ContentResolver resolver = mContext.getContentResolver();
- mOneFingerQuickSettingsIntercept = Settings.System.getInt(
- resolver, Settings.System.STATUS_BAR_QUICK_QS_PULLDOWN, 1) == 1;
+ mOneFingerQuickSettingsIntercept = CMSettings.System.getInt(
+ resolver, CMSettings.System.STATUS_BAR_QUICK_QS_PULLDOWN, 1) == 1;
mDoubleTapToSleepEnabled = CMSettings.System.getInt(
resolver, CMSettings.System.DOUBLE_TAP_SLEEP_GESTURE, 1) == 1;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 111e3f9..1bc6126 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -443,8 +443,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
super.observe();
ContentResolver resolver = mContext.getContentResolver();
- resolver.registerContentObserver(Settings.System.getUriFor(
- Settings.System.STATUS_BAR_BRIGHTNESS_CONTROL), false, this,
+ resolver.registerContentObserver(CMSettings.System.getUriFor(
+ CMSettings.System.STATUS_BAR_BRIGHTNESS_CONTROL), false, this,
UserHandle.USER_ALL);
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.SCREEN_BRIGHTNESS_MODE), false, this, UserHandle.USER_ALL);
@@ -470,8 +470,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
UserHandle.USER_CURRENT);
mAutomaticBrightness = mode != Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL;
- mBrightnessControl = Settings.System.getIntForUser(
- resolver, Settings.System.STATUS_BAR_BRIGHTNESS_CONTROL, 0,
+ mBrightnessControl = CMSettings.System.getIntForUser(
+ resolver, CMSettings.System.STATUS_BAR_BRIGHTNESS_CONTROL, 0,
UserHandle.USER_CURRENT) == 1;
if (mNavigationBarView != null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index e416a4d..f44b6e5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -51,6 +51,8 @@ import com.android.systemui.statusbar.policy.HotspotController;
import com.android.systemui.statusbar.policy.UserInfoController;
import com.android.systemui.statusbar.policy.SuController;
+import cyanogenmod.providers.CMSettings;
+
/**
* This class contains all of the policy about which icons are installed in the status
* bar at boot time. It goes through the normal API for icons, even though it probably
@@ -156,7 +158,7 @@ public class PhoneStatusBarPolicy implements Callback {
mService.setIconVisibility(SLOT_ALARM_CLOCK, false);
mAlarmIconObserver.onChange(true);
mContext.getContentResolver().registerContentObserver(
- Settings.System.getUriFor(Settings.System.SHOW_ALARM_ICON),
+ CMSettings.System.getUriFor(CMSettings.System.SHOW_ALARM_ICON),
false, mAlarmIconObserver);
// zen
@@ -193,8 +195,8 @@ public class PhoneStatusBarPolicy implements Callback {
private ContentObserver mAlarmIconObserver = new ContentObserver(null) {
@Override
public void onChange(boolean selfChange, Uri uri) {
- mAlarmIconVisible = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.SHOW_ALARM_ICON, 1) == 1;
+ mAlarmIconVisible = CMSettings.System.getInt(mContext.getContentResolver(),
+ CMSettings.System.SHOW_ALARM_ICON, 1) == 1;
updateAlarm();
}