summaryrefslogtreecommitdiffstats
path: root/core/java/android/provider/Settings.java
diff options
context:
space:
mode:
authorPedlar <pedlar88@gmail.com>2010-10-05 00:51:57 -0400
committerSteve Kondik <shade@chemlab.org>2010-10-17 01:04:47 -0400
commiteb0e39732842151e947f27cf64a00480d75e5631 (patch)
tree0dd9204ba0593c58ff964fdb49c5502591b5e42f /core/java/android/provider/Settings.java
parentc5efffd3ea508745ceba287e1444e69b36b7d6e9 (diff)
downloadframeworks_base-eb0e39732842151e947f27cf64a00480d75e5631.zip
frameworks_base-eb0e39732842151e947f27cf64a00480d75e5631.tar.gz
frameworks_base-eb0e39732842151e947f27cf64a00480d75e5631.tar.bz2
Galaxy S Style Power Widget
- Finally Ready - Review at will - This Depends on the following: CMParts: http://review.cyanogenmod.com/2063
Diffstat (limited to 'core/java/android/provider/Settings.java')
-rw-r--r--core/java/android/provider/Settings.java56
1 files changed, 52 insertions, 4 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 264b22b..610310c 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -27,6 +27,7 @@ import android.content.ContentQueryMap;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
+import android.content.ContextWrapper;
import android.content.IContentProvider;
import android.content.Intent;
import android.content.pm.ActivityInfo;
@@ -57,8 +58,14 @@ import java.util.Map;
* The Settings provider contains global system-level device preferences.
*/
public final class Settings {
+ /** Intent actions for Settings
+ * @hide
+ */
+ public static final String SETTINGS_CHANGED = "android.settings.SETTINGS_CHANGED_ACTION";
- // Intent actions for Settings
+ public Settings() {
+ /* Empty for API conflicts */
+ }
/**
* Activity Action: Show system settings.
@@ -2150,13 +2157,13 @@ public final class Settings {
* Trackball Notification Colors. The value is String pkg=color|pkg=color
* @hide
*/
- public static final String NOTIFICATION_PACKAGE_COLORS = "|";
+ public static final String NOTIFICATION_PACKAGE_COLORS = "pref_package_colors";
/**
* Trackball Notification List. The value is String pkg|pkg
* @hide
*/
- public static final String NOTIFICATION_PACKAGE_LIST = "|";
+ public static final String NOTIFICATION_PACKAGE_LIST = "pref_package_list";
/**
* Trackball Notification Colors Debugging. The value is boolean (1 or 0)
@@ -2214,6 +2221,36 @@ public final class Settings {
public static final String NOTIF_EXPANDED_BAR_CUSTOM = "notif_expanded_bar_custom";
/**
+ * Use the Notification Power Widget? (Who wouldn't!)
+ * @hide
+ */
+ public static final String EXPANDED_VIEW_WIDGET = "expanded_view_widget";
+
+ /**
+ * Notification Indicator Color
+ * @hide
+ */
+ public static final String EXPANDED_VIEW_WIDGET_COLOR = "expanded_widget_color";
+
+ /**
+ * Widget Buttons to Use
+ * @hide
+ */
+ public static final String WIDGET_BUTTONS = "expanded_widget_buttons";
+
+ /** @hide */
+ public static final String EXPANDED_BRIGHTNESS_MODE = "expanded_brightness_mode";
+
+ /** @hide */
+ public static final String EXPANDED_NETWORK_MODE = "expanded_network_mode";
+
+ /** @hide */
+ public static final String EXPANDED_SCREENTIMEOUT_MODE = "expanded_screentimeout_mode";
+
+ /** @hide */
+ public static final String EXPANDED_RING_MODE = "expanded_ring_mode";
+
+ /**
* Whether to keep the home app at a higher OOM adjustement
* @hide
*/
@@ -4104,12 +4141,13 @@ public final class Settings {
/**
* Thread-safe method for enabling or disabling a single location provider.
- * @param cr the content resolver to use
+ * @param cr the content resolver from the calling application
* @param provider the location provider to enable or disable
* @param enabled true if the provider should be enabled
*/
public static final void setLocationProviderEnabled(ContentResolver cr,
String provider, boolean enabled) {
+ Context context = cr.getContext();
// to ensure thread safety, we write the provider name with a '+' or '-'
// and let the SettingsProvider handle it rather than reading and modifying
// the list of enabled providers.
@@ -4119,6 +4157,16 @@ public final class Settings {
provider = "-" + provider;
}
putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
+ try {
+ Intent i = new Intent();
+ i.setAction(Settings.SETTINGS_CHANGED);
+ i.putExtra("SETTING", "GPS");
+ i.putExtra("GPS_STATUS_CHANGE", enabled);
+ context.sendBroadcast(i);
+ } catch(Exception e) {
+ //This is ignored, as this try-catch is just incase this is called
+ //Before the system is read.
+ }
}
}