diff --git a/api/current.txt b/api/current.txt
index 44a97cd..e0dad49 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -3631,12 +3631,22 @@
     field public static final int DEFAULT_VIBRATE = 2; // 0x2
     field public static final int FLAG_AUTO_CANCEL = 16; // 0x10
     field public static final int FLAG_FOREGROUND_SERVICE = 64; // 0x40
-    field public static final int FLAG_HIGH_PRIORITY = 128; // 0x80
+    field public static final deprecated int FLAG_HIGH_PRIORITY = 128; // 0x80
     field public static final int FLAG_INSISTENT = 4; // 0x4
     field public static final int FLAG_NO_CLEAR = 32; // 0x20
     field public static final int FLAG_ONGOING_EVENT = 2; // 0x2
     field public static final int FLAG_ONLY_ALERT_ONCE = 8; // 0x8
     field public static final int FLAG_SHOW_LIGHTS = 1; // 0x1
+    field public static final java.lang.String KIND_CALL = "android.call";
+    field public static final java.lang.String KIND_EMAIL = "android.email";
+    field public static final java.lang.String KIND_EVENT = "android.event";
+    field public static final java.lang.String KIND_MESSAGE = "android.message";
+    field public static final java.lang.String KIND_PROMO = "android.promo";
+    field public static final int PRIORITY_DEFAULT = 0; // 0x0
+    field public static final int PRIORITY_HIGH = 1; // 0x1
+    field public static final int PRIORITY_LOW = -1; // 0xffffffff
+    field public static final int PRIORITY_MAX = 2; // 0x2
+    field public static final int PRIORITY_MIN = -2; // 0xfffffffe
     field public static final int STREAM_DEFAULT = -1; // 0xffffffff
     field public int audioStreamType;
     field public android.app.PendingIntent contentIntent;
@@ -3647,11 +3657,13 @@
     field public android.app.PendingIntent fullScreenIntent;
     field public int icon;
     field public int iconLevel;
+    field public java.lang.String[] kind;
     field public android.graphics.Bitmap largeIcon;
     field public int ledARGB;
     field public int ledOffMS;
     field public int ledOnMS;
     field public int number;
+    field public int priority;
     field public android.net.Uri sound;
     field public java.lang.CharSequence tickerText;
     field public android.widget.RemoteViews tickerView;
