Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb0e3973 authored by Pedlar's avatar Pedlar Committed by Steve Kondik
Browse files

Galaxy S Style Power Widget

- Finally Ready - Review at will
- This Depends on the following:
    CMParts: http://review.cyanogenmod.com/2063
parent c5efffd3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -74892,7 +74892,7 @@
 type="float"
 transient="false"
 volatile="false"
 value="0.0010f"
 value="0.001f"
 static="true"
 final="true"
 deprecated="not deprecated"
+5 −0
Original line number Diff line number Diff line
@@ -173,6 +173,11 @@ public abstract class ContentResolver {
        mContext = context;
    }

    /** @hide */
    public final Context getContext() {
        return mContext;
    }

    /** @hide */
    protected abstract IContentProvider acquireProvider(Context c, String name);
    /** @hide */
+1 −0
Original line number Diff line number Diff line
@@ -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);
                    }
+31 −1
Original line number Diff line number Diff line
@@ -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,15 +35,25 @@ 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() {
            if(mUri != null) {
                ContentObserver.this.onChangeUri(mUri, mSelf);
            } else {
                ContentObserver.this.onChange(mSelf);
            }
        }
    }

    private static final class Transport extends IContentObserver.Stub {
        ContentObserver mContentObserver;
@@ -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));
        }
    }


}
+3 −0
Original line number Diff line number Diff line
@@ -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);
}
Loading