diff options
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/content/ContentResolver.java | 5 | ||||
-rw-r--r-- | core/java/android/content/ContentService.java | 1 | ||||
-rwxr-xr-x | core/java/android/content/res/Resources.java | 14 | ||||
-rw-r--r-- | core/java/android/database/ContentObserver.java | 32 | ||||
-rwxr-xr-x | core/java/android/database/IContentObserver.aidl | 3 | ||||
-rw-r--r-- | core/java/android/provider/Settings.java | 56 | ||||
-rw-r--r-- | core/java/android/view/KeyEvent.java | 6 |
7 files changed, 105 insertions, 12 deletions
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index b4718ab..70fe960 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -174,6 +174,11 @@ public abstract class ContentResolver { } /** @hide */ + public final Context getContext() { + return mContext; + } + + /** @hide */ protected abstract IContentProvider acquireProvider(Context c, String name); /** @hide */ public abstract boolean releaseProvider(IContentProvider icp); diff --git a/core/java/android/content/ContentService.java b/core/java/android/content/ContentService.java index 377e383..9b8f349 100644 --- a/core/java/android/content/ContentService.java +++ b/core/java/android/content/ContentService.java @@ -139,6 +139,7 @@ public final class ContentService extends IContentService.Stub { ObserverCall oc = calls.get(i); try { oc.mObserver.onChange(oc.mSelfNotify); + oc.mObserver.onChangeUri(uri, oc.mSelfNotify); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Notified " + oc.mObserver + " of " + "update at " + uri); } diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 44e589d..61faa73 100755 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -595,22 +595,22 @@ public class Resources { * Various types of objects will be returned depending on the underlying * resource -- for example, a solid color, PNG image, scalable image, etc. * The Drawable API hides these implementation details. - * + * * mtwebster: - * This version also applies a Porter Duff color mask onto the object before + * This version also applies a Porter Duff color mask onto the object before * returning the object. Put in Resources to give reusability, I plan on * applying this to other parts of the gui - * + * * @param id The desired resource identifier, as generated by the aapt * tool. This integer encodes the package, type, and resource * entry. The value 0 is an invalid identifier. * * @param mask The color mask to use (alpha-r-g-b) - * + * * @param masktype The Porter Duff filter mode - * + * * @throws NotFoundException Throws NotFoundException if the given ID does not exist. - * + * * @return Drawable An object that can be used to draw this resource. * @hide */ @@ -623,7 +623,7 @@ public class Resources { return tmpDrawable; } } - + /** * Return a movie object associated with the particular resource ID. * @param id The desired resource identifier, as generated by the aapt diff --git a/core/java/android/database/ContentObserver.java b/core/java/android/database/ContentObserver.java index 3b829a3..f8a9a1a 100644 --- a/core/java/android/database/ContentObserver.java +++ b/core/java/android/database/ContentObserver.java @@ -17,6 +17,7 @@ package android.database; import android.os.Handler; +import android.net.Uri; /** * Receives call backs for changes to content. Must be implemented by objects which are added @@ -34,13 +35,23 @@ public abstract class ContentObserver { private final class NotificationRunnable implements Runnable { private boolean mSelf; + private Uri mUri = null; public NotificationRunnable(boolean self) { mSelf = self; } + public NotificationRunnable(Uri uri, boolean self) { + mSelf = self; + mUri = uri; + } + public void run() { - ContentObserver.this.onChange(mSelf); + if(mUri != null) { + ContentObserver.this.onChangeUri(mUri, mSelf); + } else { + ContentObserver.this.onChange(mSelf); + } } } @@ -66,6 +77,13 @@ public abstract class ContentObserver { } } + public void onChangeUri(Uri uri, boolean selfChange) { + ContentObserver contentObserver = mContentObserver; + if (contentObserver != null) { + contentObserver.dispatchChange(uri, selfChange); + } + } + public void releaseContentObserver() { mContentObserver = null; } @@ -127,6 +145,8 @@ public abstract class ContentObserver { * cursor that is being observed. */ public void onChange(boolean selfChange) {} + /** @hide */ + public void onChangeUri(Uri uri, boolean selfChange) {} public final void dispatchChange(boolean selfChange) { if (mHandler == null) { @@ -135,4 +155,14 @@ public abstract class ContentObserver { mHandler.post(new NotificationRunnable(selfChange)); } } + /** @hide */ + public final void dispatchChange(Uri uri, boolean selfChange) { + if (mHandler == null) { + onChangeUri(uri, selfChange); + } else { + mHandler.post(new NotificationRunnable(uri, selfChange)); + } + } + + } diff --git a/core/java/android/database/IContentObserver.aidl b/core/java/android/database/IContentObserver.aidl index ac2f975..f66c29d 100755 --- a/core/java/android/database/IContentObserver.aidl +++ b/core/java/android/database/IContentObserver.aidl @@ -17,6 +17,8 @@ package android.database; +import android.net.Uri; + /** * @hide */ @@ -28,4 +30,5 @@ interface IContentObserver * commit on the cursor that is being observed. */ oneway void onChange(boolean selfUpdate); + oneway void onChangeUri(in Uri uri, boolean selfUpdate); } 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. + } } } diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index b543b2c..75b0b97 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -129,10 +129,16 @@ public class KeyEvent implements Parcelable { public static final int KEYCODE_FUNC_7 = 98; public static final int KEYCODE_FUNC_8 = 99; public static final int KEYCODE_QUECHAR = 100; + + /** @hide */ public static final int KEYCODE_USER1 = 101; + /** @hide */ public static final int KEYCODE_USER2 = 102; + /** @hide */ public static final int KEYCODE_USER3 = 103; + /** @hide */ public static final int KEYCODE_USER4 = 104; + /** @hide */ public static final int KEYCODE_USER5 = 105; // NOTE: If you add a new keycode here you must also add it to: |