@@ -3661,6 +3673,7 @@
 
   public static class Notification.Builder {
     ctor public Notification.Builder(android.content.Context);
+    method public android.app.Notification.Builder addKind(java.lang.String);
     method public android.app.Notification getNotification();
     method public android.app.Notification.Builder setAutoCancel(boolean);
     method public android.app.Notification.Builder setContent(android.widget.RemoteViews);
@@ -3676,6 +3689,7 @@
     method public android.app.Notification.Builder setNumber(int);
     method public android.app.Notification.Builder setOngoing(boolean);
     method public android.app.Notification.Builder setOnlyAlertOnce(boolean);
+    method public android.app.Notification.Builder setPriority(int);
     method public android.app.Notification.Builder setProgress(int, int, boolean);
     method public android.app.Notification.Builder setSmallIcon(int);
     method public android.app.Notification.Builder setSmallIcon(int, int);
diff --git a/cmds/stagefright/codec.cpp b/cmds/stagefright/codec.cpp
index ad246d2..1b01bd6 100644
--- a/cmds/stagefright/codec.cpp
+++ b/cmds/stagefright/codec.cpp
@@ -107,9 +107,8 @@
         CHECK_EQ(err, (status_t)OK);
 
         size_t j = 0;
-        sp<RefBase> obj;
-        while (format->findObject(StringPrintf("csd-%d", j).c_str(), &obj)) {
-            sp<ABuffer> buffer = static_cast<ABuffer *>(obj.get());
+        sp<ABuffer> buffer;
+        while (format->findBuffer(StringPrintf("csd-%d", j).c_str(), &buffer)) {
             state->mCSD.push_back(buffer);
 
             ++j;
diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp
index 18e2532..6f0fb54 100644
--- a/cmds/stagefright/sf2.cpp
+++ b/cmds/stagefright/sf2.cpp
@@ -358,7 +358,7 @@
             buffer->meta()->setInt32("csd", true);
             mCSD.push(buffer);
 
-            msg->setObject("csd", buffer);
+            msg->setBuffer("csd", buffer);
         } else if (meta->findData(kKeyESDS, &type, &data, &size)) {
             ESDS esds((const char *)data, size);
             CHECK_EQ(esds.InitCheck(), (status_t)OK);
@@ -408,9 +408,8 @@
             return;
         }
 
-        sp<RefBase> obj;
-        CHECK(msg->findObject("buffer", &obj));
-        sp<ABuffer> outBuffer = static_cast<ABuffer *>(obj.get());
+        sp<ABuffer> outBuffer;
+        CHECK(msg->findBuffer("buffer", &outBuffer));
 
         if (mCSDIndex < mCSD.size()) {
             outBuffer = mCSD.editItemAt(mCSDIndex++);
@@ -509,15 +508,14 @@
             }
         }
 
-        reply->setObject("buffer", outBuffer);
+        reply->setBuffer("buffer", outBuffer);
         reply->post();
     }
 
     void onDrainThisBuffer(const sp<AMessage> &msg) {
-        sp<RefBase> obj;
-        CHECK(msg->findObject("buffer", &obj));
+        sp<ABuffer> buffer;
+        CHECK(msg->findBuffer("buffer", &buffer));
 
-        sp<ABuffer> buffer = static_cast<ABuffer *>(obj.get());
         mTotalBytesReceived += buffer->size();
 
         sp<AMessage> reply;
diff --git a/core/java/android/accessibilityservice/UiTestAutomationBridge.java b/core/java/android/accessibilityservice/UiTestAutomationBridge.java
index 9b3da53..a898c3f 100644
--- a/core/java/android/accessibilityservice/UiTestAutomationBridge.java
+++ b/core/java/android/accessibilityservice/UiTestAutomationBridge.java
@@ -74,6 +74,8 @@
 
     private volatile boolean mUnprocessedEventAvailable;
 
+    private HandlerThread mHandlerThread;
+
     /**
      * Gets the last received {@link AccessibilityEvent}.
      *
@@ -126,9 +128,10 @@
         // is needed for making sure the binder calls are interleaved
         // with check for the expected event and also to make sure the
         // binder threads are allowed to proceed in the received order.
-        HandlerThread handlerThread = new HandlerThread("UiTestAutomationBridge");
-        handlerThread.start();
-        Looper looper = handlerThread.getLooper();
+        mHandlerThread = new HandlerThread("UiTestAutomationBridge");
+        mHandlerThread.setDaemon(true);
+        mHandlerThread.start();
+        Looper looper = mHandlerThread.getLooper();
 
         mListener = new IEventListenerWrapper(null, looper, new Callbacks() {
             @Override
@@ -217,6 +220,8 @@
             throw new IllegalStateException("Already disconnected.");
         }
 
+        mHandlerThread.quit();
+
         IAccessibilityManager manager = IAccessibilityManager.Stub.asInterface(
               ServiceManager.getService(Context.ACCESSIBILITY_SERVICE));
 
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index 2420b84..4d5238c 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -33,7 +33,6 @@
     void enqueueToast(String pkg, ITransientNotification callback, int duration);
     void cancelToast(String pkg, ITransientNotification callback);
     void enqueueNotificationWithTag(String pkg, String tag, int id, in Notification notification, inout int[] idReceived);
-    void enqueueNotificationWithTagPriority(String pkg, String tag, int id, int priority, in Notification notification, inout int[] idReceived);
     void cancelNotificationWithTag(String pkg, String tag, int id);
 }
 
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index d569e20..5325af0 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -22,6 +22,7 @@
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.net.Uri;
+import android.os.Bundle;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.text.TextUtils;
@@ -30,6 +31,7 @@
 import android.widget.RemoteViews;
 
 import java.text.NumberFormat;
+import java.util.ArrayList;
 
 /**
  * A class that represents how a persistent notification is to be presented to
@@ -51,36 +53,58 @@
      * Use all default values (where applicable).
      */
     public static final int DEFAULT_ALL = ~0;
-    
+
     /**
      * Use the default notification sound. This will ignore any given
      * {@link #sound}.
-     * 
+     *
+
      * @see #defaults
-     */ 
+     */
+
     public static final int DEFAULT_SOUND = 1;
 
     /**
      * Use the default notification vibrate. This will ignore any given
-     * {@link #vibrate}. Using phone vibration requires the 
+     * {@link #vibrate}. Using phone vibration requires the
      * {@link android.Manifest.permission#VIBRATE VIBRATE} permission.
-     * 
+     *
      * @see #defaults
-     */ 
+     */
+
     public static final int DEFAULT_VIBRATE = 2;
-    
+
     /**
      * Use the default notification lights. This will ignore the
      * {@link #FLAG_SHOW_LIGHTS} bit, and {@link #ledARGB}, {@link #ledOffMS}, or
      * {@link #ledOnMS}.
-     * 
+     *
      * @see #defaults
-     */ 
+     */
+
     public static final int DEFAULT_LIGHTS = 4;
-    
+
     /**
-     * The timestamp for the notification.  The icons and expanded views
-     * are sorted by this key.
+     * A timestamp related to this notification, in milliseconds since the epoch.
+     * 
+     * Default value: {@link System#currentTimeMillis() Now}.
+     *
+     * Choose a timestamp that will be most relevant to the user. For most finite events, this
+     * corresponds to the time the event happened (or will happen, in the case of events that have
+     * yet to occur but about which the user is being informed). Indefinite events should be
+     * timestamped according to when the activity began. 
+     * 
+     * Some examples:
+     * 
+     * <ul>
+     *   <li>Notification of a new chat message should be stamped when the message was received.</li>
+     *   <li>Notification of an ongoing file download (with a progress bar, for example) should be stamped when the download started.</li>
+     *   <li>Notification of a completed file download should be stamped when the download finished.</li>
+     *   <li>Notification of an upcoming meeting should be stamped with the time the meeting will begin (that is, in the future).</li>
+     *   <li>Notification of an ongoing stopwatch (increasing timer) should be stamped with the watch's start time.
+     *   <li>Notification of an ongoing countdown timer should be stamped with the timer's end time.
+     * </ul> 
+     * 
      */
     public long when;
 
@@ -100,10 +124,16 @@
     public int iconLevel;
 
     /**
-     * The number of events that this notification represents.  For example, in a new mail
-     * notification, this could be the number of unread messages.  This number is superimposed over
-     * the icon in the status bar.  If the number is 0 or negative, it is not shown in the status
-     * bar.
+     * The number of events that this notification represents. For example, in a new mail
+     * notification, this could be the number of unread messages.
+     * 
+     * The system may or may not use this field to modify the appearance of the notification. For
+     * example, before {@link android.os.Build.VERSION_CODES#HONEYCOMB}, this number was
+     * superimposed over the icon in the status bar. Starting with
+     * {@link android.os.Build.VERSION_CODES#HONEYCOMB}, the template used by
+     * {@link Notification.Builder} has displayed the number in the expanded notification view.
+     * 
+     * If the number is 0 or negative, it is never shown.
      */
     public int number;
 
@@ -121,10 +151,11 @@
     public PendingIntent contentIntent;
 
     /**
-     * The intent to execute when the status entry is deleted by the user
-     * with the "Clear All Notifications" button. This probably shouldn't
-     * be launching an activity since several of those will be sent at the
-     * same time.
+     * The intent to execute when the notification is explicitly dismissed by the user, either with
+     * the "Clear All" button or by swiping it away individually.
+     *
+     * This probably shouldn't be launching an activity since several of those will be sent
+     * at the same time.
      */
     public PendingIntent deleteIntent;
 
@@ -139,11 +170,6 @@
      * Text to scroll across the screen when this item is added to
      * the status bar on large and smaller devices.
      *
-     * <p>This field is provided separately from the other ticker fields
-     * both for compatibility and to allow an application to choose different
-     * text for when the text scrolls in and when it is displayed all at once
-     * in conjunction with one or more icons.
-     *
      * @see #tickerView
      */
     public CharSequence tickerText;
@@ -166,9 +192,9 @@
 
     /**
      * The sound to play.
-     * 
+     *
      * <p>
-     * To play the default notification sound, see {@link #defaults}. 
+     * To play the default notification sound, see {@link #defaults}.
      * </p>
      */
     public Uri sound;
@@ -187,14 +213,13 @@
      */
     public int audioStreamType = STREAM_DEFAULT;
 
-    
     /**
-     * The pattern with which to vibrate. 
-     * 
+     * The pattern with which to vibrate.
+     *
      * <p>
      * To vibrate the default pattern, see {@link #defaults}.
      * </p>
-     * 
+     *
      * @see android.os.Vibrator#vibrate(long[],int)
      */
     public long[] vibrate;
@@ -235,7 +260,6 @@
      */
     public int defaults;
 
-
     /**
      * Bit to be bitwise-ored into the {@link #flags} field that should be
      * set if you want the LED on for this notification.
@@ -252,7 +276,7 @@
      * because they will be set to values that work on any given hardware.
      * <p>
      * The alpha channel must be set for forward compatibility.
-     * 
+     *
      */
     public static final int FLAG_SHOW_LIGHTS        = 0x00000001;
 
@@ -282,7 +306,8 @@
     /**
      * Bit to be bitwise-ored into the {@link #flags} field that should be
      * set if the notification should be canceled when it is clicked by the
-     * user.  On tablets, the 
+     * user.  On tablets, the
+
      */
     public static final int FLAG_AUTO_CANCEL        = 0x00000010;
 
@@ -301,22 +326,105 @@
     public static final int FLAG_FOREGROUND_SERVICE = 0x00000040;
 
     /**
-     * Bit to be bitwise-ored into the {@link #flags} field that should be set if this notification
-     * represents a high-priority event that may be shown to the user even if notifications are
-     * otherwise unavailable (that is, when the status bar is hidden). This flag is ideally used
-     * in conjunction with {@link #fullScreenIntent}.
+     * Obsolete flag indicating high-priority notifications; use the priority field instead.
+     * 
+     * @deprecated Use {@link #priority} with a positive value.
      */
-    public static final int FLAG_HIGH_PRIORITY = 0x00000080;
+    public static final int FLAG_HIGH_PRIORITY      = 0x00000080;
 
     public int flags;
 
     /**
-     * Constructs a Notification object with everything set to 0.
+     * Default notification {@link #priority}. If your application does not prioritize its own
+     * notifications, use this value for all notifications.
+     */
+    public static final int PRIORITY_DEFAULT = 0;
+
+    /**
+     * Lower {@link #priority}, for items that are less important. The UI may choose to show these
+     * items smaller, or at a different position in the list, compared with your app's
+     * {@link #PRIORITY_DEFAULT} items.
+     */
+    public static final int PRIORITY_LOW = -1;
+
+    /**
+     * Lowest {@link #priority}; these items might not be shown to the user except under special
+     * circumstances, such as detailed notification logs.
+     */
+    public static final int PRIORITY_MIN = -2;
+
+    /**
+     * Higher {@link #priority}, for more important notifications or alerts. The UI may choose to
+     * show these items larger, or at a different position in notification lists, compared with
+     * your app's {@link #PRIORITY_DEFAULT} items.
+     */
+    public static final int PRIORITY_HIGH = 1;
+
+    /**
+     * Highest {@link #priority}, for your application's most important items that require the
+     * user's prompt attention or input.
+     */
+    public static final int PRIORITY_MAX = 2;
+
+    /**
+     * Relative priority for this notification.
+     * 
+     * Priority is an indication of how much of the user's valuable attention should be consumed by
+     * this notification. Low-priority notifications may be hidden from the user in certain
+     * situations, while the user might be interrupted for a higher-priority notification. The
+     * system will make a determination about how to interpret notification priority as described in 
+     * MUMBLE MUMBLE.
+     */
+    public int priority;
+    
+    /**
+     * Notification type: incoming call (voice or video) or similar synchronous communication request.
+     */
+    public static final String KIND_CALL = "android.call";
+
+    /**
+     * Notification type: incoming direct message (SMS, instant message, etc.).
+     */
+    public static final String KIND_MESSAGE = "android.message";
+
+    /**
+     * Notification type: asynchronous bulk message (email).
+     */
+    public static final String KIND_EMAIL = "android.email";
+
+    /**
+     * Notification type: calendar event.
+     */
+    public static final String KIND_EVENT = "android.event";
+
+    /**
+     * Notification type: promotion or advertisement.
+     */
+    public static final String KIND_PROMO = "android.promo";
+
+    /**
+     * If this notification matches of one or more special types (see the <code>KIND_*</code>
+     * constants), add them here, best match first.
+     */
+    public String[] kind;
+
+    /**
+     * Extra key for people values (type TBD).
+     *
+     * @hide
+     */
+    public static final String EXTRA_PEOPLE = "android.people";
+
+    private Bundle extras;
+
+    /**
+     * Constructs a Notification object with default values.
      * You might want to consider using {@link Builder} instead.
      */
     public Notification()
     {
         this.when = System.currentTimeMillis();
+        this.priority = PRIORITY_DEFAULT;
     }
 
     /**
@@ -396,6 +504,14 @@
         if (parcel.readInt() != 0) {
             fullScreenIntent = PendingIntent.CREATOR.createFromParcel(parcel);
         }
+
+        priority = parcel.readInt();
+        
+        kind = parcel.createStringArray(); // may set kind to null
+
+        if (parcel.readInt() != 0) {
+            extras = parcel.readBundle();
+        }
     }
 
     @Override
@@ -438,9 +554,23 @@
         that.ledOnMS = this.ledOnMS;
         that.ledOffMS = this.ledOffMS;
         that.defaults = this.defaults;
-        
+
         that.flags = this.flags;
 
+        that.priority = this.priority;
+        
+        final String[] thiskind = this.kind;
+        if (thiskind != null) {
+            final int N = thiskind.length;
+            final String[] thatkind = that.kind = new String[N];
+            System.arraycopy(thiskind, 0, thatkind, 0, N);
+        }
+
+        if (this.extras != null) {
+            that.extras = new Bundle(this.extras);
+
+        }
+
         return that;
     }
 
@@ -517,6 +647,17 @@
         } else {
             parcel.writeInt(0);
         }
+
+        parcel.writeInt(priority);
+        
+        parcel.writeStringArray(kind); // ok for null
+        
+        if (extras != null) {
+            parcel.writeInt(1);
+            extras.writeToParcel(parcel, 0);
+        } else {
+            parcel.writeInt(0);
+        }
     }
 
     /**
@@ -551,7 +692,7 @@
      * that you take care of task management as described in the
      * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back
      * Stack</a> document.
-     * 
+     *
      * @deprecated Use {@link Builder} instead.
      */
     @Deprecated
@@ -579,7 +720,9 @@
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("Notification(contentView=");
+        sb.append("Notification(pri=");
+        sb.append(priority);
+        sb.append(" contentView=");
         if (contentView != null) {
             sb.append(contentView.getPackage());
             sb.append("/0x");
@@ -587,6 +730,7 @@
         } else {
             sb.append("null");
         }
+        // TODO(dsandler): defaults take precedence over local values, so reorder the branches below
         sb.append(" vibrate=");
         if (this.vibrate != null) {
             int N = this.vibrate.length-1;
@@ -604,7 +748,7 @@
         } else {
             sb.append("null");
         }
-        sb.append(",sound=");
+        sb.append(" sound=");
         if (this.sound != null) {
             sb.append(this.sound.toString());
         } else if ((this.defaults & DEFAULT_SOUND) != 0) {
@@ -612,20 +756,39 @@
         } else {
             sb.append("null");
         }
-        sb.append(",defaults=0x");
+        sb.append(" defaults=0x");
         sb.append(Integer.toHexString(this.defaults));
-        sb.append(",flags=0x");
+        sb.append(" flags=0x");
         sb.append(Integer.toHexString(this.flags));
-        if ((this.flags & FLAG_HIGH_PRIORITY) != 0) {
-            sb.append("!!!1!one!");
+        sb.append(" kind=[");
+        if (this.kind == null) {
+            sb.append("null");
+        } else {
+            for (int i=0; i<this.kind.length; i++) {
+                if (i>0) sb.append(",");
+                sb.append(this.kind[i]);
+            }
         }
-        sb.append(")");
+        sb.append("])");
         return sb.toString();
     }
 
     /**
-     * Builder class for {@link Notification} objects.  Allows easier control over
-     * all the flags, as well as help constructing the typical notification layouts.
+     * Builder class for {@link Notification} objects.
+     * 
+     * Provides a convenient way to set the various fields of a {@link Notification} and generate
+     * content views using the platform's notification layout template. 
+     * 
+     * Example:
+     * 
+     * <pre class="prettyprint">
+     * Notification noti = new Notification.Builder()
+     *         .setContentTitle(&quot;New mail from &quot; + sender.toString())
+     *         .setContentText(subject)
+     *         .setSmallIcon(R.drawable.new_mail)
+     *         .setLargeIcon(aBitmap)
+     *         .getNotification();
+     * </pre>
      */
     public static class Builder {
         private Context mContext;
@@ -655,16 +818,28 @@
         private int mProgressMax;
         private int mProgress;
         private boolean mProgressIndeterminate;
+        private ArrayList<String> mKindList = new ArrayList<String>(1);
+        private Bundle mExtras;
+        private int mPriority;
 
         /**
-         * Constructor.
+         * Constructs a new Builder with the defaults:
          *
-         * Automatically sets the when field to {@link System#currentTimeMillis()
-         * System.currentTimeMllis()} and the audio stream to the {@link #STREAM_DEFAULT}.
+
+         * <table>
+         * <tr><th align=right>priority</th>
+         *     <td>{@link #PRIORITY_DEFAULT}</td></tr>
+         * <tr><th align=right>when</th>
+         *     <td>now ({@link System#currentTimeMillis()})</td></tr>
+         * <tr><th align=right>audio stream</th>
+         *     <td>{@link #STREAM_DEFAULT}</td></tr>
+         * </table>
          *
-         * @param context A {@link Context} that will be used to construct the
-         *      RemoteViews. The Context will not be held past the lifetime of this
-         *      Builder object.
+
+         * @param context
+         *            A {@link Context} that will be used by the Builder to construct the
+         *            RemoteViews. The Context will not be held past the lifetime of this Builder
+         *            object.
          */
         public Builder(Context context) {
             mContext = context;
@@ -672,11 +847,14 @@
             // Set defaults to match the defaults of a Notification
             mWhen = System.currentTimeMillis();
             mAudioStreamType = STREAM_DEFAULT;
+            mPriority = PRIORITY_DEFAULT;
         }
 
         /**
-         * Set the time that the event occurred.  Notifications in the panel are
-         * sorted by this time.
+         * Add a timestamp pertaining to the notification (usually the time the event occurred).
+         *
+
+         * @see Notification#when
          */
         public Builder setWhen(long when) {
             mWhen = when;
@@ -684,11 +862,18 @@
         }
 
         /**
-         * Set the small icon to use in the notification layouts.  Different classes of devices
-         * may return different sizes.  See the UX guidelines for more information on how to
-         * design these icons.
+         * Set the small icon resource, which will be used to represent the notification in the
+         * status bar.
          *
-         * @param icon A resource ID in the application's package of the drawble to use.
+
+         * The platform template for the expanded view will draw this icon in the left, unless a
+         * {@link #setLargeIcon(Bitmap) large icon} has also been specified, in which case the small
+         * icon will be moved to the right-hand side.
+         *
+
+         * @param icon
+         *            A resource ID in the application's package of the drawable to use.
+         * @see Notification#icon
          */
         public Builder setSmallIcon(int icon) {
             mSmallIcon = icon;
@@ -700,10 +885,11 @@
          * level parameter for when the icon is a {@link android.graphics.drawable.LevelListDrawable
          * LevelListDrawable}.
          *
-         * @param icon A resource ID in the application's package of the drawble to use.
+         * @param icon A resource ID in the application's package of the drawable to use.
          * @param level The level to use for the icon.
          *
-         * @see android.graphics.drawable.LevelListDrawable
+         * @see Notification#icon
+         * @see Notification#iconLevel
          */
         public Builder setSmallIcon(int icon, int level) {
             mSmallIcon = icon;
@@ -712,7 +898,7 @@
         }
 
         /**
-         * Set the title (first row) of the notification, in a standard notification.
+         * Set the first line of text in the platform notification template.
          */
         public Builder setContentTitle(CharSequence title) {
             mContentTitle = title;
@@ -720,7 +906,7 @@
         }
 
         /**
-         * Set the text (second row) of the notification, in a standard notification.
+         * Set the second line of text in the platform notification template.
          */
         public Builder setContentText(CharSequence text) {
             mContentText = text;
@@ -738,7 +924,11 @@
         }
 
         /**
-         * Set the large text at the right-hand side of the notification.
+         * A small piece of additional information pertaining to this notification.
+         *
+
+         * The platform template will draw this on the last line of the notification, at the far
+         * right (to the right of a smallIcon if it has been placed there).
          */
         public Builder setContentInfo(CharSequence info) {
             mContentInfo = info;
@@ -746,8 +936,10 @@
         }
 
         /**
-         * Set the progress this notification represents, which may be
-         * represented as a {@link ProgressBar}.
+         * Set the progress this notification represents.
+         *
+
+         * The platform template will represent this using a {@link ProgressBar}.
          */
         public Builder setProgress(int max, int progress, boolean indeterminate) {
             mProgressMax = max;
@@ -757,7 +949,10 @@
         }
 
         /**
-         * Supply a custom RemoteViews to use instead of the standard one.
+         * Supply a custom RemoteViews to use instead of the platform template.
+         *
+
+         * @see Notification#contentView
          */
         public Builder setContent(RemoteViews views) {
             mContentView = views;
@@ -765,12 +960,20 @@
         }
 
         /**
-         * Supply a {@link PendingIntent} to send when the notification is clicked.
-         * If you do not supply an intent, you can now add PendingIntents to individual
-         * views to be launched when clicked by calling {@link RemoteViews#setOnClickPendingIntent
-         * RemoteViews.setOnClickPendingIntent(int,PendingIntent)}.  Be sure to
-         * read {@link Notification#contentIntent Notification.contentIntent} for
-         * how to correctly use this.
+         * Supply a {@link PendingIntent} to be sent when the notification is clicked.
+         *
+
+         * As of {@link android.os.Build.VERSION_CODES#HONEYCOMB}, if this field is unset and you
+         * have specified a custom RemoteViews with {@link #setContent(RemoteViews)}, you can use
+         * {@link RemoteViews#setOnClickPendingIntent RemoteViews.setOnClickPendingIntent(int,PendingIntent)}
+
+         * to assign PendingIntents to individual views in that custom layout (i.e., to create
+
+         * clickable buttons inside the
+         * notification view).
+         *
+
+         * @see Notification#contentIntent Notification.contentIntent
          */
         public Builder setContentIntent(PendingIntent intent) {
             mContentIntent = intent;
@@ -778,11 +981,10 @@
         }
 
         /**
-         * Supply a {@link PendingIntent} to send when the notification is cleared by the user
-         * directly from the notification panel.  For example, this intent is sent when the user
-         * clicks the "Clear all" button, or the individual "X" buttons on notifications.  This
-         * intent is not sent when the application calls {@link NotificationManager#cancel
-         * NotificationManager.cancel(int)}.
+         * Supply a {@link PendingIntent} to send when the notification is cleared explicitly by the user.
+         *
+
+         * @see Notification#deleteIntent
          */
         public Builder setDeleteIntent(PendingIntent intent) {
             mDeleteIntent = intent;
@@ -801,6 +1003,8 @@
          * @param intent The pending intent to launch.
          * @param highPriority Passing true will cause this notification to be sent
          *          even if other notifications are suppressed.
+         *
+         * @see Notification#fullScreenIntent
          */
         public Builder setFullScreenIntent(PendingIntent intent, boolean highPriority) {
             mFullScreenIntent = intent;
@@ -809,8 +1013,11 @@
         }
 
         /**
-         * Set the text that is displayed in the status bar when the notification first
+         * Set the "ticker" text which is displayed in the status bar when the notification first
          * arrives.
+         *
+
+         * @see Notification#tickerText
          */
         public Builder setTicker(CharSequence tickerText) {
             mTickerText = tickerText;
@@ -821,6 +1028,9 @@
          * Set the text that is displayed in the status bar when the notification first
          * arrives, and also a RemoteViews object that may be displayed instead on some
          * devices.
+         *
+         * @see Notification#tickerText
+         * @see Notification#tickerView
          */
         public Builder setTicker(CharSequence tickerText, RemoteViews views) {
             mTickerText = tickerText;
@@ -829,7 +1039,12 @@
         }
 
         /**
-         * Set the large icon that is shown in the ticker and notification.
+         * Add a large icon to the notification (and the ticker on some devices).
+         *
+         * In the platform template, this image will be shown on the left of the notification view
+         * in place of the {@link #setSmallIcon(int) small icon} (which will move to the right side).
+         *
+         * @see Notification#largeIcon
          */
         public Builder setLargeIcon(Bitmap icon) {
             mLargeIcon = icon;
@@ -837,7 +1052,11 @@
         }
 
         /**
-         * Set the sound to play.  It will play on the default stream.
+         * Set the sound to play.
+         *
+         * It will be played on the {@link #STREAM_DEFAULT default stream} for notifications.
+         *
+         * @see Notification#sound
          */
         public Builder setSound(Uri sound) {
             mSound = sound;
@@ -846,10 +1065,11 @@
         }
 
         /**
-         * Set the sound to play.  It will play on the stream you supply.
+         * Set the sound to play, along with a specific stream on which to play it.
          *
-         * @see #STREAM_DEFAULT
-         * @see AudioManager for the <code>STREAM_</code> constants.
+         * See {@link android.media.AudioManager} for the <code>STREAM_</code> constants.
+         *
+         * @see Notification#sound
          */
         public Builder setSound(Uri sound, int streamType) {
             mSound = sound;
@@ -860,8 +1080,12 @@
         /**
          * Set the vibration pattern to use.
          *
-         * @see android.os.Vibrator for a discussion of the <code>pattern</code>
-         * parameter.
+
+         * See {@link android.os.Vibrator#vibrate(long[], int)} for a discussion of the
+         * <code>pattern</code> parameter.
+         *
+
+         * @see Notification#vibrate
          */
         public Builder setVibrate(long[] pattern) {
             mVibrate = pattern;
@@ -869,9 +1093,16 @@
         }
 
         /**
-         * Set the argb value that you would like the LED on the device to blnk, as well as the
-         * rate.  The rate is specified in terms of the number of milliseconds to be on
-         * and then the number of milliseconds to be off.
+         * Set the desired color for the indicator LED on the device, as well as the
+         * blink duty cycle (specified in milliseconds).
+         *
+
+         * Not all devices will honor all (or even any) of these values.
+         *
+
+         * @see Notification#ledARGB
+         * @see Notification#ledOnMS
+         * @see Notification#ledOffMS
          */
         public Builder setLights(int argb, int onMs, int offMs) {
             mLedArgb = argb;
@@ -881,15 +1112,20 @@
         }
 
         /**
-         * Set whether this is an ongoing notification.
+         * Set whether this is an "ongoing" notification.
          *
-         * <p>Ongoing notifications differ from regular notifications in the following ways:
-         * <ul>
-         *   <li>Ongoing notifications are sorted above the regular notifications in the
-         *   notification panel.</li>
-         *   <li>Ongoing notifications do not have an 'X' close button, and are not affected
-         *   by the "Clear all" button.
-         * </ul>
+
+         * Ongoing notifications cannot be dismissed by the user, so your application or service
+         * must take care of canceling them.
+         *
+
+         * They are typically used to indicate a background task that the user is actively engaged
+         * with (e.g., playing music) or is pending in some way and therefore occupying the device
+         * (e.g., a file download, sync operation, active network connection).
+         *
+
+         * @see Notification#FLAG_ONGOING_EVENT
+         * @see Service#setForeground(boolean)
          */
         public Builder setOngoing(boolean ongoing) {
             setFlag(FLAG_ONGOING_EVENT, ongoing);
@@ -899,6 +1135,8 @@
         /**
          * Set this flag if you would only like the sound, vibrate
          * and ticker to be played if the notification is not already showing.
+         *
+         * @see Notification#FLAG_ONLY_ALERT_ONCE
          */
         public Builder setOnlyAlertOnce(boolean onlyAlertOnce) {
             setFlag(FLAG_ONLY_ALERT_ONCE, onlyAlertOnce);
@@ -906,10 +1144,10 @@
         }
 
         /**
-         * Setting this flag will make it so the notification is automatically
-         * canceled when the user clicks it in the panel.  The PendingIntent
-         * set with {@link #setDeleteIntent} will be broadcast when the notification
-         * is canceled.
+         * Make this notification automatically dismissed when the user touches it. The
+         * PendingIntent set with {@link #setDeleteIntent} will be sent when this happens.
+         *
+         * @see Notification#FLAG_AUTO_CANCEL
          */
         public Builder setAutoCancel(boolean autoCancel) {
             setFlag(FLAG_AUTO_CANCEL, autoCancel);
@@ -917,7 +1155,7 @@
         }
 
         /**
-         * Set the default notification options that will be used.
+         * Set which notification properties will be inherited from system defaults.
          * <p>
          * The value should be one or more of the following fields combined with
          * bitwise-or:
@@ -930,6 +1168,41 @@
             return this;
         }
 
+        /**
+         * Set the priority of this notification.
+         *
+         * @see Notification#priority
+         */
+        public Builder setPriority(int pri) {
+            mPriority = pri;
+            return this;
+        }
+        
+        /**
+         * Add a kind (category) to this notification. Optional.
+         * 
+         * @see Notification#kind
+         */
+        public Builder addKind(String k) {
+            mKindList.add(k);
+            return this;
+        }
+
+        /**
+         * Add metadata to this notification.
+         *
+         * A reference to the Bundle is held for the lifetime of this Builder, and the Bundle's
+         * current contents are copied into the Notification each time {@link #getNotification()} is
+         * called.
+         *
+         * @see Notification#extras
+         * @hide
+         */
+        public Builder setExtras(Bundle bag) {
+            mExtras = bag;
+            return this;
+        }
+
         private void setFlag(int mask, boolean value) {
             if (value) {
                 mFlags |= mask;
@@ -1042,6 +1315,14 @@
             if ((mDefaults & DEFAULT_LIGHTS) != 0) {
                 n.flags |= FLAG_SHOW_LIGHTS;
             }
+            if (mKindList.size() > 0) {
+                n.kind = new String[mKindList.size()];
+                mKindList.toArray(n.kind);
+            } else {
+                n.kind = null;
+            }
+            n.priority = mPriority;
+            n.extras = mExtras != null ? new Bundle(mExtras) : null;
             return n;
         }
     }
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 31d874f..e0d0763 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -381,6 +381,8 @@
         mAccessibilityManager = AccessibilityManager.getInstance(context);
         mAccessibilityInteractionConnectionManager =
             new AccessibilityInteractionConnectionManager();
+        mAccessibilityManager.addAccessibilityStateChangeListener(
+                mAccessibilityInteractionConnectionManager);
         mAttachInfo = new View.AttachInfo(sWindowSession, mWindow, this, mHandler, this);
         mViewConfiguration = ViewConfiguration.get(context);
         mDensity = context.getResources().getDisplayMetrics().densityDpi;
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java b/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
index 4fb0046..dfbfc70 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
@@ -16,7 +16,6 @@
 
 package android.view.accessibility;
 
-import android.os.Process;
 import android.util.Log;
 import android.util.LongSparseArray;
 
@@ -81,14 +80,16 @@
     public AccessibilityNodeInfo get(long accessibilityNodeId) {
         if (ENABLED) {
             synchronized(mLock) {
-                if (DEBUG) {
-                    AccessibilityNodeInfo info = mCacheImpl.get(accessibilityNodeId);
-                    Log.i(LOG_TAG, "Process: " + Process.myPid() +
-                            " get(" + accessibilityNodeId + ") = " + info);
-                    return info;
-                } else {
-                    return mCacheImpl.get(accessibilityNodeId);
+                AccessibilityNodeInfo info = mCacheImpl.get(accessibilityNodeId);
+                if (info != null) {
+                    // Return a copy since the client calls to AccessibilityNodeInfo#recycle()
+                    // will wipe the data of the cached info.
+                    info = AccessibilityNodeInfo.obtain(info);
                 }
+                if (DEBUG) {
+                    Log.i(LOG_TAG, "get(" + accessibilityNodeId + ") = " + info);
+                }
+                return info;
             }
         } else {
             return null;
@@ -105,10 +106,12 @@
         if (ENABLED) {
             synchronized(mLock) {
                 if (DEBUG) {
-                    Log.i(LOG_TAG, "Process: " + Process.myPid()
-                            + " put(" + accessibilityNodeId + ", " + info + ")");
+                    Log.i(LOG_TAG, "put(" + accessibilityNodeId + ", " + info + ")");
                 }
-                mCacheImpl.put(accessibilityNodeId, info);
+                // Cache a copy since the client calls to AccessibilityNodeInfo#recycle()
+                // will wipe the data of the cached info.
+                AccessibilityNodeInfo clone = AccessibilityNodeInfo.obtain(info);
+                mCacheImpl.put(accessibilityNodeId, clone);
             }
         }
     }
@@ -138,8 +141,7 @@
         if (ENABLED) {
             synchronized(mLock) {
                 if (DEBUG) {
-                    Log.i(LOG_TAG,  "Process: " + Process.myPid()
-                            + " remove(" + accessibilityNodeId + ")");
+                    Log.i(LOG_TAG, "remove(" + accessibilityNodeId + ")");
                 }
                 mCacheImpl.remove(accessibilityNodeId);
             }
@@ -153,7 +155,13 @@
         if (ENABLED) {
             synchronized(mLock) {
                 if (DEBUG) {
-                    Log.i(LOG_TAG,  "Process: " + Process.myPid() + "clear()");
+                    Log.i(LOG_TAG, "clear()");
+                }
+                // Recycle the nodes before clearing the cache.
+                final int nodeCount = mCacheImpl.size();
+                for (int i = 0; i < nodeCount; i++) {
+                    AccessibilityNodeInfo info = mCacheImpl.valueAt(i);
+                    info.recycle();
                 }
                 mCacheImpl.clear();
             }
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 98d59c4..b9dfb2e 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -9238,6 +9238,30 @@
         }
     }
 
+    private void setHitTestTypeFromUrl(String url) {
+        String substr = null;
+        if (url.startsWith(SCHEME_GEO)) {
+            mInitialHitTestResult.mType = HitTestResult.GEO_TYPE;
+            substr = url.substring(SCHEME_GEO.length());
+        } else if (url.startsWith(SCHEME_TEL)) {
+            mInitialHitTestResult.mType = HitTestResult.PHONE_TYPE;
+            substr = url.substring(SCHEME_TEL.length());
+        } else if (url.startsWith(SCHEME_MAILTO)) {
+            mInitialHitTestResult.mType = HitTestResult.EMAIL_TYPE;
+            substr = url.substring(SCHEME_MAILTO.length());
+        } else {
+            mInitialHitTestResult.mType = HitTestResult.SRC_ANCHOR_TYPE;
+            mInitialHitTestResult.mExtra = url;
+            return;
+        }
+        try {
+            mInitialHitTestResult.mExtra = URLDecoder.decode(substr, "UTF-8");
+        } catch (Throwable e) {
+            Log.w(LOGTAG, "Failed to decode URL! " + substr, e);
+            mInitialHitTestResult.mType = HitTestResult.UNKNOWN_TYPE;
+        }
+    }
+
     private void setHitTestResult(WebKitHitTest hit) {
         if (hit == null) {
             mInitialHitTestResult = null;
@@ -9245,9 +9269,9 @@
         }
         mInitialHitTestResult = new HitTestResult();
         if (hit.mLinkUrl != null) {
-            mInitialHitTestResult.mType = HitTestResult.SRC_ANCHOR_TYPE;
-            mInitialHitTestResult.mExtra = hit.mLinkUrl;
-            if (hit.mImageUrl != null) {
+            setHitTestTypeFromUrl(hit.mLinkUrl);
+            if (hit.mImageUrl != null
+                    && mInitialHitTestResult.mType == HitTestResult.SRC_ANCHOR_TYPE) {
                 mInitialHitTestResult.mType = HitTestResult.SRC_IMAGE_ANCHOR_TYPE;
                 mInitialHitTestResult.mExtra = hit.mImageUrl;
             }
@@ -9257,25 +9281,7 @@
         } else if (hit.mEditable) {
             mInitialHitTestResult.mType = HitTestResult.EDIT_TEXT_TYPE;
         } else if (hit.mIntentUrl != null) {
-            String substr = null;
-            if (hit.mIntentUrl.startsWith(SCHEME_GEO)) {
-                mInitialHitTestResult.mType = HitTestResult.GEO_TYPE;
-                substr = hit.mIntentUrl.substring(SCHEME_GEO.length());
-            } else if (hit.mIntentUrl.startsWith(SCHEME_TEL)) {
-                mInitialHitTestResult.mType = HitTestResult.PHONE_TYPE;
-                substr = hit.mIntentUrl.substring(SCHEME_TEL.length());
-            } else if (hit.mIntentUrl.startsWith(SCHEME_MAILTO)) {
-                mInitialHitTestResult.mType = HitTestResult.EMAIL_TYPE;
-                substr = hit.mIntentUrl.substring(SCHEME_MAILTO.length());
-            } else {
-                return;
-            }
-            try {
-                mInitialHitTestResult.mExtra = URLDecoder.decode(substr, "UTF-8");
-            } catch (Throwable e) {
-                Log.w(LOGTAG, "Failed to decode GEO URL!", e);
-                mInitialHitTestResult.mType = HitTestResult.UNKNOWN_TYPE;
-            }
+            setHitTestTypeFromUrl(hit.mIntentUrl);
         }
     }
 
@@ -9522,10 +9528,11 @@
             }
         }
         nativeSetTextSelection(mNativeClass, data.mSelectTextPtr);
-        if (data.mSelectTextPtr != 0) {
-            mIsCaretSelection = (mFieldPointer == nodePointer)
-                    && (mFieldPointer != 0)
-                    && (data.mStart == data.mEnd);
+
+        if (data.mSelectTextPtr != 0 &&
+                (data.mStart != data.mEnd ||
+                (mFieldPointer == nodePointer && mFieldPointer != 0))) {
+            mIsCaretSelection = (data.mStart == data.mEnd);
             if (!mSelectingText) {
                 setupWebkitSelect();
             } else if (!mSelectionStarted) {
diff --git a/core/java/com/android/internal/statusbar/StatusBarNotification.java b/core/java/com/android/internal/statusbar/StatusBarNotification.java
index c03ff1a..d443523 100644
--- a/core/java/com/android/internal/statusbar/StatusBarNotification.java
+++ b/core/java/com/android/internal/statusbar/StatusBarNotification.java
@@ -34,25 +34,23 @@
 }
 */
 
+/**
+ * Class encapsulating a Notification. Sent by the NotificationManagerService to the IStatusBar (in System UI).
+ */
 public class StatusBarNotification implements Parcelable {
-    public static int PRIORITY_JIFFY_EXPRESS = -100;
-    public static int PRIORITY_NORMAL        = 0;
-    public static int PRIORITY_ONGOING       = 100;
-    public static int PRIORITY_SYSTEM        = 200;
-
     public String pkg;
     public int id;
     public String tag;
     public int uid;
     public int initialPid;
     public Notification notification;
-    public int priority = PRIORITY_NORMAL;
-
+    public int score;
+    
     public StatusBarNotification() {
     }
 
     public StatusBarNotification(String pkg, int id, String tag,
-            int uid, int initialPid, Notification notification) {
+            int uid, int initialPid, int score, Notification notification) {
         if (pkg == null) throw new NullPointerException();
         if (notification == null) throw new NullPointerException();
 
@@ -61,9 +59,8 @@
         this.tag = tag;
         this.uid = uid;
         this.initialPid = initialPid;
+        this.score = score;
         this.notification = notification;
-
-        this.priority = PRIORITY_NORMAL;
     }
 
     public StatusBarNotification(Parcel in) {
@@ -80,7 +77,7 @@
         }
         this.uid = in.readInt();
         this.initialPid = in.readInt();
-        this.priority = in.readInt();
+        this.score = in.readInt();
         this.notification = new Notification(in);
     }
 
@@ -95,7 +92,7 @@
         }
         out.writeInt(this.uid);
         out.writeInt(this.initialPid);
-        out.writeInt(this.priority);
+        out.writeInt(this.score);
         this.notification.writeToParcel(out, flags);
     }
 
@@ -119,12 +116,12 @@
 
     public StatusBarNotification clone() {
         return new StatusBarNotification(this.pkg, this.id, this.tag,
-                this.uid, this.initialPid, this.notification.clone());
+                this.uid, this.initialPid, this.score, this.notification.clone());
     }
 
     public String toString() {
-        return "StatusBarNotification(package=" + pkg + " id=" + id + " tag=" + tag
-                + " notification=" + notification + " priority=" + priority + ")";
+        return "StatusBarNotification(pkg=" + pkg + " id=" + id + " tag=" + tag
+                + " score=" + score + " notn=" + notification + ")";
     }
 
     public boolean isOngoing() {
diff --git a/docs/html/guide/developing/projects/projects-eclipse.jd b/docs/html/guide/developing/projects/projects-eclipse.jd
index 40c17ed..90f7820 100644
--- a/docs/html/guide/developing/projects/projects-eclipse.jd
+++ b/docs/html/guide/developing/projects/projects-eclipse.jd
@@ -201,7 +201,7 @@
   priority. The application itself has highest priority and its resources are always used in
   preference to identical resource IDs defined in libraries.</p>
 
-  <h3>Declaring library components in the the manifest file</h3>
+  <h3>Declaring library components in the manifest file</h3>
 
   <p>In the manifest file of the application project, you must add declarations of all components
   that the application will use that are imported from a library project. For example, you must
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index 4acbdbe..e14b1c4 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -577,7 +577,7 @@
                 {
                     /* size_t index = */updateBuffers(kPortIndexInput, msg);
 
-                    if (mState == FLUSHING) {
+                    if (mState == FLUSHING || mState == STOPPING) {
                         returnBuffersToCodecOnPort(kPortIndexInput);
                         break;
                     }
@@ -596,7 +596,7 @@
                 {
                     /* size_t index = */updateBuffers(kPortIndexOutput, msg);
 
-                    if (mState == FLUSHING) {
+                    if (mState == FLUSHING || mState == STOPPING) {
                         returnBuffersToCodecOnPort(kPortIndexOutput);
                         break;
                     }
@@ -673,9 +673,8 @@
 
             int32_t nameIsType;
             int32_t encoder = false;
-            if (!msg->findInt32("nameIsType", &nameIsType)) {
-                nameIsType = false;
-            } else {
+            CHECK(msg->findInt32("nameIsType", &nameIsType));
+            if (nameIsType) {
                 CHECK(msg->findInt32("encoder", &encoder));
             }
 
diff --git a/media/libstagefright/codecs/aacenc/basic_op/basic_op.h b/media/libstagefright/codecs/aacenc/basic_op/basic_op.h
index ef3c31b..e878bba 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/basic_op.h
+++ b/media/libstagefright/codecs/aacenc/basic_op/basic_op.h
@@ -228,7 +228,7 @@
 __inline Word32 ASM_L_shr(Word32 L_var1, Word16 var2)
 {
 	Word32 result;
-	asm volatile(
+	asm (
 		"MOV %[result], %[L_var1], ASR %[var2] \n"
 		:[result]"=r"(result)
 		:[L_var1]"r"(L_var1), [var2]"r"(var2)
@@ -239,15 +239,12 @@
 __inline Word32 ASM_L_shl(Word32 L_var1, Word16 var2)
 {
 	Word32 result;
-	asm volatile(
-		"MOV	r2, %[L_var1] \n"
-		"MOV	r3, #0x7fffffff\n"
+	asm (
 		"MOV	%[result], %[L_var1], ASL %[var2] \n"
-		"TEQ	r2, %[result], ASR %[var2]\n"
-		"EORNE  %[result],r3,r2,ASR#31\n"
-		:[result]"+r"(result)
-		:[L_var1]"r"(L_var1), [var2]"r"(var2)
-		:"r2", "r3"
+		"TEQ	%[L_var1], %[result], ASR %[var2]\n"
+		"EORNE  %[result], %[mask], %[L_var1], ASR #31\n"
+		:[result]"=&r"(result)
+		:[L_var1]"r"(L_var1), [var2]"r"(var2), [mask]"r"(0x7fffffff)
 		);
 	return result;
 }
@@ -255,10 +252,10 @@
 __inline Word32 ASM_shr(Word32 L_var1, Word16 var2)
 {
 	Word32 result;
-	asm volatile(
+	asm (
 		"CMP	%[var2], #15\n"
-		"MOVGE  %[var2], #15\n"
-		"MOV	%[result], %[L_var1], ASR %[var2]\n"
+		"MOVLT	%[result], %[L_var1], ASR %[var2]\n"
+		"MOVGE	%[result], %[L_var1], ASR #15\n"
 		:[result]"=r"(result)
 		:[L_var1]"r"(L_var1), [var2]"r"(var2)
 		);
@@ -268,18 +265,16 @@
 __inline Word32 ASM_shl(Word32 L_var1, Word16 var2)
 {
 	Word32 result;
-	asm volatile(
+	Word32 tmp;
+	asm (
 		"CMP	%[var2], #16\n"
-		"MOVGE  %[var2], #16\n"
-		"MOV    %[result], %[L_var1], ASL %[var2]\n"
-		"MOV    r3, #1\n"
-        "MOV    r2, %[result], ASR #15\n"
-        "RSB    r3,r3,r3,LSL #15 \n"
-        "TEQ    r2, %[result], ASR #31 \n"
-        "EORNE  %[result], r3, %[result],ASR #31"
-		:[result]"+r"(result)
-		:[L_var1]"r"(L_var1), [var2]"r"(var2)
-		:"r2", "r3"
+		"MOVLT  %[result], %[L_var1], ASL %[var2]\n"
+		"MOVGE  %[result], %[L_var1], ASL #16\n"
+        "MOV    %[tmp], %[result], ASR #15\n"
+        "TEQ    %[tmp], %[result], ASR #31 \n"
+        "EORNE  %[result], %[mask], %[result],ASR #31"
+		:[result]"=&r"(result), [tmp]"=&r"(tmp)
+		:[L_var1]"r"(L_var1), [var2]"r"(var2), [mask]"r"(0x7fff)
 		);
 	return result;
 }
@@ -295,16 +290,14 @@
 {
 #if ARMV5TE_SAT
 	Word16 result;
+	Word32 tmp;
 	asm volatile (
-		"MOV	%[result], %[L_var1]\n"
-		"MOV	r3, #1\n"
-		"MOV	r2,%[L_var1],ASR#15\n"
-		"RSB	r3, r3, r3, LSL #15\n"
-		"TEQ	r2,%[L_var1],ASR#31\n"
-		"EORNE	%[result],r3,%[L_var1],ASR#31\n"
-		:[result]"+r"(result)
-		:[L_var1]"r"(L_var1)
-		:"r2", "r3"
+		"MOV	%[tmp], %[L_var1],ASR#15\n"
+		"TEQ	%[tmp], %[L_var1],ASR#31\n"
+		"EORNE	%[result], %[mask],%[L_var1],ASR#31\n"
+		"MOVEQ	%[result], %[L_var1]\n"
+		:[result]"=&r"(result), [tmp]"=&r"(tmp)
+		:[L_var1]"r"(L_var1), [mask]"r"(0x7fff)
 	);
 
 	return result;
@@ -420,10 +413,10 @@
 {
 #if ARMV5TE_L_MULT
 	Word32 result;
-	asm volatile(
+	asm (
 		"SMULBB %[result], %[var1], %[var2] \n"
 		"QADD %[result], %[result], %[result] \n"
-		:[result]"+r"(result)
+		:[result]"=r"(result)
 		:[var1]"r"(var1), [var2]"r"(var2)
 		);
 	return result;
@@ -450,11 +443,11 @@
 {
 #if ARMV5TE_L_MSU
 	Word32 result;
-	asm volatile(
+	asm (
 		"SMULBB %[result], %[var1], %[var2] \n"
 		"QADD %[result], %[result], %[result] \n"
 		"QSUB %[result], %[L_var3], %[result]\n"
-		:[result]"+r"(result)
+		:[result]"=&r"(result)
 		:[L_var3]"r"(L_var3), [var1]"r"(var1), [var2]"r"(var2)
 		);
 	return result;
@@ -474,9 +467,9 @@
 {
 #if ARMV5TE_L_SUB
 	Word32 result;
-	asm volatile(
+	asm (
 		"QSUB %[result], %[L_var1], %[L_var2]\n"
-		:[result]"+r"(result)
+		:[result]"=r"(result)
 		:[L_var1]"r"(L_var1), [L_var2]"r"(L_var2)
 		);
 	return result;
@@ -589,16 +582,14 @@
 {
 #if ARMV5TE_ADD
 	Word32 result;
-	asm volatile(
+	Word32 tmp;
+	asm (
 		"ADD  %[result], %[var1], %[var2] \n"
-		"MOV  r3, #0x1\n"
-		"MOV  r2, %[result], ASR #15\n"
-		"RSB  r3, r3, r3, LSL, #15\n"
-		"TEQ  r2, %[result], ASR #31\n"
-		"EORNE %[result], r3, %[result], ASR #31"
-		:[result]"+r"(result)
-		:[var1]"r"(var1), [var2]"r"(var2)
-		:"r2", "r3"
+		"MOV  %[tmp], %[result], ASR #15 \n"
+		"TEQ  %[tmp], %[result], ASR #31 \n"
+		"EORNE %[result], %[mask], %[result], ASR #31"
+		:[result]"=&r"(result), [tmp]"=&r"(tmp)
+		:[var1]"r"(var1), [var2]"r"(var2), [mask]"r"(0x7fff)
 		);
 	return result;
 #else
@@ -619,16 +610,14 @@
 {
 #if ARMV5TE_SUB
 	Word32 result;
-	asm volatile(
-		"MOV   r3, #1\n"
+	Word32 tmp;
+	asm (
 		"SUB   %[result], %[var1], %[var2] \n"
-		"RSB   r3,r3,r3,LSL#15\n"
-		"MOV   r2, %[var1], ASR #15 \n"
-		"TEQ   r2, %[var1], ASR #31 \n"
-		"EORNE %[result], r3, %[result], ASR #31 \n"
-		:[result]"+r"(result)
-		:[var1]"r"(var1), [var2]"r"(var2)
-		:"r2", "r3"
+		"MOV   %[tmp], %[var1], ASR #15 \n"
+		"TEQ   %[tmp], %[var1], ASR #31 \n"
+		"EORNE %[result], %[mask], %[result], ASR #31 \n"
+		:[result]"=&r"(result), [tmp]"=&r"(tmp)
+		:[var1]"r"(var1), [var2]"r"(var2), [mask]"r"(0x7fff)
 		);
 	return result;
 #else
@@ -683,18 +672,15 @@
 __inline Word16 mult (Word16 var1, Word16 var2)
 {
 #if ARMV5TE_MULT
-	Word32 result;
-	asm volatile(
-		"SMULBB r2, %[var1], %[var2] \n"
-		"MOV	r3, #1\n"
-		"MOV	%[result], r2, ASR #15\n"
-		"RSB	r3, r3, r3, LSL #15\n"
-		"MOV	r2, %[result], ASR #15\n"
-		"TEQ	r2, %[result], ASR #31\n"
-		"EORNE  %[result], r3, %[result], ASR #31 \n"
-		:[result]"+r"(result)
-		:[var1]"r"(var1), [var2]"r"(var2)
-		:"r2", "r3"
+	Word32 result, tmp;
+	asm (
+		"SMULBB %[tmp], %[var1], %[var2] \n"
+		"MOV	%[result], %[tmp], ASR #15\n"
+		"MOV	%[tmp], %[result], ASR #15\n"
+		"TEQ	%[tmp], %[result], ASR #31\n"
+		"EORNE  %[result], %[mask], %[result], ASR #31 \n"
+		:[result]"=&r"(result), [tmp]"=&r"(tmp)
+		:[var1]"r"(var1), [var2]"r"(var2), [mask]"r"(0x7fff)
 		);
 	return result;
 #else
@@ -719,18 +705,17 @@
 {
 #if ARMV5TE_NORM_S
 	Word16 result;
-	asm volatile(
-		"MOV   r2,%[var1] \n"
-		"CMP   r2, #0\n"
-		"RSBLT %[var1], %[var1], #0 \n"
-		"CLZNE %[result], %[var1]\n"
+	Word32 tmp;
+	asm (
+		"RSBS  %[tmp], %[var1], #0 \n"
+		"CLZLT %[result], %[var1]\n"
+		"CLZGT %[result], %[tmp]\n"
 		"SUBNE %[result], %[result], #17\n"
 		"MOVEQ %[result], #0\n"
-		"CMP   r2, #-1\n"
+		"CMP   %[var1], #-1\n"
 		"MOVEQ %[result], #15\n"
-		:[result]"+r"(result)
+		:[result]"=&r"(result), [tmp]"=&r"(tmp)
 		:[var1]"r"(var1)
-		:"r2"
 		);
 	return result;
 #else
@@ -774,7 +759,7 @@
 		"CLZNE  %[result], %[L_var1]\n"
 		"SUBNE  %[result], %[result], #1\n"
 		"MOVEQ  %[result], #0\n"
-		:[result]"+r"(result)
+		:[result]"=r"(result)
 		:[L_var1]"r"(L_var1)
 		);
 	return result;
@@ -979,13 +964,11 @@
 {
 #if ARMV5TE_ROUND
 	Word16 result;
-	asm volatile(
-		"MOV   r1,#0x00008000\n"
-		"QADD  %[result], %[L_var1], r1\n"
+	asm (
+		"QADD  %[result], %[L_var1], %[bias]\n"
 		"MOV   %[result], %[result], ASR #16 \n"
-		:[result]"+r"(result)
-		:[L_var1]"r"(L_var1)
-		:"r1"
+		:[result]"=r"(result)
+		:[L_var1]"r"(L_var1), [bias]"r"(0x8000)
 		);
 	return result;
 #else
@@ -1005,11 +988,11 @@
 {
 #if ARMV5TE_L_MAC
 	Word32 result;
-	asm volatile(
+	asm (
 		"SMULBB %[result], %[var1], %[var2]\n"
 		"QADD	%[result], %[result], %[result]\n"
 		"QADD   %[result], %[result], %[L_var3]\n"
-		:[result]"+r"(result)
+		:[result]"=&r"(result)
 		: [L_var3]"r"(L_var3), [var1]"r"(var1), [var2]"r"(var2)
 		);
 	return result;
@@ -1029,9 +1012,9 @@
 {
 #if ARMV5TE_L_ADD
 	Word32 result;
-	asm volatile(
+	asm (
 		"QADD %[result], %[L_var1], %[L_var2]\n"
-		:[result]"+r"(result)
+		:[result]"=r"(result)
 		:[L_var1]"r"(L_var1), [L_var2]"r"(L_var2)
 		);
 	return result;
diff --git a/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h b/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h
index 9ebd1c2..6e5844f 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h
+++ b/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h
@@ -63,7 +63,7 @@
 	Word32 result;
 	asm volatile(
 		"SMULWB  %[result], %[L_var2], %[var1] \n"
-		:[result]"+r"(result)
+		:[result]"=r"(result)
 		:[L_var2]"r"(L_var2), [var1]"r"(var1)
 		);
 	return result;
diff --git a/media/libstagefright/codecs/aacenc/inc/aacenc_core.h b/media/libstagefright/codecs/aacenc/inc/aacenc_core.h
index 1acdbbc..bb75b6d 100644
--- a/media/libstagefright/codecs/aacenc/inc/aacenc_core.h
+++ b/media/libstagefright/codecs/aacenc/inc/aacenc_core.h
@@ -102,7 +102,7 @@
                     const UWord8       *ancBytes,      /*!< pointer to ancillary data bytes */
                     Word16             *numAncBytes,   /*!< number of ancillary Data Bytes, send as fill element  */
                     UWord8             *outBytes,      /*!< pointer to output buffer            */
-                    Word32             *numOutBytes    /*!< number of bytes in output buffer */
+                    VO_U32             *numOutBytes    /*!< number of bytes in output buffer */
                     );
 
 /*---------------------------------------------------------------------------
diff --git a/media/libstagefright/codecs/aacenc/inc/bitbuffer.h b/media/libstagefright/codecs/aacenc/inc/bitbuffer.h
index e538064..7c79f07 100644
--- a/media/libstagefright/codecs/aacenc/inc/bitbuffer.h
+++ b/media/libstagefright/codecs/aacenc/inc/bitbuffer.h
@@ -76,7 +76,7 @@
 
 
 Word16 WriteBits(HANDLE_BIT_BUF hBitBuf,
-                 Word32 writeValue,
+                 UWord32 writeValue,
                  Word16 noBitsToWrite);
 
 void ResetBitBuf(HANDLE_BIT_BUF hBitBuf,
diff --git a/media/libstagefright/codecs/aacenc/inc/psy_configuration.h b/media/libstagefright/codecs/aacenc/inc/psy_configuration.h
index 9abfc99..f6981fa 100644
--- a/media/libstagefright/codecs/aacenc/inc/psy_configuration.h
+++ b/media/libstagefright/codecs/aacenc/inc/psy_configuration.h
@@ -31,7 +31,7 @@
 
   Word16 sfbCnt;
   Word16 sfbActive;   /* number of sf bands containing energy after lowpass */
-  Word16 *sfbOffset;
+  const Word16 *sfbOffset;
 
   Word32 sfbThresholdQuiet[MAX_SFB_LONG];
 
@@ -61,7 +61,7 @@
 
   Word16 sfbCnt;
   Word16 sfbActive;   /* number of sf bands containing energy after lowpass */
-  Word16 *sfbOffset;
+  const Word16 *sfbOffset;
 
   Word32 sfbThresholdQuiet[MAX_SFB_SHORT];
 
diff --git a/media/libstagefright/codecs/aacenc/src/aacenc_core.c b/media/libstagefright/codecs/aacenc/src/aacenc_core.c
index 2b3bd48..cecbc8f 100644
--- a/media/libstagefright/codecs/aacenc/src/aacenc_core.c
+++ b/media/libstagefright/codecs/aacenc/src/aacenc_core.c
@@ -146,7 +146,7 @@
                     const UWord8 *ancBytes,     /*!< pointer to ancillary data bytes */
                     Word16 *numAncBytes,		/*!< number of ancillary Data Bytes */
                     UWord8 *outBytes,           /*!< pointer to output buffer (must be large MINBITS_COEF/8*MAX_CHANNELS bytes) */
-                    Word32 *numOutBytes         /*!< number of bytes in output buffer after processing */
+                    VO_U32 *numOutBytes         /*!< number of bytes in output buffer after processing */
                     )
 {
   ELEMENT_INFO *elInfo = &aacEnc->elInfo;
diff --git a/media/libstagefright/codecs/aacenc/src/adj_thr.c b/media/libstagefright/codecs/aacenc/src/adj_thr.c
index a8ab809..373b063 100644
--- a/media/libstagefright/codecs/aacenc/src/adj_thr.c
+++ b/media/libstagefright/codecs/aacenc/src/adj_thr.c
@@ -26,6 +26,7 @@
 #include "adj_thr.h"
 #include "qc_data.h"
 #include "line_pe.h"
+#include <string.h>
 
 
 #define  minSnrLimit    0x6666 /* 1 dB */
@@ -1138,6 +1139,7 @@
   Word16 maxBitresBits = elBits->maxBits;
   Word16 sideInfoBits = (qcOE->staticBitsUsed + qcOE->ancBitsUsed);
   Word16 ch;
+  memset(&peData, 0, sizeof(peData));
 
   prepareSfbPe(&peData, psyOutChannel, logSfbEnergy, sfbNRelevantLines, nChannels, AdjThrStateElement->peOffset);
 
diff --git a/media/libstagefright/codecs/aacenc/src/bitbuffer.c b/media/libstagefright/codecs/aacenc/src/bitbuffer.c
index 5615ac3..a706893 100644
--- a/media/libstagefright/codecs/aacenc/src/bitbuffer.c
+++ b/media/libstagefright/codecs/aacenc/src/bitbuffer.c
@@ -138,7 +138,7 @@
 *
 *****************************************************************************/
 Word16 WriteBits(HANDLE_BIT_BUF hBitBuf,
-                 Word32 writeValue,
+                 UWord32 writeValue,
                  Word16 noBitsToWrite)
 {
   Word16 wBitPos;
diff --git a/media/libstagefright/codecs/aacenc/src/dyn_bits.c b/media/libstagefright/codecs/aacenc/src/dyn_bits.c
index 3d2efdc..7769188 100644
--- a/media/libstagefright/codecs/aacenc/src/dyn_bits.c
+++ b/media/libstagefright/codecs/aacenc/src/dyn_bits.c
@@ -281,7 +281,7 @@
                  const Word32 blockType)
 {
   Word32 grpNdx, i;
-  Word16 *sideInfoTab = NULL;
+  const Word16 *sideInfoTab = NULL;
   SECTION_INFO *sectionInfo;
 
   /*
diff --git a/media/libstagefright/codecs/aacenc/src/interface.c b/media/libstagefright/codecs/aacenc/src/interface.c
index f2472d8..d0ad433 100644
--- a/media/libstagefright/codecs/aacenc/src/interface.c
+++ b/media/libstagefright/codecs/aacenc/src/interface.c
@@ -99,8 +99,8 @@
     Word32 i;
     Word32 accuSumMS=0;
     Word32 accuSumLR=0;
-	Word32 *pSumMS = sfbEnergySumMS.sfbShort;
-	Word32 *pSumLR = sfbEnergySumLR.sfbShort;
+    const Word32 *pSumMS = sfbEnergySumMS.sfbShort;
+    const Word32 *pSumLR = sfbEnergySumLR.sfbShort;
 
     for (i=TRANS_FAC; i; i--) {
       accuSumLR = L_add(accuSumLR, *pSumLR); pSumLR++;
diff --git a/media/libstagefright/codecs/aacenc/src/psy_configuration.c b/media/libstagefright/codecs/aacenc/src/psy_configuration.c
index 02d92ab..dd40f9b 100644
--- a/media/libstagefright/codecs/aacenc/src/psy_configuration.c
+++ b/media/libstagefright/codecs/aacenc/src/psy_configuration.c
@@ -139,7 +139,7 @@
 *
 *****************************************************************************/
 static void initThrQuiet(Word16  numPb,
-                         Word16 *pbOffset,
+                         const Word16 *pbOffset,
                          Word16 *pbBarcVal,
                          Word32 *pbThresholdQuiet) {
   Word16 i;
@@ -250,7 +250,7 @@
 *
 *****************************************************************************/
 static void initBarcValues(Word16  numPb,
-                           Word16 *pbOffset,
+                           const Word16 *pbOffset,
                            Word16  numLines,
                            Word32  samplingFrequency,
                            Word16 *pbBval)
diff --git a/media/libstagefright/codecs/aacenc/src/psy_main.c b/media/libstagefright/codecs/aacenc/src/psy_main.c
index 085acb8..4e9218c 100644
--- a/media/libstagefright/codecs/aacenc/src/psy_main.c
+++ b/media/libstagefright/codecs/aacenc/src/psy_main.c
@@ -658,7 +658,8 @@
   Word32 normEnergyShift = (psyData->mdctScale + 1) << 1; /* in reference code, mdct spectrum must be multipied with 2, so +1 */
   Word32 clipEnergy = hPsyConfShort->clipEnergy >> normEnergyShift;
   Word32 wOffset = 0;
-  Word32 *data0, *data1;
+  Word32 *data0;
+  const Word32 *data1;
 
   for(w = 0; w < TRANS_FAC; w++) {
     Word32 i, tdata;
diff --git a/media/libstagefright/codecs/aacenc/src/quantize.c b/media/libstagefright/codecs/aacenc/src/quantize.c
index 54add2f..0d0f550 100644
--- a/media/libstagefright/codecs/aacenc/src/quantize.c
+++ b/media/libstagefright/codecs/aacenc/src/quantize.c
@@ -110,7 +110,7 @@
   Word32 m = gain&3;
   Word32 g = (gain >> 2) + 4;
   Word32 mdctSpeL;
-  Word16 *pquat;
+  const Word16 *pquat;
     /* gain&3 */
 
   pquat = quantBorders[m];
@@ -333,7 +333,7 @@
   Word32 m = gain&3;
   Word32 g = (gain >> 2) + 4;
   Word32 g2 = (g << 1) + 1;
-  Word16 *pquat, *repquat;
+  const Word16 *pquat, *repquat;
     /* gain&3 */
 
   pquat = quantBorders[m];
diff --git a/media/libstagefright/codecs/amrnb/common/src/az_lsp.cpp b/media/libstagefright/codecs/amrnb/common/src/az_lsp.cpp
index bd99b30..4135f30 100644
--- a/media/libstagefright/codecs/amrnb/common/src/az_lsp.cpp
+++ b/media/libstagefright/codecs/amrnb/common/src/az_lsp.cpp
@@ -299,7 +299,7 @@
     t0 += (Word32) * (p_f) << 13;
 
 
-    if ((UWord32)(t0 - 0xfe000000L) < 0x01ffffffL -  0xfe000000L)
+    if ((UWord32)(t0 - 0xfe000000L) < (UWord32)0x03ffffffL)
     {
         cheb = (Word16)(t0 >> 10);
     }
diff --git a/media/libstagefright/codecs/amrnb/enc/src/set_sign.cpp b/media/libstagefright/codecs/amrnb/enc/src/set_sign.cpp
index dedf91a..d626de3 100644
--- a/media/libstagefright/codecs/amrnb/enc/src/set_sign.cpp
+++ b/media/libstagefright/codecs/amrnb/enc/src/set_sign.cpp
@@ -552,10 +552,10 @@
         else
         {
             *(p_sign--) = -32767;                     /* sign = -1 */
-            cor = - (cor);
+            cor = negate(cor);
 
             /* modify dn[] according to the fixed sign */
-            dn[i] = - val;
+            dn[i] = negate(val);
         }
 
         *(p_en--) = cor;
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index cd8bd4e..14ce266 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -236,10 +236,6 @@
             public void onAnimationEnd(Animator animation) {
                 mCallback.onChildDismissed(view);
                 animView.setLayerType(View.LAYER_TYPE_NONE, null);
-                // Restore the alpha/translation parameters to what they were before swiping
-                // (for when these items are recycled)
-                animView.setAlpha(1f);
-                setTranslation(animView, 0f);
             }
         });
         anim.addUpdateListener(new AnimatorUpdateListener() {
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
index 4718a17..4dc3e33 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
@@ -181,6 +181,11 @@
         mLinearLayout.removeView(v);
         mCallback.handleSwipe(v);
         v.setActivated(false);
+        // Restore the alpha/translation parameters to what they were before swiping
+        // (for when these items are recycled)
+        View contentView = getChildContentView(v);
+        contentView.setAlpha(1f);
+        contentView.setTranslationY(0);
     }
 
     public void onBeginDrag(View v) {
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
index 0605c4c..19fce37 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
@@ -187,6 +187,11 @@
         mLinearLayout.removeView(v);
         mCallback.handleSwipe(v);
         v.setActivated(false);
+        // Restore the alpha/translation parameters to what they were before swiping
+        // (for when these items are recycled)
+        View contentView = getChildContentView(v);
+        contentView.setAlpha(1f);
+        contentView.setTranslationX(0);
     }
 
     public void onBeginDrag(View v) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 3d904ee..6fbcd64 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -47,12 +47,13 @@
     }
     private final ArrayList<Entry> mEntries = new ArrayList<Entry>();
     private final Comparator<Entry> mEntryCmp = new Comparator<Entry>() {
+        // sort first by score, then by when
         public int compare(Entry a, Entry b) {
             final StatusBarNotification na = a.notification;
             final StatusBarNotification nb = b.notification;
-            int priDiff = na.priority - nb.priority;
-            return (priDiff != 0)
-                ? priDiff
+            int d = na.score - nb.score;
+            return (d != 0)
+                ? d
                 : (int)(na.notification.when - nb.notification.when);
         }
     };
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 b3cef90..401553f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -232,6 +232,11 @@
 
     private int mNavigationIconHints = 0;
 
+    // TODO(dsandler): codify this stuff in NotificationManager's header somewhere
+    private int mDisplayMinScore             = Notification.PRIORITY_LOW * 10;
+    private int mIntruderMinScore            = Notification.PRIORITY_HIGH * 10;
+    private int mIntruderInImmersiveMinScore = Notification.PRIORITY_HIGH * 10 + 5;
+    
     private class ExpandedDialog extends Dialog {
         ExpandedDialog(Context context) {
             super(context, com.android.internal.R.style.Theme_Translucent_NoTitleBar);
@@ -540,6 +545,7 @@
     }
 
     public void addNotification(IBinder key, StatusBarNotification notification) {
+        /* if (DEBUG) */ Slog.d(TAG, "addNotification score=" + notification.score);
         StatusBarIconView iconView = addNotificationViews(key, notification);
         if (iconView == null) return;
 
@@ -551,31 +557,30 @@
             }
         } catch (RemoteException ex) {
         }
-        if (immersive) {
-            if ((notification.notification.flags & Notification.FLAG_HIGH_PRIORITY) != 0) {
-                Slog.d(TAG, "Presenting high-priority notification in immersive activity");
-                // special new transient ticker mode
-                // 1. Populate mIntruderAlertView
+        if ((notification.score >= mIntruderInImmersiveMinScore) 
+                || (!immersive && (notification.score > mIntruderMinScore))) {
+            Slog.d(TAG, "Presenting high-priority notification");
+            // special new transient ticker mode
+            // 1. Populate mIntruderAlertView
 
-                ImageView alertIcon = (ImageView) mIntruderAlertView.findViewById(R.id.alertIcon);
-                TextView alertText = (TextView) mIntruderAlertView.findViewById(R.id.alertText);
-                alertIcon.setImageDrawable(StatusBarIconView.getIcon(
-                    alertIcon.getContext(),
-                    iconView.getStatusBarIcon()));
-                alertText.setText(notification.notification.tickerText);
+            ImageView alertIcon = (ImageView) mIntruderAlertView.findViewById(R.id.alertIcon);
+            TextView alertText = (TextView) mIntruderAlertView.findViewById(R.id.alertText);
+            alertIcon.setImageDrawable(StatusBarIconView.getIcon(
+                alertIcon.getContext(),
+                iconView.getStatusBarIcon()));
+            alertText.setText(notification.notification.tickerText);
 
-                View button = mIntruderAlertView.findViewById(R.id.intruder_alert_content);
-                button.setOnClickListener(
-                    new NotificationClicker(notification.notification.contentIntent,
-                        notification.pkg, notification.tag, notification.id));
+            View button = mIntruderAlertView.findViewById(R.id.intruder_alert_content);
+            button.setOnClickListener(
+                new NotificationClicker(notification.notification.contentIntent,
+                    notification.pkg, notification.tag, notification.id));
 
-                // 2. Animate mIntruderAlertView in
-                mHandler.sendEmptyMessage(MSG_SHOW_INTRUDER);
+            // 2. Animate mIntruderAlertView in
+            mHandler.sendEmptyMessage(MSG_SHOW_INTRUDER);
 
-                // 3. Set alarm to age the notification off (TODO)
-                mHandler.removeMessages(MSG_HIDE_INTRUDER);
-                mHandler.sendEmptyMessageDelayed(MSG_HIDE_INTRUDER, INTRUDER_ALERT_DECAY_MS);
-            }
+            // 3. Set alarm to age the notification off (TODO)
+            mHandler.removeMessages(MSG_HIDE_INTRUDER);
+            mHandler.sendEmptyMessageDelayed(MSG_HIDE_INTRUDER, INTRUDER_ALERT_DECAY_MS);
         } else if (notification.notification.fullScreenIntent != null) {
             // not immersive & a full-screen alert should be shown
             Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
@@ -632,8 +637,8 @@
                 && oldContentView.getLayoutId() == contentView.getLayoutId();
         ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent();
         boolean orderUnchanged = notification.notification.when==oldNotification.notification.when
-                && notification.priority == oldNotification.priority;
-                // priority now encompasses isOngoing()
+                && notification.score == oldNotification.score;
+                // score now encompasses/supersedes isOngoing()
 
         boolean updateTicker = notification.notification.tickerText != null
                 && !TextUtils.equals(notification.notification.tickerText,
@@ -725,69 +730,6 @@
     }
 
 
-    View[] makeNotificationView(StatusBarNotification notification, ViewGroup parent) {
-        Notification n = notification.notification;
-        RemoteViews remoteViews = n.contentView;
-        if (remoteViews == null) {
-            return null;
-        }
-
-        // create the row view
-        LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
-                Context.LAYOUT_INFLATER_SERVICE);
-        View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false);
-
-        // wire up the veto button
-        View vetoButton = updateNotificationVetoButton(row, notification);
-        vetoButton.setContentDescription(mContext.getString(
-                R.string.accessibility_remove_notification));
-
-        // the large icon
-        ImageView largeIcon = (ImageView)row.findViewById(R.id.large_icon);
-        if (notification.notification.largeIcon != null) {
-            largeIcon.setImageBitmap(notification.notification.largeIcon);
-        } else {
-            largeIcon.getLayoutParams().width = 0;
-            largeIcon.setVisibility(View.INVISIBLE);
-        }
-
-        // bind the click event to the content area
-        ViewGroup content = (ViewGroup)row.findViewById(R.id.content);
-        content.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
-        content.setOnFocusChangeListener(mFocusChangeListener);
-        PendingIntent contentIntent = n.contentIntent;
-        if (contentIntent != null) {
-            final View.OnClickListener listener = new NotificationClicker(contentIntent,
-                    notification.pkg, notification.tag, notification.id);
-            largeIcon.setOnClickListener(listener);
-            content.setOnClickListener(listener);
-        } else {
-            largeIcon.setOnClickListener(null);
-            content.setOnClickListener(null);
-        }
-
-        View expanded = null;
-        Exception exception = null;
-        try {
-            expanded = remoteViews.apply(mContext, content);
-        }
-        catch (RuntimeException e) {
-            exception = e;
-        }
-        if (expanded == null) {
-            String ident = notification.pkg + "/0x" + Integer.toHexString(notification.id);
-            Slog.e(TAG, "couldn't inflate view for notification " + ident, exception);
-            return null;
-        } else {
-            content.addView(expanded);
-            row.setDrawingCacheEnabled(true);
-        }
-
-        applyLegacyRowBackground(notification, content);
-
-        return new View[] { row, content, expanded };
-    }
-
     StatusBarIconView addNotificationViews(IBinder key, StatusBarNotification notification) {
         if (DEBUG) {
             Slog.d(TAG, "addNotificationViews(key=" + key + ", notification=" + notification);
@@ -850,7 +792,7 @@
         for (int i=0; i<toShow.size(); i++) {
             View v = toShow.get(i);
             if (v.getParent() == null) {
-                mPile.addView(v, 0); // the notification shade has newest at the top
+                mPile.addView(v, i);
             }
         }
     }
@@ -1807,7 +1749,7 @@
                     NotificationData.Entry e = mNotificationData.get(i);
                     pw.println("    [" + i + "] key=" + e.key + " icon=" + e.icon);
                     StatusBarNotification n = e.notification;
-                    pw.println("         pkg=" + n.pkg + " id=" + n.id + " priority=" + n.priority);
+                    pw.println("         pkg=" + n.pkg + " id=" + n.id + " score=" + n.score);
                     pw.println("         notification=" + n.notification);
                     pw.println("         tickerText=\"" + n.notification.tickerText + "\"");
                 }
@@ -2317,6 +2259,30 @@
         vib.vibrate(250);
     }
 
+    public int getScoreThreshold() {
+        return mDisplayMinScore;
+    }
+
+    public void setScoreThreshold(int score) {
+        // XXX HAX
+        if (mDisplayMinScore != score) {
+            this.mDisplayMinScore = score;
+            applyScoreThreshold();
+        }
+    }
+    
+    private void applyScoreThreshold() {
+        int N = mNotificationData.size();
+        for (int i=0; i<N; i++) {
+            NotificationData.Entry entry = mNotificationData.get(i);
+            int vis = (entry.notification.score < mDisplayMinScore)
+                ? View.GONE
+                : View.VISIBLE;
+            entry.row.setVisibility(vis);
+            entry.icon.setVisibility(vis);
+        }
+    }
+
     Runnable mStartTracing = new Runnable() {
         public void run() {
             vibrate();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java
index bb326fe..a60bba7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java
@@ -99,13 +99,14 @@
                 // Notification.Builder will helpfully fill these out for you no matter what you do
                 n.tickerView = null;
                 n.tickerText = null;
+                
+                n.priority = Notification.PRIORITY_HIGH;
 
                 int[] idOut = new int[1];
-                mNotificationService.enqueueNotificationWithTagPriority(
+                mNotificationService.enqueueNotificationWithTag(
                         mContext.getPackageName(),
                         null, 
                         GPS_NOTIFICATION_ID, 
-                        StatusBarNotification.PRIORITY_SYSTEM, // !!!1!one!!!
                         n,
                         idOut);
             } else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 5151cad..6e56cd4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -859,8 +859,8 @@
                 && oldContentView.getLayoutId() == contentView.getLayoutId();
         ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent();
         boolean orderUnchanged = notification.notification.when==oldNotification.notification.when
-                && notification.priority == oldNotification.priority;
-                // priority now encompasses isOngoing()
+                && notification.score == oldNotification.score;
+                // score now encompasses/supersedes isOngoing()
         boolean updateTicker = notification.notification.tickerText != null
                 && !TextUtils.equals(notification.notification.tickerText,
                         oldEntry.notification.notification.tickerText);
@@ -1688,7 +1688,7 @@
 
                 mNotificationDNDDummyEntry = new NotificationData.Entry(
                         null,
-                        new StatusBarNotification("", 0, "", 0, 0, dndNotification),
+                        new StatusBarNotification("", 0, "", 0, 0, Notification.PRIORITY_MAX, dndNotification),
                         iconView);
 
                 mIconLayout.addView(iconView, params);
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 6256951..2c3329e 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -432,6 +432,7 @@
         audio_format_t format,
         uint32_t channelMask,
         int frameCount,
+        // FIXME dead, remove from IAudioFlinger
         uint32_t flags,
         const sp<IMemory>& sharedBuffer,
         audio_io_handle_t output,
@@ -1932,6 +1933,46 @@
     delete mAudioMixer;
 }
 
+class CpuStats {
+public:
+    void sample();
+#ifdef DEBUG_CPU_USAGE
+private:
+    ThreadCpuUsage mCpu;
+#endif
+};
+
+void CpuStats::sample() {
+#ifdef DEBUG_CPU_USAGE
+    const CentralTendencyStatistics& stats = mCpu.statistics();
+    mCpu.sampleAndEnable();
+    unsigned n = stats.n();
+    // mCpu.elapsed() is expensive, so don't call it every loop
+    if ((n & 127) == 1) {
+        long long elapsed = mCpu.elapsed();
+        if (elapsed >= DEBUG_CPU_USAGE * 1000000000LL) {
+            double perLoop = elapsed / (double) n;
+            double perLoop100 = perLoop * 0.01;
+            double mean = stats.mean();
+            double stddev = stats.stddev();
+            double minimum = stats.minimum();
+            double maximum = stats.maximum();
+            mCpu.resetStatistics();
+            ALOGI("CPU usage over past %.1f secs (%u mixer loops at %.1f mean ms per loop):\n  us per mix loop: mean=%.0f stddev=%.0f min=%.0f max=%.0f\n  %% of wall: mean=%.1f stddev=%.1f min=%.1f max=%.1f",
+                    elapsed * .000000001, n, perLoop * .000001,
+                    mean * .001,
+                    stddev * .001,
+                    minimum * .001,
+                    maximum * .001,
+                    mean / perLoop100,
+                    stddev / perLoop100,
+                    minimum / perLoop100,
+                    maximum / perLoop100);
+        }
+    }
+#endif
+};
+
 bool AudioFlinger::MixerThread::threadLoop()
 {
     Vector< sp<Track> > tracksToRemove;
@@ -1950,42 +1991,13 @@
     uint32_t sleepTime = idleSleepTime;
     uint32_t sleepTimeShift = 0;
     Vector< sp<EffectChain> > effectChains;
-#ifdef DEBUG_CPU_USAGE
-    ThreadCpuUsage cpu;
-    const CentralTendencyStatistics& stats = cpu.statistics();
-#endif
+    CpuStats cpuStats;
 
     acquireWakeLock();
 
     while (!exitPending())
     {
-#ifdef DEBUG_CPU_USAGE
-        cpu.sampleAndEnable();
-        unsigned n = stats.n();
-        // cpu.elapsed() is expensive, so don't call it every loop
-        if ((n & 127) == 1) {
-            long long elapsed = cpu.elapsed();
-            if (elapsed >= DEBUG_CPU_USAGE * 1000000000LL) {
-                double perLoop = elapsed / (double) n;
-                double perLoop100 = perLoop * 0.01;
-                double mean = stats.mean();
-                double stddev = stats.stddev();
-                double minimum = stats.minimum();
-                double maximum = stats.maximum();
-                cpu.resetStatistics();
-                ALOGI("CPU usage over past %.1f secs (%u mixer loops at %.1f mean ms per loop):\n  us per mix loop: mean=%.0f stddev=%.0f min=%.0f max=%.0f\n  %% of wall: mean=%.1f stddev=%.1f min=%.1f max=%.1f",
-                        elapsed * .000000001, n, perLoop * .000001,
-                        mean * .001,
-                        stddev * .001,
-                        minimum * .001,
-                        maximum * .001,
-                        mean / perLoop100,
-                        stddev / perLoop100,
-                        minimum / perLoop100,
-                        maximum / perLoop100);
-            }
-        }
-#endif
+        cpuStats.sample();
         processConfigEvents();
 
         mixerStatus = MIXER_IDLE;
@@ -3306,7 +3318,6 @@
             audio_format_t format,
             uint32_t channelMask,
             int frameCount,
-            uint32_t flags,
             const sp<IMemory>& sharedBuffer,
             int sessionId)
     :   RefBase(),
@@ -3318,7 +3329,7 @@
         mFrameCount(0),
         mState(IDLE),
         mFormat(format),
-        mFlags(flags & ~SYSTEM_FLAGS_MASK),
+        mStepServerFailed(false),
         mSessionId(sessionId)
         // mChannelCount
         // mChannelMask
@@ -3413,7 +3424,7 @@
     result = cblk->stepServer(mFrameCount);
     if (!result) {
         ALOGV("stepServer failed acquiring cblk mutex");
-        mFlags |= STEPSERVER_FAILED;
+        mStepServerFailed = true;
     }
     return result;
 }
@@ -3425,7 +3436,7 @@
     cblk->server = 0;
     cblk->userBase = 0;
     cblk->serverBase = 0;
-    mFlags &= (uint32_t)(~SYSTEM_FLAGS_MASK);
+    mStepServerFailed = false;
     ALOGV("TrackBase::reset");
 }
 
@@ -3465,7 +3476,7 @@
             int frameCount,
             const sp<IMemory>& sharedBuffer,
             int sessionId)
-    :   TrackBase(thread, client, sampleRate, format, channelMask, frameCount, 0, sharedBuffer, sessionId),
+    :   TrackBase(thread, client, sampleRate, format, channelMask, frameCount, sharedBuffer, sessionId),
     mMute(false), mSharedBuffer(sharedBuffer), mName(-1), mMainBuffer(NULL), mAuxBuffer(NULL),
     mAuxEffectId(0), mHasVolumeController(false)
 {
@@ -3556,10 +3567,10 @@
      uint32_t framesReq = buffer->frameCount;
 
      // Check if last stepServer failed, try to step now
-     if (mFlags & TrackBase::STEPSERVER_FAILED) {
+     if (mStepServerFailed) {
          if (!step())  goto getNextBuffer_exit;
          ALOGV("stepServer recovered");
-         mFlags &= ~TrackBase::STEPSERVER_FAILED;
+         mStepServerFailed = false;
      }
 
      framesReady = cblk->framesReady();
@@ -4155,10 +4166,9 @@
             audio_format_t format,
             uint32_t channelMask,
             int frameCount,
-            uint32_t flags,
             int sessionId)
     :   TrackBase(thread, client, sampleRate, format,
-                  channelMask, frameCount, flags, 0, sessionId),
+                  channelMask, frameCount, 0 /*sharedBuffer*/, sessionId),
         mOverflow(false)
 {
     if (mCblk != NULL) {
@@ -4188,10 +4198,10 @@
     uint32_t framesReq = buffer->frameCount;
 
      // Check if last stepServer failed, try to step now
-    if (mFlags & TrackBase::STEPSERVER_FAILED) {
+    if (mStepServerFailed) {
         if (!step()) goto getNextBuffer_exit;
         ALOGV("stepServer recovered");
-        mFlags &= ~TrackBase::STEPSERVER_FAILED;
+        mStepServerFailed = false;
     }
 
     framesAvail = cblk->framesAvailable_l();
@@ -4654,6 +4664,7 @@
         audio_format_t format,
         uint32_t channelMask,
         int frameCount,
+        // FIXME dead, remove from IAudioFlinger
         uint32_t flags,
         int *sessionId,
         status_t *status)
@@ -4698,7 +4709,6 @@
                                                 format,
                                                 channelMask,
                                                 frameCount,
-                                                flags,
                                                 lSessionId,
                                                 &lStatus);
     }
@@ -4992,7 +5002,6 @@
         audio_format_t format,
         int channelMask,
         int frameCount,
-        uint32_t flags,
         int sessionId,
         status_t *status)
 {
@@ -5009,7 +5018,7 @@
         Mutex::Autolock _l(mLock);
 
         track = new RecordTrack(this, client, sampleRate,
-                      format, channelMask, frameCount, flags, sessionId);
+                      format, channelMask, frameCount, sessionId);
 
         if (track->getCblk() == 0) {
             lStatus = NO_MEMORY;
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 1a52de5..a2ab680 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -312,19 +312,12 @@
                 PAUSED
             };
 
-            enum track_flags {
-                STEPSERVER_FAILED = 0x01, //  StepServer could not acquire cblk->lock mutex
-                SYSTEM_FLAGS_MASK = 0x0000ffffUL,
-                // The upper 16 bits are used for track-specific flags.
-            };
-
                                 TrackBase(ThreadBase *thread,
                                         const sp<Client>& client,
                                         uint32_t sampleRate,
                                         audio_format_t format,
                                         uint32_t channelMask,
                                         int frameCount,
-                                        uint32_t flags,
                                         const sp<IMemory>& sharedBuffer,
                                         int sessionId);
             virtual             ~TrackBase();
@@ -384,7 +377,7 @@
             // we don't really need a lock for these
             track_state         mState;
             const audio_format_t mFormat;
-            uint32_t            mFlags;
+            bool                mStepServerFailed;
             const int           mSessionId;
             uint8_t             mChannelCount;
             uint32_t            mChannelMask;
@@ -1048,7 +1041,6 @@
                                         audio_format_t format,
                                         uint32_t channelMask,
                                         int frameCount,
-                                        uint32_t flags,
                                         int sessionId);
             virtual             ~RecordTrack();
 
@@ -1094,7 +1086,6 @@
                         audio_format_t format,
                         int channelMask,
                         int frameCount,
-                        uint32_t flags,
                         int sessionId,
                         status_t *status);
 
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index b3eceb1..624ee98 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -146,19 +146,18 @@
         final int id;
         final int uid;
         final int initialPid;
-        final int priority;
         final Notification notification;
+        final int score;
         IBinder statusBarKey;
 
-        NotificationRecord(String pkg, String tag, int id, int uid, int initialPid, int priority,
-                Notification notification)
+        NotificationRecord(String pkg, String tag, int id, int uid, int initialPid, int score, Notification notification)
         {
             this.pkg = pkg;
             this.tag = tag;
             this.id = id;
             this.uid = uid;
             this.initialPid = initialPid;
-            this.priority = priority;
+            this.score = score;
             this.notification = notification;
         }
 
@@ -166,6 +165,8 @@
             pw.println(prefix + this);
             pw.println(prefix + "  icon=0x" + Integer.toHexString(notification.icon)
                     + " / " + idDebugString(baseContext, this.pkg, notification.icon));
+            pw.println(prefix + "  pri=" + notification.priority);
+            pw.println(prefix + "  score=" + this.score);
             pw.println(prefix + "  contentIntent=" + notification.contentIntent);
             pw.println(prefix + "  deleteIntent=" + notification.deleteIntent);
             pw.println(prefix + "  tickerText=" + notification.tickerText);
@@ -187,7 +188,7 @@
                 + " pkg=" + pkg
                 + " id=" + Integer.toHexString(id)
                 + " tag=" + tag 
-                + " pri=" + priority 
+                + " score=" + score
                 + "}";
         }
     }
@@ -660,28 +661,17 @@
         enqueueNotificationInternal(pkg, Binder.getCallingUid(), Binder.getCallingPid(),
                 tag, id, notification, idOut);
     }
-
-    public void enqueueNotificationWithTagPriority(String pkg, String tag, int id, int priority,
-            Notification notification, int[] idOut)
-    {
-        enqueueNotificationInternal(pkg, Binder.getCallingUid(), Binder.getCallingPid(),
-                tag, id, priority, notification, idOut);
+    
+    private final static int clamp(int x, int low, int high) {
+        return (x < low) ? low : ((x > high) ? high : x);
     }
 
+    
     // Not exposed via Binder; for system use only (otherwise malicious apps could spoof the
     // uid/pid of another application)
     public void enqueueNotificationInternal(String pkg, int callingUid, int callingPid,
             String tag, int id, Notification notification, int[] idOut)
     {
-        enqueueNotificationInternal(pkg, callingUid, callingPid, tag, id, 
-                ((notification.flags & Notification.FLAG_ONGOING_EVENT) != 0)
-                    ? StatusBarNotification.PRIORITY_ONGOING
-                    : StatusBarNotification.PRIORITY_NORMAL,
-                notification, idOut);
-    }
-    public void enqueueNotificationInternal(String pkg, int callingUid, int callingPid,
-            String tag, int id, int priority, Notification notification, int[] idOut)
-    {
         checkIncomingCall(pkg);
 
         // Limit the number of notifications that any given package except the android
@@ -723,10 +713,35 @@
             }
         }
 
+        // === Scoring ===
+        
+        // 0. Sanitize inputs
+        notification.priority = clamp(notification.priority, Notification.PRIORITY_MIN, Notification.PRIORITY_MAX);
+        // Migrate notification flags to scores
+        if (0 != (notification.flags & Notification.FLAG_HIGH_PRIORITY)) {
+            if (notification.priority < Notification.PRIORITY_MAX) notification.priority = Notification.PRIORITY_MAX;
+        } else if (0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
+            if (notification.priority < Notification.PRIORITY_HIGH) notification.priority = Notification.PRIORITY_HIGH;
+        }
+        
+        // 1. initial score: buckets of 10, around the app 
+        int score = notification.priority * 10; //[-20..20]
+
+        // 2. Consult oracles (external heuristics)
+        // TODO(dsandler): oracles
+
+        // 3. Apply local heuristics & overrides
+
+        // blocked apps
+        // TODO(dsandler): add block db
+        if (pkg.startsWith("com.test.spammer.")) {
+            score = -1000;
+        }
+
         synchronized (mNotificationList) {
             NotificationRecord r = new NotificationRecord(pkg, tag, id, 
                     callingUid, callingPid, 
-                    priority,
+                    score,
                     notification);
             NotificationRecord old = null;
 
@@ -752,9 +767,7 @@
 
             if (notification.icon != 0) {
                 StatusBarNotification n = new StatusBarNotification(pkg, id, tag,
-                        r.uid, r.initialPid, notification);
-                n.priority = r.priority;
-
+                        r.uid, r.initialPid, score, notification);
                 if (old != null && old.statusBarKey != null) {
                     r.statusBarKey = old.statusBarKey;
                     long identity = Binder.clearCallingIdentity();
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index 32a6975..9d88a18 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -64,44 +64,47 @@
 
     /**
      * Available radio technologies for GSM, UMTS and CDMA.
+     * Duplicates the constants from hardware/radio/include/ril.h
+     * This should only be used by agents working with the ril.  Others
+     * should use the equivalent TelephonyManager.NETWORK_TYPE_*
      */
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_UNKNOWN = 0;
+    public static final int RIL_RADIO_TECHNOLOGY_UNKNOWN = 0;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_GPRS = 1;
+    public static final int RIL_RADIO_TECHNOLOGY_GPRS = 1;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_EDGE = 2;
+    public static final int RIL_RADIO_TECHNOLOGY_EDGE = 2;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_UMTS = 3;
+    public static final int RIL_RADIO_TECHNOLOGY_UMTS = 3;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_IS95A = 4;
+    public static final int RIL_RADIO_TECHNOLOGY_IS95A = 4;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_IS95B = 5;
+    public static final int RIL_RADIO_TECHNOLOGY_IS95B = 5;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_1xRTT = 6;
+    public static final int RIL_RADIO_TECHNOLOGY_1xRTT = 6;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_EVDO_0 = 7;
+    public static final int RIL_RADIO_TECHNOLOGY_EVDO_0 = 7;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_EVDO_A = 8;
+    public static final int RIL_RADIO_TECHNOLOGY_EVDO_A = 8;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_HSDPA = 9;
+    public static final int RIL_RADIO_TECHNOLOGY_HSDPA = 9;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_HSUPA = 10;
+    public static final int RIL_RADIO_TECHNOLOGY_HSUPA = 10;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_HSPA = 11;
+    public static final int RIL_RADIO_TECHNOLOGY_HSPA = 11;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_EVDO_B = 12;
+    public static final int RIL_RADIO_TECHNOLOGY_EVDO_B = 12;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_EHRPD = 13;
+    public static final int RIL_RADIO_TECHNOLOGY_EHRPD = 13;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_LTE = 14;
+    public static final int RIL_RADIO_TECHNOLOGY_LTE = 14;
     /** @hide */
-    public static final int RADIO_TECHNOLOGY_HSPAP = 15;
+    public static final int RIL_RADIO_TECHNOLOGY_HSPAP = 15;
     /**
      * GSM radio technology only supports voice. It does not support data.
      * @hide
      */
-    public static final int RADIO_TECHNOLOGY_GSM = 16;
+    public static final int RIL_RADIO_TECHNOLOGY_GSM = 16;
 
     /**
      * Available registration states for GSM, UMTS and CDMA.
@@ -400,59 +403,59 @@
      *
      * @hide
      */
-    public static String radioTechnologyToString(int rt) {
+    public static String rilRadioTechnologyToString(int rt) {
         String rtString;
 
         switch(rt) {
-            case 0:
+            case RIL_RADIO_TECHNOLOGY_UNKNOWN:
                 rtString = "Unknown";
                 break;
-            case 1:
+            case RIL_RADIO_TECHNOLOGY_GPRS:
                 rtString = "GPRS";
                 break;
-            case 2:
+            case RIL_RADIO_TECHNOLOGY_EDGE:
                 rtString = "EDGE";
                 break;
-            case 3:
+            case RIL_RADIO_TECHNOLOGY_UMTS:
                 rtString = "UMTS";
                 break;
-            case 4:
+            case RIL_RADIO_TECHNOLOGY_IS95A:
                 rtString = "CDMA-IS95A";
                 break;
-            case 5:
+            case RIL_RADIO_TECHNOLOGY_IS95B:
                 rtString = "CDMA-IS95B";
                 break;
-            case 6:
+            case RIL_RADIO_TECHNOLOGY_1xRTT:
                 rtString = "1xRTT";
                 break;
-            case 7:
+            case RIL_RADIO_TECHNOLOGY_EVDO_0:
                 rtString = "EvDo-rev.0";
                 break;
-            case 8:
+            case RIL_RADIO_TECHNOLOGY_EVDO_A:
                 rtString = "EvDo-rev.A";
                 break;
-            case 9:
+            case RIL_RADIO_TECHNOLOGY_HSDPA:
                 rtString = "HSDPA";
                 break;
-            case 10:
+            case RIL_RADIO_TECHNOLOGY_HSUPA:
                 rtString = "HSUPA";
                 break;
-            case 11:
+            case RIL_RADIO_TECHNOLOGY_HSPA:
                 rtString = "HSPA";
                 break;
-            case 12:
+            case RIL_RADIO_TECHNOLOGY_EVDO_B:
                 rtString = "EvDo-rev.B";
                 break;
-            case 13:
+            case RIL_RADIO_TECHNOLOGY_EHRPD:
                 rtString = "eHRPD";
                 break;
-            case 14:
+            case RIL_RADIO_TECHNOLOGY_LTE:
                 rtString = "LTE";
                 break;
-            case 15:
+            case RIL_RADIO_TECHNOLOGY_HSPAP:
                 rtString = "HSPAP";
                 break;
-            case 16:
+            case RIL_RADIO_TECHNOLOGY_GSM:
                 rtString = "GSM";
                 break;
             default:
@@ -460,12 +463,12 @@
                 Log.w(LOG_TAG, "Unexpected radioTechnology=" + rt);
                 break;
         }
-        return rtString + ":" + rt;
+        return rtString;
     }
 
     @Override
     public String toString() {
-        String radioTechnology = radioTechnologyToString(mRadioTechnology);
+        String radioTechnology = rilRadioTechnologyToString(mRadioTechnology);
 
         return (mState + " " + (mRoaming ? "roaming" : "home")
                 + " " + mOperatorAlphaLong
@@ -644,11 +647,48 @@
     }
 
     /** @hide */
-    public int getRadioTechnology() {
+    public int getRilRadioTechnology() {
         return this.mRadioTechnology;
     }
 
     /** @hide */
+    public int getNetworkType() {
+        switch(mRadioTechnology) {
+        case ServiceState.RIL_RADIO_TECHNOLOGY_GPRS:
+            return TelephonyManager.NETWORK_TYPE_GPRS;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_EDGE:
+            return TelephonyManager.NETWORK_TYPE_EDGE;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_UMTS:
+            return TelephonyManager.NETWORK_TYPE_UMTS;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_HSDPA:
+            return TelephonyManager.NETWORK_TYPE_HSDPA;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_HSUPA:
+            return TelephonyManager.NETWORK_TYPE_HSUPA;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_HSPA:
+            return TelephonyManager.NETWORK_TYPE_HSPA;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_IS95A:
+        case ServiceState.RIL_RADIO_TECHNOLOGY_IS95B:
+            return TelephonyManager.NETWORK_TYPE_CDMA;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT:
+            return TelephonyManager.NETWORK_TYPE_1xRTT;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0:
+            return TelephonyManager.NETWORK_TYPE_EVDO_0;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A:
+            return TelephonyManager.NETWORK_TYPE_EVDO_A;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_B:
+            return TelephonyManager.NETWORK_TYPE_EVDO_B;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD:
+            return TelephonyManager.NETWORK_TYPE_EHRPD;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_LTE:
+            return TelephonyManager.NETWORK_TYPE_LTE;
+        case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
+            return TelephonyManager.NETWORK_TYPE_HSPAP;
+        default:
+            return TelephonyManager.NETWORK_TYPE_UNKNOWN;
+        }
+    }
+
+    /** @hide */
     public int getCssIndicator() {
         return this.mCssIndicator ? 1 : 0;
     }
@@ -665,25 +705,25 @@
 
     /** @hide */
     public static boolean isGsm(int radioTechnology) {
-        return radioTechnology == RADIO_TECHNOLOGY_GPRS
-                || radioTechnology == RADIO_TECHNOLOGY_EDGE
-                || radioTechnology == RADIO_TECHNOLOGY_UMTS
-                || radioTechnology == RADIO_TECHNOLOGY_HSDPA
-                || radioTechnology == RADIO_TECHNOLOGY_HSUPA
-                || radioTechnology == RADIO_TECHNOLOGY_HSPA
-                || radioTechnology == RADIO_TECHNOLOGY_LTE
-                || radioTechnology == RADIO_TECHNOLOGY_HSPAP
-                || radioTechnology == RADIO_TECHNOLOGY_GSM;
+        return radioTechnology == RIL_RADIO_TECHNOLOGY_GPRS
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_EDGE
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_UMTS
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSDPA
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSUPA
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSPA
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_LTE
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSPAP
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_GSM;
     }
 
     /** @hide */
     public static boolean isCdma(int radioTechnology) {
-        return radioTechnology == RADIO_TECHNOLOGY_IS95A
-                || radioTechnology == RADIO_TECHNOLOGY_IS95B
-                || radioTechnology == RADIO_TECHNOLOGY_1xRTT
-                || radioTechnology == RADIO_TECHNOLOGY_EVDO_0
-                || radioTechnology == RADIO_TECHNOLOGY_EVDO_A
-                || radioTechnology == RADIO_TECHNOLOGY_EVDO_B
-                || radioTechnology == RADIO_TECHNOLOGY_EHRPD;
+        return radioTechnology == RIL_RADIO_TECHNOLOGY_IS95A
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_IS95B
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_1xRTT
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_0
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_A
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_B
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_EHRPD;
     }
 }
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java
index d0e304f..238afbe 100644
--- a/telephony/java/com/android/internal/telephony/DataConnection.java
+++ b/telephony/java/com/android/internal/telephony/DataConnection.java
@@ -355,14 +355,14 @@
         if (DBG) log("NotifyDisconnectCompleted DisconnectParams=" + dp);
     }
 
-    protected int getRadioTechnology(int defaultRadioTechnology) {
-        int radioTechnology;
+    protected int getRilRadioTechnology(int defaultRilRadioTechnology) {
+        int rilRadioTechnology;
         if (mRilVersion < 6) {
-            radioTechnology = defaultRadioTechnology;
+            rilRadioTechnology = defaultRilRadioTechnology;
         } else {
-            radioTechnology = phone.getServiceState().getRadioTechnology() + 2;
+            rilRadioTechnology = phone.getServiceState().getRilRadioTechnology() + 2;
         }
-        return radioTechnology;
+        return rilRadioTechnology;
     }
 
     /*
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index 2b9fb91..fa90f1c 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -40,6 +40,7 @@
 import android.provider.Settings;
 import android.provider.Settings.SettingNotFoundException;
 import android.telephony.ServiceState;
+import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.Log;
 
@@ -1167,15 +1168,14 @@
     }
 
     protected String getReryConfig(boolean forDefault) {
-        int rt = mPhone.getServiceState().getRadioTechnology();
+        int nt = mPhone.getServiceState().getNetworkType();
 
-        if ((rt == ServiceState.RADIO_TECHNOLOGY_IS95A) ||
-            (rt == ServiceState.RADIO_TECHNOLOGY_IS95B) ||
-            (rt == ServiceState.RADIO_TECHNOLOGY_1xRTT) ||
-            (rt == ServiceState.RADIO_TECHNOLOGY_EVDO_0) ||
-            (rt == ServiceState.RADIO_TECHNOLOGY_EVDO_A) ||
-            (rt == ServiceState.RADIO_TECHNOLOGY_EVDO_B) ||
-            (rt == ServiceState.RADIO_TECHNOLOGY_EHRPD)) {
+        if ((nt == TelephonyManager.NETWORK_TYPE_CDMA) ||
+            (nt == TelephonyManager.NETWORK_TYPE_1xRTT) ||
+            (nt == TelephonyManager.NETWORK_TYPE_EVDO_0) ||
+            (nt == TelephonyManager.NETWORK_TYPE_EVDO_A) ||
+            (nt == TelephonyManager.NETWORK_TYPE_EVDO_B) ||
+            (nt == TelephonyManager.NETWORK_TYPE_EHRPD)) {
             // CDMA variant
             return SystemProperties.get("ro.cdma.data_retry_config");
         } else {
diff --git a/telephony/java/com/android/internal/telephony/PhoneProxy.java b/telephony/java/com/android/internal/telephony/PhoneProxy.java
index 2931a02..1a8b3ca 100644
--- a/telephony/java/com/android/internal/telephony/PhoneProxy.java
+++ b/telephony/java/com/android/internal/telephony/PhoneProxy.java
@@ -149,7 +149,7 @@
                     logd("LTE ON CDMA property is set. Switch to CDMALTEPhone" +
                             " newVoiceRadioTech = " + newVoiceRadioTech +
                             " Active Phone = " + mActivePhone.getPhoneName());
-                    newVoiceRadioTech = ServiceState.RADIO_TECHNOLOGY_1xRTT;
+                    newVoiceRadioTech = ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT;
                 }
             } else {
                 if ((ServiceState.isCdma(newVoiceRadioTech) &&
@@ -165,7 +165,7 @@
             }
         }
 
-        if (newVoiceRadioTech == ServiceState.RADIO_TECHNOLOGY_UNKNOWN) {
+        if (newVoiceRadioTech == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) {
             // We need some voice phone object to be active always, so never
             // delete the phone without anything to replace it with!
             logd("Ignoring voice radio technology changed message. newVoiceRadioTech = Unknown."
diff --git a/telephony/java/com/android/internal/telephony/ServiceStateTracker.java b/telephony/java/com/android/internal/telephony/ServiceStateTracker.java
index 9c80de7..fd39e04 100644
--- a/telephony/java/com/android/internal/telephony/ServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -54,10 +54,10 @@
     protected boolean mDesiredPowerState;
 
     /**
-     *  Values correspond to ServiceState.RADIO_TECHNOLOGY_ definitions.
+     *  Values correspond to ServiceState.RIL_RADIO_TECHNOLOGY_ definitions.
      */
-    protected int mRadioTechnology = 0;
-    protected int mNewRadioTechnology = 0;
+    protected int mRilRadioTechnology = 0;
+    protected int mNewRilRadioTechnology = 0;
 
     /**
      * By default, strength polling is enabled.  However, if we're
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java
index a93d94f..64d018e 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java
@@ -86,7 +86,7 @@
         Message msg = obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE, cp);
         msg.obj = cp;
         phone.mCM.setupDataCall(
-                Integer.toString(getRadioTechnology(RILConstants.SETUP_DATA_TECH_CDMA)),
+                Integer.toString(getRilRadioTechnology(RILConstants.SETUP_DATA_TECH_CDMA)),
                 Integer.toString(dataProfile),
                 null, null, null,
                 Integer.toString(RILConstants.SETUP_DATA_AUTH_PAP_CHAP),
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
index 7da23d0..cad2e22 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
@@ -185,19 +185,21 @@
 
     @Override
     protected void pollStateDone() {
-        // determine data NetworkType from both LET and CDMA SS
+        // determine data RadioTechnology from both LET and CDMA SS
         if (mLteSS.getState() == ServiceState.STATE_IN_SERVICE) {
             //in LTE service
-            newNetworkType = mLteSS.getRadioTechnology();
+            mNewRilRadioTechnology = mLteSS.getRilRadioTechnology();
             mNewDataConnectionState = mLteSS.getState();
-            newSS.setRadioTechnology(newNetworkType);
-            log("pollStateDone LTE/eHRPD STATE_IN_SERVICE newNetworkType = " + newNetworkType);
+            newSS.setRadioTechnology(mNewRilRadioTechnology);
+            log("pollStateDone LTE/eHRPD STATE_IN_SERVICE mNewRilRadioTechnology = " +
+                    mNewRilRadioTechnology);
         } else {
             // LTE out of service, get CDMA Service State
-            newNetworkType = newSS.getRadioTechnology();
-            mNewDataConnectionState = radioTechnologyToDataServiceState(newNetworkType);
-            log("pollStateDone CDMA STATE_IN_SERVICE newNetworkType = " + newNetworkType +
-                " mNewDataConnectionState = " + mNewDataConnectionState);
+            mNewRilRadioTechnology = newSS.getRilRadioTechnology();
+            mNewDataConnectionState = radioTechnologyToDataServiceState(mNewRilRadioTechnology);
+            log("pollStateDone CDMA STATE_IN_SERVICE mNewRilRadioTechnology = " +
+                    mNewRilRadioTechnology + " mNewDataConnectionState = " +
+                    mNewDataConnectionState);
         }
 
         // TODO: Add proper support for LTE Only, we should be looking at
@@ -239,7 +241,7 @@
         boolean hasCdmaDataConnectionChanged =
             mDataConnectionState != mNewDataConnectionState;
 
-        boolean hasNetworkTypeChanged = networkType != newNetworkType;
+        boolean hasRadioTechnologyChanged = mRilRadioTechnology != mNewRilRadioTechnology;
 
         boolean hasChanged = !newSS.equals(ss);
 
@@ -251,20 +253,20 @@
 
         boolean has4gHandoff =
                 mNewDataConnectionState == ServiceState.STATE_IN_SERVICE &&
-                (((networkType == ServiceState.RADIO_TECHNOLOGY_LTE) &&
-                  (newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) ||
-                 ((networkType == ServiceState.RADIO_TECHNOLOGY_EHRPD) &&
-                  (newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE)));
+                (((mRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_LTE) &&
+                  (mNewRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD)) ||
+                 ((mRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD) &&
+                  (mNewRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_LTE)));
 
         boolean hasMultiApnSupport =
-                (((newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE) ||
-                  (newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) &&
-                 ((networkType != ServiceState.RADIO_TECHNOLOGY_LTE) &&
-                  (networkType != ServiceState.RADIO_TECHNOLOGY_EHRPD)));
+                (((mNewRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_LTE) ||
+                  (mNewRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD)) &&
+                 ((mRilRadioTechnology != ServiceState.RIL_RADIO_TECHNOLOGY_LTE) &&
+                  (mRilRadioTechnology != ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD)));
 
         boolean hasLostMultiApnSupport =
-            ((newNetworkType >= ServiceState.RADIO_TECHNOLOGY_IS95A) &&
-             (newNetworkType <= ServiceState.RADIO_TECHNOLOGY_EVDO_A));
+            ((mNewRilRadioTechnology >= ServiceState.RIL_RADIO_TECHNOLOGY_IS95A) &&
+             (mNewRilRadioTechnology <= ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A));
 
         if (DBG) {
             log("pollStateDone:"
@@ -273,7 +275,7 @@
                 + " hasCdmaDataConnectionAttached=" + hasCdmaDataConnectionAttached
                 + " hasCdmaDataConnectionDetached=" + hasCdmaDataConnectionDetached
                 + " hasCdmaDataConnectionChanged=" + hasCdmaDataConnectionChanged
-                + " hasNetworkTypeChanged = " + hasNetworkTypeChanged
+                + " hasRadioTechnologyChanged = " + hasRadioTechnologyChanged
                 + " hasChanged=" + hasChanged
                 + " hasRoamingOn=" + hasRoamingOn
                 + " hasRoamingOff=" + hasRoamingOff
@@ -316,13 +318,14 @@
         newCellLoc = tcl;
 
         mDataConnectionState = mNewDataConnectionState;
-        networkType = newNetworkType;
+        mRilRadioTechnology = mNewRilRadioTechnology;
+        mNewRilRadioTechnology = 0;
 
         newSS.setStateOutOfService(); // clean slate for next time
 
-        if (hasNetworkTypeChanged) {
+        if (hasRadioTechnologyChanged) {
             phone.setSystemProperty(TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE,
-                    ServiceState.radioTechnologyToString(networkType));
+                    ServiceState.rilRadioTechnologyToString(mRilRadioTechnology));
         }
 
         if (hasRegistered) {
@@ -404,7 +407,7 @@
             mDetachedRegistrants.notifyRegistrants();
         }
 
-        if ((hasCdmaDataConnectionChanged || hasNetworkTypeChanged)) {
+        if ((hasCdmaDataConnectionChanged || hasRadioTechnologyChanged)) {
             phone.notifyDataConnection(null);
         }
 
@@ -446,7 +449,7 @@
             int evdoSnr = ((ints[offset + 4] > 0) && (ints[offset + 4] <= 8)) ? ints[offset + 4]
                     : -1;
 
-            if (networkType == ServiceState.RADIO_TECHNOLOGY_LTE) {
+            if (mRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_LTE) {
                 lteRssi = ints[offset+5];
                 lteRsrp = ints[offset+6];
                 lteRsrq = ints[offset+7];
@@ -454,7 +457,7 @@
                 lteCqi = ints[offset+9];
             }
 
-            if (networkType != ServiceState.RADIO_TECHNOLOGY_LTE) {
+            if (mRilRadioTechnology != ServiceState.RIL_RADIO_TECHNOLOGY_LTE) {
                 mSignalStrength = new SignalStrength(99, -1, cdmaDbm, cdmaEcio, evdoRssi, evdoEcio,
                         evdoSnr, false);
             } else {
@@ -476,7 +479,7 @@
         // Note: it needs to be confirmed which CDMA network types
         // can support voice and data calls concurrently.
         // For the time-being, the return value will be false.
-        return (networkType == ServiceState.RADIO_TECHNOLOGY_LTE);
+        return (mRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_LTE);
     }
 
     /**
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index 5115d76..75f5d47 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -86,12 +86,6 @@
     private int mNitzUpdateDiff = SystemProperties.getInt("ro.nitz_update_diff",
             NITZ_UPDATE_DIFF_DEFAULT);
 
-    /**
-     *  Values correspond to ServiceState.RADIO_TECHNOLOGY_ definitions.
-     */
-    protected int networkType = 0;
-    protected int newNetworkType = 0;
-
     private boolean mCdmaRoaming = false;
     private int mRoamingIndicator;
     private boolean mIsInPrl;
@@ -556,10 +550,10 @@
     /**
     * Determine data network type based on radio technology.
     */
-    protected void setCdmaTechnology(int radioTechnology){
-        mNewDataConnectionState = radioTechnologyToDataServiceState(radioTechnology);
-        newSS.setRadioTechnology(radioTechnology);
-        newNetworkType = radioTechnology;
+    protected void setCdmaTechnology(int radioTech){
+        mNewDataConnectionState = radioTechnologyToDataServiceState(radioTech);
+        newSS.setRadioTechnology(radioTech);
+        mNewRilRadioTechnology = radioTech;
     }
 
     /**
@@ -925,7 +919,7 @@
         boolean hasCdmaDataConnectionChanged =
                        mDataConnectionState != mNewDataConnectionState;
 
-        boolean hasNetworkTypeChanged = networkType != newNetworkType;
+        boolean hasRadioTechnologyChanged = mRilRadioTechnology != mNewRilRadioTechnology;
 
         boolean hasChanged = !newSS.equals(ss);
 
@@ -955,15 +949,15 @@
         newCellLoc = tcl;
 
         mDataConnectionState = mNewDataConnectionState;
-        networkType = newNetworkType;
+        mRilRadioTechnology = mNewRilRadioTechnology;
         // this new state has been applied - forget it until we get a new new state
-        newNetworkType = 0;
+        mNewRilRadioTechnology = 0;
 
         newSS.setStateOutOfService(); // clean slate for next time
 
-        if (hasNetworkTypeChanged) {
+        if (hasRadioTechnologyChanged) {
             phone.setSystemProperty(TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE,
-                    ServiceState.radioTechnologyToString(networkType));
+                    ServiceState.rilRadioTechnologyToString(mRilRadioTechnology));
         }
 
         if (hasRegistered) {
@@ -1030,7 +1024,7 @@
             mDetachedRegistrants.notifyRegistrants();
         }
 
-        if (hasCdmaDataConnectionChanged || hasNetworkTypeChanged) {
+        if (hasCdmaDataConnectionChanged || hasRadioTechnologyChanged) {
             phone.notifyDataConnection(null);
         }
 
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
index 1f28280..4956ef4 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
@@ -100,7 +100,7 @@
         }
 
         phone.mCM.setupDataCall(
-                Integer.toString(getRadioTechnology(RILConstants.SETUP_DATA_TECH_GSM)),
+                Integer.toString(getRilRadioTechnology(RILConstants.SETUP_DATA_TECH_GSM)),
                 Integer.toString(mProfileId),
                 mApn.apn, mApn.user, mApn.password,
                 Integer.toString(authType),
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 66e9487..d1873eb 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -2318,7 +2318,7 @@
         }
 
         String operator = mPhone.mIccRecords.getOperatorNumeric();
-        int radioTech = mPhone.getServiceState().getRadioTechnology();
+        int networkType = mPhone.getServiceState().getNetworkType();
 
         if (requestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
             if (canSetPreferApn && mPreferredApn != null) {
@@ -2327,7 +2327,7 @@
                         + mPreferredApn.numeric + ":" + mPreferredApn);
                 }
                 if (mPreferredApn.numeric.equals(operator)) {
-                    if (mPreferredApn.bearer == 0 || mPreferredApn.bearer == radioTech) {
+                    if (mPreferredApn.bearer == 0 || mPreferredApn.bearer == networkType) {
                         apnList.add(mPreferredApn);
                         if (DBG) log("buildWaitingApns: X added preferred apnList=" + apnList);
                         return apnList;
@@ -2346,7 +2346,7 @@
         if (mAllApns != null) {
             for (ApnSetting apn : mAllApns) {
                 if (apn.canHandleType(requestedApnType)) {
-                    if (apn.bearer == 0 || apn.bearer == radioTech) {
+                    if (apn.bearer == 0 || apn.bearer == networkType) {
                         if (DBG) log("apn info : " +apn.toString());
                         apnList.add(apn);
                     }
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index 0ebeabe..a4fb1d8 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -629,7 +629,7 @@
                     }
                     newGPRSState = regCodeToServiceState(regState);
                     mDataRoaming = regCodeIsRoaming(regState);
-                    mNewRadioTechnology = type;
+                    mNewRilRadioTechnology = type;
                     newSS.setRadioTechnology(type);
                 break;
 
@@ -746,8 +746,8 @@
                 " mNewMaxDataCalls=" + mNewMaxDataCalls +
                 " oldReasonDataDenied=" + mReasonDataDenied +
                 " mNewReasonDataDenied=" + mNewReasonDataDenied +
-                " oldType=" + ServiceState.radioTechnologyToString(mRadioTechnology) +
-                " newType=" + ServiceState.radioTechnologyToString(mNewRadioTechnology));
+                " oldType=" + ServiceState.rilRadioTechnologyToString(mRilRadioTechnology) +
+                " newType=" + ServiceState.rilRadioTechnologyToString(mNewRilRadioTechnology));
         }
 
         boolean hasRegistered =
@@ -766,7 +766,7 @@
                 gprsState == ServiceState.STATE_IN_SERVICE
                 && newGPRSState != ServiceState.STATE_IN_SERVICE;
 
-        boolean hasRadioTechnologyChanged = mRadioTechnology != mNewRadioTechnology;
+        boolean hasRadioTechnologyChanged = mRilRadioTechnology != mNewRilRadioTechnology;
 
         boolean hasChanged = !newSS.equals(ss);
 
@@ -800,11 +800,11 @@
             int cid = -1;
             GsmCellLocation loc = ((GsmCellLocation)phone.getCellLocation());
             if (loc != null) cid = loc.getCid();
-            EventLog.writeEvent(EventLogTags.GSM_RAT_SWITCHED, cid, mRadioTechnology,
-                    mNewRadioTechnology);
+            EventLog.writeEvent(EventLogTags.GSM_RAT_SWITCHED, cid, mRilRadioTechnology,
+                    mNewRilRadioTechnology);
             if (DBG) {
-                log("RAT switched " + ServiceState.radioTechnologyToString(mRadioTechnology) +
-                        " -> " + ServiceState.radioTechnologyToString(mNewRadioTechnology) +
+                log("RAT switched " + ServiceState.rilRadioTechnologyToString(mRilRadioTechnology) +
+                        " -> " + ServiceState.rilRadioTechnologyToString(mNewRilRadioTechnology) +
                         " at cell " + cid);
             }
         }
@@ -812,16 +812,16 @@
         gprsState = newGPRSState;
         mReasonDataDenied = mNewReasonDataDenied;
         mMaxDataCalls = mNewMaxDataCalls;
-        mRadioTechnology = mNewRadioTechnology;
+        mRilRadioTechnology = mNewRilRadioTechnology;
         // this new state has been applied - forget it until we get a new new state
-        mNewRadioTechnology = 0;
+        mNewRilRadioTechnology = 0;
 
 
         newSS.setStateOutOfService(); // clean slate for next time
 
         if (hasRadioTechnologyChanged) {
             phone.setSystemProperty(TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE,
-                    ServiceState.radioTechnologyToString(mRadioTechnology));
+                    ServiceState.rilRadioTechnologyToString(mRilRadioTechnology));
         }
 
         if (hasRegistered) {
@@ -1246,7 +1246,7 @@
      * that could support voice and data simultaneously.
      */
     public boolean isConcurrentVoiceAndDataAllowed() {
-        return (mRadioTechnology >= ServiceState.RADIO_TECHNOLOGY_UMTS);
+        return (mRilRadioTechnology >= ServiceState.RIL_RADIO_TECHNOLOGY_UMTS);
     }
 
     /**
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
index f463a19..ae01c75 100644
--- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
+++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
@@ -765,22 +765,70 @@
             }
         },
 
-        new Test("System priority notification") {
+        new Test("PRIORITY_HIGH") {
             public void run() {
                 Notification n = new Notification.Builder(NotificationTestList.this)
-                    .setSmallIcon(R.drawable.notification1)
-                    .setContentTitle("System priority")
+                    .setSmallIcon(R.drawable.notification5)
+                    .setContentTitle("High priority")
                     .setContentText("This should appear before all others")
+                    .setPriority(Notification.PRIORITY_HIGH)
                     .getNotification();
 
                 int[] idOut = new int[1];
                 try {
                     INotificationManager directLine = mNM.getService();
-                    directLine.enqueueNotificationWithTagPriority(
+                    directLine.enqueueNotificationWithTag(
+                            getPackageName(),
+                            null, 
+                            100, 
+                            n,
+                            idOut);
+                } catch (android.os.RemoteException ex) {
+                    // oh well
+                }
+            }
+        },
+
+        new Test("PRIORITY_MAX") {
+            public void run() {
+                Notification n = new Notification.Builder(NotificationTestList.this)
+                    .setSmallIcon(R.drawable.notification9)
+                    .setContentTitle("MAX priority")
+                    .setContentText("This might appear as an intruder alert")
+                    .setPriority(Notification.PRIORITY_MAX)
+                    .getNotification();
+
+                int[] idOut = new int[1];
+                try {
+                    INotificationManager directLine = mNM.getService();
+                    directLine.enqueueNotificationWithTag(
+                            getPackageName(),
+                            null, 
+                            200, 
+                            n,
+                            idOut);
+                } catch (android.os.RemoteException ex) {
+                    // oh well
+                }
+            }
+        },
+
+        new Test("PRIORITY_MIN") {
+            public void run() {
+                Notification n = new Notification.Builder(NotificationTestList.this)
+                    .setSmallIcon(R.drawable.notification0)
+                    .setContentTitle("MIN priority")
+                    .setContentText("You should not see this")
+                    .setPriority(Notification.PRIORITY_MIN)
+                    .getNotification();
+
+                int[] idOut = new int[1];
+                try {
+                    INotificationManager directLine = mNM.getService();
+                    directLine.enqueueNotificationWithTag(
                             getPackageName(),
                             null, 
                             1, 
-                            StatusBarNotification.PRIORITY_SYSTEM,
                             n,
                             idOut);
                 } catch (android.os.RemoteException ex) {
