diff --git a/api/current.txt b/api/current.txt
index 9b86fea..fc0ba7f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -36815,6 +36815,8 @@
     method public boolean onRequestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
     method public boolean onStartNestedScroll(android.view.View, android.view.View, int);
     method public void onStopNestedScroll(android.view.View);
+    method public void onViewAdded(android.view.View);
+    method public void onViewRemoved(android.view.View);
     method public void recomputeViewAttributes(android.view.View);
     method public void removeAllViews();
     method public void removeAllViewsInLayout();
diff --git a/api/system-current.txt b/api/system-current.txt
index fc0352d..b29fb4b 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -39095,6 +39095,8 @@
     method public boolean onRequestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
     method public boolean onStartNestedScroll(android.view.View, android.view.View, int);
     method public void onStopNestedScroll(android.view.View);
+    method public void onViewAdded(android.view.View);
+    method public void onViewRemoved(android.view.View);
     method public void recomputeViewAttributes(android.view.View);
     method public void removeAllViews();
     method public void removeAllViewsInLayout();
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 33a47b24..5a0d246 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -1371,6 +1371,9 @@
         when = parcel.readLong();
         if (parcel.readInt() != 0) {
             mSmallIcon = Icon.CREATOR.createFromParcel(parcel);
+            if (mSmallIcon.getType() == Icon.TYPE_RESOURCE) {
+                icon = mSmallIcon.getResId();
+            }
         }
         number = parcel.readInt();
         if (parcel.readInt() != 0) {
@@ -1588,13 +1591,17 @@
     }
 
     /**
-     * Flatten this notification from a parcel.
+     * Flatten this notification into a parcel.
      */
     public void writeToParcel(Parcel parcel, int flags)
     {
         parcel.writeInt(1);
 
         parcel.writeLong(when);
+        if (mSmallIcon == null && icon != 0) {
+            // you snuck an icon in here without using the builder; let's try to keep it
+            mSmallIcon = Icon.createWithResource("", icon);
+        }
         if (mSmallIcon != null) {
             parcel.writeInt(1);
             mSmallIcon.writeToParcel(parcel, 0);
@@ -2791,7 +2798,10 @@
             return this;
         }
 
-        private void setFlag(int mask, boolean value) {
+        /**
+         * @hide
+         */
+        public void setFlag(int mask, boolean value) {
             if (value) {
                 mFlags |= mask;
             } else {
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index 0904e21..605c006 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -25,6 +25,7 @@
 import android.content.pm.ParceledListSlice;
 import android.graphics.drawable.Icon;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
@@ -216,6 +217,12 @@
             }
         }
         fixLegacySmallIcon(notification, pkg);
+        if (mContext.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
+            if (notification.getSmallIcon() == null) {
+                throw new IllegalArgumentException("Invalid notification (no valid small icon): "
+                    + notification);
+            }
+        }
         if (localLOGV) Log.v(TAG, pkg + ": notify(" + id + ", " + notification + ")");
         Notification stripped = notification.clone();
         Builder.stripForDelivery(stripped);
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index bd50ca0..dd1c5c2 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -2900,7 +2900,7 @@
      *
      * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
      *         Receiver. These are ordered from first to last in priority.  If
-     *         there are no matching receivers, an empty list is returned.
+     *         there are no matching receivers, an empty list or {@code null} is returned.
      *
      * @see #MATCH_DEFAULT_ONLY
      * @see #GET_INTENT_FILTERS
@@ -2936,7 +2936,7 @@
      *         ServiceInfo. These are ordered from best to worst match -- that
      *         is, the first item in the list is what is returned by
      *         resolveService().  If there are no matching services, an empty
-     *         list is returned.
+     *         list or {@code null} is returned.
      *
      * @see #GET_INTENT_FILTERS
      * @see #GET_RESOLVED_FILTER
@@ -2955,7 +2955,7 @@
      *         ServiceInfo. These are ordered from best to worst match -- that
      *         is, the first item in the list is what is returned by
      *         resolveService().  If there are no matching services, an empty
-     *         list is returned.
+     *         list or {@code null} is returned.
      *
      * @see #GET_INTENT_FILTERS
      * @see #GET_RESOLVED_FILTER
@@ -2977,7 +2977,7 @@
      * @param flags Additional option flags.
      * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
      *         ProviderInfo. These are ordered from best to worst match. If
-     *         there are no matching providers, an empty list is returned.
+     *         there are no matching providers, an empty list or {@code null} is returned.
      * @see #GET_INTENT_FILTERS
      * @see #GET_RESOLVED_FILTER
      */
diff --git a/core/java/android/service/voice/VoiceInteractionSession.java b/core/java/android/service/voice/VoiceInteractionSession.java
index 98c684c..39dd29b 100644
--- a/core/java/android/service/voice/VoiceInteractionSession.java
+++ b/core/java/android/service/voice/VoiceInteractionSession.java
@@ -1097,7 +1097,8 @@
                 WindowManager.LayoutParams.TYPE_VOICE_INTERACTION, Gravity.BOTTOM, true);
         mWindow.getWindow().addFlags(
                 WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED |
-                WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
+                WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
+                WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
         initViews();
         mWindow.getWindow().setLayout(MATCH_PARENT, MATCH_PARENT);
         mWindow.setToken(mToken);
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 73cfd8c..2e2ba88 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -4148,24 +4148,38 @@
         mOnHierarchyChangeListener = listener;
     }
 
-    /**
-     * @hide
-     */
-    protected void onViewAdded(View child) {
+    void dispatchViewAdded(View child) {
+        onViewAdded(child);
         if (mOnHierarchyChangeListener != null) {
             mOnHierarchyChangeListener.onChildViewAdded(this, child);
         }
     }
 
     /**
-     * @hide
+     * Called when a new child is added to this ViewGroup. Overrides should always
+     * call super.onViewAdded.
+     *
+     * @param child the added child view
      */
-    protected void onViewRemoved(View child) {
+    public void onViewAdded(View child) {
+    }
+
+    void dispatchViewRemoved(View child) {
+        onViewRemoved(child);
         if (mOnHierarchyChangeListener != null) {
             mOnHierarchyChangeListener.onChildViewRemoved(this, child);
         }
     }
 
+    /**
+     * Called when a child view is removed from this ViewGroup. Overrides should always
+     * call super.onViewRemoved.
+     *
+     * @param child the removed child view
+     */
+    public void onViewRemoved(View child) {
+    }
+
     private void clearCachedLayoutMode() {
         if (!hasBooleanFlag(FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET)) {
            mLayoutMode = LAYOUT_MODE_UNDEFINED;
@@ -4292,7 +4306,7 @@
             child.resetRtlProperties();
         }
 
-        onViewAdded(child);
+        dispatchViewAdded(child);
 
         if ((child.mViewFlags & DUPLICATE_PARENT_STATE) == DUPLICATE_PARENT_STATE) {
             mGroupFlags |= FLAG_NOTIFY_CHILDREN_ON_DRAWABLE_STATE_CHANGE;
@@ -4554,7 +4568,7 @@
             }
         }
 
-        onViewRemoved(view);
+        dispatchViewRemoved(view);
 
         if (view.getVisibility() != View.GONE) {
             notifySubtreeAccessibilityStateChangedIfNeeded();
@@ -4646,7 +4660,7 @@
 
             needGlobalAttributesUpdate(false);
 
-            onViewRemoved(view);
+            dispatchViewRemoved(view);
         }
 
         removeFromArray(start, count);
@@ -4729,7 +4743,7 @@
                 childHasTransientStateChanged(view, false);
             }
 
-            onViewRemoved(view);
+            dispatchViewRemoved(view);
 
             view.mParent = null;
             children[i] = null;
@@ -4788,7 +4802,7 @@
             childHasTransientStateChanged(child, false);
         }
 
-        onViewRemoved(child);
+        dispatchViewRemoved(child);
     }
 
     /**
diff --git a/core/java/android/view/accessibility/AccessibilityInteractionClient.java b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
index db78ec5..b49cbc6 100644
--- a/core/java/android/view/accessibility/AccessibilityInteractionClient.java
+++ b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
@@ -186,7 +186,9 @@
                 if (DEBUG) {
                     Log.i(LOG_TAG, "Window cache miss");
                 }
+                final long identityToken = Binder.clearCallingIdentity();
                 window = connection.getWindow(accessibilityWindowId);
+                Binder.restoreCallingIdentity(identityToken);
                 if (window != null) {
                     sAccessibilityCache.addWindow(window);
                     return window;
@@ -222,7 +224,9 @@
                 if (DEBUG) {
                     Log.i(LOG_TAG, "Windows cache miss");
                 }
+                final long identityToken = Binder.clearCallingIdentity();
                 windows = connection.getWindows();
+                Binder.restoreCallingIdentity(identityToken);
                 if (windows != null) {
                     final int windowCount = windows.size();
                     for (int i = 0; i < windowCount; i++) {
@@ -282,9 +286,11 @@
                     }
                 }
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
+                final long identityToken = Binder.clearCallingIdentity();
                 final boolean success = connection.findAccessibilityNodeInfoByAccessibilityId(
                         accessibilityWindowId, accessibilityNodeId, interactionId, this,
                         prefetchFlags, Thread.currentThread().getId());
+                Binder.restoreCallingIdentity(identityToken);
                 // If the scale is zero the call has failed.
                 if (success) {
                     List<AccessibilityNodeInfo> infos = getFindAccessibilityNodeInfosResultAndClear(
@@ -328,9 +334,11 @@
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
+                final long identityToken = Binder.clearCallingIdentity();
                 final boolean success = connection.findAccessibilityNodeInfosByViewId(
                         accessibilityWindowId, accessibilityNodeId, viewId, interactionId, this,
                         Thread.currentThread().getId());
+                Binder.restoreCallingIdentity(identityToken);
                 if (success) {
                     List<AccessibilityNodeInfo> infos = getFindAccessibilityNodeInfosResultAndClear(
                             interactionId);
@@ -374,9 +382,11 @@
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
+                final long identityToken = Binder.clearCallingIdentity();
                 final boolean success = connection.findAccessibilityNodeInfosByText(
                         accessibilityWindowId, accessibilityNodeId, text, interactionId, this,
                         Thread.currentThread().getId());
+                Binder.restoreCallingIdentity(identityToken);
                 if (success) {
                     List<AccessibilityNodeInfo> infos = getFindAccessibilityNodeInfosResultAndClear(
                             interactionId);
@@ -419,9 +429,11 @@
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
+                final long identityToken = Binder.clearCallingIdentity();
                 final boolean success = connection.findFocus(accessibilityWindowId,
                         accessibilityNodeId, focusType, interactionId, this,
                         Thread.currentThread().getId());
+                Binder.restoreCallingIdentity(identityToken);
                 if (success) {
                     AccessibilityNodeInfo info = getFindAccessibilityNodeInfoResultAndClear(
                             interactionId);
@@ -461,9 +473,11 @@
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
+                final long identityToken = Binder.clearCallingIdentity();
                 final boolean success = connection.focusSearch(accessibilityWindowId,
                         accessibilityNodeId, direction, interactionId, this,
                         Thread.currentThread().getId());
+                Binder.restoreCallingIdentity(identityToken);
                 if (success) {
                     AccessibilityNodeInfo info = getFindAccessibilityNodeInfoResultAndClear(
                             interactionId);
@@ -502,9 +516,11 @@
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
+                final long identityToken = Binder.clearCallingIdentity();
                 final boolean success = connection.performAccessibilityAction(
                         accessibilityWindowId, accessibilityNodeId, action, arguments,
                         interactionId, this, Thread.currentThread().getId());
+                Binder.restoreCallingIdentity(identityToken);
                 if (success) {
                     return getPerformAccessibilityActionResultAndClear(interactionId);
                 }
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 238d6c4..9ca59f1 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -4157,6 +4157,11 @@
                         offset = adjustedOffset;
                     }
                     positionCursor = true;
+                } else if (adjustedOffset < mPreviousOffset) {
+                    // Handle has jumped to the start of the word, and the user is moving
+                    // their finger towards the handle, the delta should be updated.
+                    mTouchWordDelta = mTextView.convertToLocalHorizontalCoordinate(x)
+                            - layout.getPrimaryHorizontal(mPreviousOffset);
                 }
             }
 
@@ -4291,6 +4296,11 @@
                         offset = adjustedOffset;
                     }
                     positionCursor = true;
+                } else if (adjustedOffset > mPreviousOffset) {
+                    // Handle has jumped to the end of the word, and the user is moving
+                    // their finger towards the handle, the delta should be updated.
+                    mTouchWordDelta = layout.getPrimaryHorizontal(mPreviousOffset)
+                            - mTextView.convertToLocalHorizontalCoordinate(x);
                 }
             }
 
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index 6cc4bda..258424a 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -935,22 +935,14 @@
         super.onDebugDraw(canvas);
     }
 
-    // Add/remove
-
-    /**
-     * @hide
-     */
     @Override
-    protected void onViewAdded(View child) {
+    public void onViewAdded(View child) {
         super.onViewAdded(child);
         invalidateStructure();
     }
 
-    /**
-     * @hide
-     */
     @Override
-    protected void onViewRemoved(View child) {
+    public void onViewRemoved(View child) {
         super.onViewRemoved(child);
         invalidateStructure();
     }
diff --git a/core/java/com/android/internal/logging/MetricsLogger.java b/core/java/com/android/internal/logging/MetricsLogger.java
index 230d96d..03f2e3a 100644
--- a/core/java/com/android/internal/logging/MetricsLogger.java
+++ b/core/java/com/android/internal/logging/MetricsLogger.java
@@ -26,6 +26,13 @@
  * @hide
  */
 public class MetricsLogger implements MetricsConstants {
+    public static final int VOLUME_DIALOG = 207;
+    public static final int VOLUME_DIALOG_DETAILS = 208;
+    public static final int ACTION_VOLUME_SLIDER = 209;
+    public static final int ACTION_VOLUME_STREAM = 210;
+    public static final int ACTION_VOLUME_KEY = 211;
+    public static final int ACTION_VOLUME_ICON = 212;
+    public static final int ACTION_RINGER_MODE = 213;
     // Temporary constants go here, to await migration to MetricsConstants.
 
     public static void visible(Context context, int category) throws IllegalArgumentException {
diff --git a/core/java/com/android/internal/statusbar/StatusBarIcon.java b/core/java/com/android/internal/statusbar/StatusBarIcon.java
index 4693d4b..1d62623 100644
--- a/core/java/com/android/internal/statusbar/StatusBarIcon.java
+++ b/core/java/com/android/internal/statusbar/StatusBarIcon.java
@@ -20,17 +20,27 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.UserHandle;
+import android.text.TextUtils;
 
 public class StatusBarIcon implements Parcelable {
     public UserHandle user;
+    public String pkg;
     public Icon icon;
     public int iconLevel;
     public boolean visible = true;
     public int number;
     public CharSequence contentDescription;
 
-    public StatusBarIcon(UserHandle user, Icon icon, int iconLevel, int number,
+    public StatusBarIcon(UserHandle user, String resPackage, Icon icon, int iconLevel, int number,
             CharSequence contentDescription) {
+        if (icon.getType() == Icon.TYPE_RESOURCE
+                && TextUtils.isEmpty(icon.getResPackage())) {
+            // This is an odd situation where someone's managed to hand us an icon without a
+            // package inside, probably by mashing an int res into a Notification object.
+            // Now that we have the correct package name handy, let's fix it.
+            icon = Icon.createWithResource(resPackage, icon.getResId());
+        }
+        this.pkg = resPackage;
         this.user = user;
         this.icon = icon;
         this.iconLevel = iconLevel;
@@ -41,21 +51,23 @@
     public StatusBarIcon(String iconPackage, UserHandle user,
             int iconId, int iconLevel, int number,
             CharSequence contentDescription) {
-        this(user, Icon.createWithResource(iconPackage, iconId),
+        this(user, iconPackage, Icon.createWithResource(iconPackage, iconId),
                 iconLevel, number, contentDescription);
     }
 
     @Override
     public String toString() {
-        return "StatusBarIcon(icon=" + this.icon
+        return "StatusBarIcon(icon=" + icon
+                + ((iconLevel != 0)?(" level=" + iconLevel):"")
+                + (visible?" visible":"")
                 + " user=" + user.getIdentifier()
-                + " level=" + this.iconLevel + " visible=" + visible
-                + " num=" + this.number + " )";
+                + ((number != 0)?(" num=" + number):"")
+                + " )";
     }
 
     @Override
     public StatusBarIcon clone() {
-        StatusBarIcon that = new StatusBarIcon(this.user, this.icon,
+        StatusBarIcon that = new StatusBarIcon(this.user, this.pkg, this.icon,
                 this.iconLevel, this.number, this.contentDescription);
         that.visible = this.visible;
         return that;
@@ -70,6 +82,7 @@
 
     public void readFromParcel(Parcel in) {
         this.icon = (Icon) in.readParcelable(null);
+        this.pkg = in.readString();
         this.user = (UserHandle) in.readParcelable(null);
         this.iconLevel = in.readInt();
         this.visible = in.readInt() != 0;
@@ -79,6 +92,7 @@
 
     public void writeToParcel(Parcel out, int flags) {
         out.writeParcelable(this.icon, 0);
+        out.writeString(this.pkg);
         out.writeParcelable(this.user, 0);
         out.writeInt(this.iconLevel);
         out.writeInt(this.visible ? 1 : 0);
diff --git a/core/java/com/android/internal/widget/ResolverDrawerLayout.java b/core/java/com/android/internal/widget/ResolverDrawerLayout.java
index be727f1..585cbc9 100644
--- a/core/java/com/android/internal/widget/ResolverDrawerLayout.java
+++ b/core/java/com/android/internal/widget/ResolverDrawerLayout.java
@@ -127,6 +127,8 @@
         final ViewConfiguration vc = ViewConfiguration.get(context);
         mTouchSlop = vc.getScaledTouchSlop();
         mMinFlingVelocity = vc.getScaledMinimumFlingVelocity();
+
+        setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
     }
 
     public void setSmallCollapsed(boolean smallCollapsed) {
@@ -593,11 +595,6 @@
     }
 
     @Override
-    public CharSequence getAccessibilityClassName() {
-        return ResolverDrawerLayout.class.getName();
-    }
-
-    @Override
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
         if (isEnabled()) {
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 9f2181f..91b3278 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -856,7 +856,8 @@
     bool useInMask;
     size_t numPositionMasks = 0;
     size_t numIndexMasks = 0;
-    size_t numUniqueFormats;
+    size_t numUniqueFormats = 0;
+
     ALOGV("convertAudioPortFromNative id %d role %d type %d name %s",
         nAudioPort->id, nAudioPort->role, nAudioPort->type, nAudioPort->name);
 
@@ -907,12 +908,13 @@
     }
 
     // formats
-    cFormats = new int[nAudioPort->num_formats];
-    numUniqueFormats = 0;
-    for (size_t index = 0; index < nAudioPort->num_formats; index++) {
-        int format = audioFormatFromNative(nAudioPort->formats[index]);
-        if (!hasFormat(cFormats, numUniqueFormats, format)) {
-            cFormats[numUniqueFormats++] = format;
+    if (nAudioPort->num_formats != 0) {
+        cFormats = new int[nAudioPort->num_formats];
+        for (size_t index = 0; index < nAudioPort->num_formats; index++) {
+            int format = audioFormatFromNative(nAudioPort->formats[index]);
+            if (!hasFormat(cFormats, numUniqueFormats, format)) {
+                cFormats[numUniqueFormats++] = format;
+            }
         }
     }
     jFormats = env->NewIntArray(numUniqueFormats);
@@ -920,7 +922,9 @@
         jStatus = (jint)AUDIO_JAVA_ERROR;
         goto exit;
     }
-    env->SetIntArrayRegion(jFormats, 0, numUniqueFormats, cFormats);
+    if (numUniqueFormats != 0) {
+        env->SetIntArrayRegion(jFormats, 0, numUniqueFormats, cFormats);
+    }
 
     // gains
     jGains = env->NewObjectArray(nAudioPort->num_gains,
diff --git a/core/res/res/values-mcc302-mnc220/config.xml b/core/res/res/values-mcc302-mnc220/config.xml
index 9147cbf..09a63aa 100644
--- a/core/res/res/values-mcc302-mnc220/config.xml
+++ b/core/res/res/values-mcc302-mnc220/config.xml
@@ -38,7 +38,8 @@
          note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" -->
     <string-array translatable="false" name="config_tether_apndata">
         <item>[ApnSettingV3]TELUS ISP,isp.telus.com,,,,,,,,,302,220,,DUN,,,true,0,,,,,,,gid,54</item>
-        <item>[ApnSettingV3]Tethered PC Mobile,isp.mb.com,,,,,,,,,302,220,,DUN,,,true,0,,,,,,,gid,50</item>
+        <item>[ApnSettingV3]Tethered Mobile Internet,isp.mb.com,,,,,,,,,302,220,,DUN,,,true,0,,,,,,,gid,50</item>
+        <item>[ApnSettingV3]Tethered Public Mobile,isp.mb.com,,,,,,,,,302,220,,DUN,,,true,0,,,,,,,gid,4D4F</item>
     </string-array>
 
 </resources>
diff --git a/core/res/res/values-mcc302-mnc720/config.xml b/core/res/res/values-mcc302-mnc720/config.xml
index a83107a..dcfa5c5 100644
--- a/core/res/res/values-mcc302-mnc720/config.xml
+++ b/core/res/res/values-mcc302-mnc720/config.xml
@@ -29,6 +29,8 @@
     <string-array translatable="false" name="config_tether_apndata">
         <item>Rogers LTE Tethering,ltedata.apn,,,,,,,,,302,720,,DUN</item>
         <item>[ApnSettingV3]chatr Tethering,chatrisp.apn,,,,,,,,,302,720,,DUN,,,true,0,,,,,,,imsi,302720x94</item>
+        <item>[ApnSettingV3]Tbaytel Tethering,ltedata.apn,,,,,,,,,302,720,,DUN,IPV4V6,IP,true,0,,,,,,,gid,BA</item>
+        <item>[ApnSettingV3]Cityfone Tethering,ltedata.apn,,,,,,,,,302,720,,DUN,IPV4V6,IP,true,0,,,,,,,spn,CITYFONE</item>
     </string-array>
 
     <!-- Configure mobile network MTU. Carrier specific value is set here.
diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java
index 7b4329a..85db6a1 100644
--- a/graphics/java/android/graphics/drawable/Icon.java
+++ b/graphics/java/android/graphics/drawable/Icon.java
@@ -29,6 +29,7 @@
 import android.os.Message;
 import android.os.Parcel;
 import android.os.Parcelable;
+import android.text.TextUtils;
 import android.util.Log;
 
 import java.io.DataInputStream;
@@ -258,16 +259,21 @@
                 return new BitmapDrawable(context.getResources(), getBitmap());
             case TYPE_RESOURCE:
                 if (getResources() == null) {
-                    if (getResPackage() == null || "android".equals(getResPackage())) {
+                    // figure out where to load resources from
+                    String resPackage = getResPackage();
+                    if (TextUtils.isEmpty(resPackage)) {
+                        // if none is specified, try the given context
+                        resPackage = context.getPackageName();
+                    }
+                    if ("android".equals(resPackage)) {
                         mObj1 = Resources.getSystem();
                     } else {
                         final PackageManager pm = context.getPackageManager();
                         try {
-                            mObj1 = pm.getResourcesForApplication(getResPackage());
+                            mObj1 = pm.getResourcesForApplication(resPackage);
                         } catch (PackageManager.NameNotFoundException e) {
-                            Log.e(TAG, String.format("Unable to find pkg=%s",
-                                            getResPackage()),
-                                    e);
+                            Log.e(TAG, String.format("Unable to find pkg=%s for icon %s",
+                                    resPackage, this), e);
                             break;
                         }
                     }
@@ -320,12 +326,15 @@
      */
     public Drawable loadDrawableAsUser(Context context, int userId) {
         if (mType == TYPE_RESOURCE) {
-            if (getResources() == null
-                    && getResPackage() != null
-                    && !(getResPackage().equals("android"))) {
+            String resPackage = getResPackage();
+            if (TextUtils.isEmpty(resPackage)) {
+                resPackage = context.getPackageName();
+            }
+            if (getResources() == null && !(getResPackage().equals("android"))) {
                 final PackageManager pm = context.getPackageManager();
                 try {
-                    mObj1 = pm.getResourcesForApplicationAsUser(getResPackage(), userId);
+                    // assign getResources() as the correct user
+                    mObj1 = pm.getResourcesForApplicationAsUser(resPackage, userId);
                 } catch (PackageManager.NameNotFoundException e) {
                     Log.e(TAG, String.format("Unable to find pkg=%s user=%d",
                                     getResPackage(),
@@ -410,6 +419,9 @@
      * @param resId ID of the drawable resource
      */
     public static Icon createWithResource(Context context, @DrawableRes int resId) {
+        if (context == null) {
+            throw new IllegalArgumentException("Context must not be null.");
+        }
         final Icon rep = new Icon(TYPE_RESOURCE);
         rep.mInt1 = resId;
         rep.mString1 = context.getPackageName();
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index a3ea896..f3d755c 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -75,6 +75,7 @@
     String getBestProvider(in Criteria criteria, boolean enabledOnly);
     boolean providerMeetsCriteria(String provider, in Criteria criteria);
     ProviderProperties getProviderProperties(String provider);
+    String getNetworkProviderPackage();
     boolean isProviderEnabled(String provider);
 
     void addTestProvider(String name, in ProviderProperties properties, String opPackageName);
diff --git a/media/java/android/media/midi/MidiDevice.java b/media/java/android/media/midi/MidiDevice.java
index 7998a92..93fb6d2 100644
--- a/media/java/android/media/midi/MidiDevice.java
+++ b/media/java/android/media/midi/MidiDevice.java
@@ -50,21 +50,43 @@
      * Close this object to terminate the connection.
      */
     public class MidiConnection implements Closeable {
-        private final IBinder mToken;
-        private final MidiInputPort mInputPort;
+        private final IMidiDeviceServer mInputPortDeviceServer;
+        private final IBinder mInputPortToken;
+        private final IBinder mOutputPortToken;
+        private final CloseGuard mGuard = CloseGuard.get();
+        private boolean mIsClosed;
 
-        MidiConnection(IBinder token, MidiInputPort inputPort) {
-            mToken = token;
-            mInputPort = inputPort;
+        MidiConnection(IBinder outputPortToken, MidiInputPort inputPort) {
+            mInputPortDeviceServer = inputPort.getDeviceServer();
+            mInputPortToken = inputPort.getToken();
+            mOutputPortToken = outputPortToken;
+            mGuard.open("close");
         }
 
         @Override
         public void close() throws IOException {
+            synchronized (mGuard) {
+                if (mIsClosed) return;
+                mGuard.close();
+                try {
+                    // close input port
+                    mInputPortDeviceServer.closePort(mInputPortToken);
+                    // close output port
+                    mDeviceServer.closePort(mOutputPortToken);
+                } catch (RemoteException e) {
+                    Log.e(TAG, "RemoteException in MidiConnection.close");
+                }
+                mIsClosed = true;
+            }
+        }
+
+        @Override
+        protected void finalize() throws Throwable {
             try {
-                mDeviceServer.closePort(mToken);
-                IoUtils.closeQuietly(mInputPort);
-            } catch (RemoteException e) {
-                Log.e(TAG, "RemoteException in MidiConnection.close");
+                mGuard.warnIfOpen();
+                close();
+            } finally {
+                super.finalize();
             }
         }
     }
diff --git a/media/java/android/media/midi/MidiDeviceServer.java b/media/java/android/media/midi/MidiDeviceServer.java
index 1212b64..19ff624 100644
--- a/media/java/android/media/midi/MidiDeviceServer.java
+++ b/media/java/android/media/midi/MidiDeviceServer.java
@@ -257,7 +257,14 @@
         public void connectPorts(IBinder token, ParcelFileDescriptor pfd,
                 int outputPortNumber) {
             MidiInputPort inputPort = new MidiInputPort(pfd, outputPortNumber);
-            mOutputPortDispatchers[outputPortNumber].getSender().connect(inputPort);
+            MidiDispatcher dispatcher = mOutputPortDispatchers[outputPortNumber];
+            synchronized (dispatcher) {
+                dispatcher.getSender().connect(inputPort);
+                int openCount = dispatcher.getReceiverCount();
+                mOutputPortOpenCount[outputPortNumber] = openCount;
+                updateDeviceStatus();
+            }
+
             mInputPorts.add(inputPort);
             OutputPortClient client = new OutputPortClient(token, inputPort);
             synchronized (mPortClients) {
diff --git a/media/java/android/media/midi/MidiInputPort.java b/media/java/android/media/midi/MidiInputPort.java
index af5a86c..db41b10 100644
--- a/media/java/android/media/midi/MidiInputPort.java
+++ b/media/java/android/media/midi/MidiInputPort.java
@@ -103,17 +103,33 @@
 
     // used by MidiDevice.connectInputPort() to connect our socket directly to another device
     /* package */ ParcelFileDescriptor claimFileDescriptor() {
-        synchronized (mBuffer) {
-            ParcelFileDescriptor pfd = mParcelFileDescriptor;
-            if (pfd != null) {
+        synchronized (mGuard) {
+            ParcelFileDescriptor pfd;
+            synchronized (mBuffer) {
+                pfd = mParcelFileDescriptor;
+                if (pfd == null) return null;
                 IoUtils.closeQuietly(mOutputStream);
                 mParcelFileDescriptor = null;
                 mOutputStream = null;
             }
+
+            // Set mIsClosed = true so we will not call mDeviceServer.closePort() in close().
+            // MidiDevice.MidiConnection.close() will do the cleanup instead.
+            mIsClosed = true;
             return pfd;
         }
     }
 
+    // used by MidiDevice.MidiConnection to close this port after the connection is closed
+    /* package */ IBinder getToken() {
+        return mToken;
+    }
+
+    // used by MidiDevice.MidiConnection to close this port after the connection is closed
+    /* package */ IMidiDeviceServer getDeviceServer() {
+        return mDeviceServer;
+    }
+
     @Override
     public void close() throws IOException {
         synchronized (mGuard) {
diff --git a/media/jni/android_media_ImageWriter.cpp b/media/jni/android_media_ImageWriter.cpp
index 634ba64..ba7634c 100644
--- a/media/jni/android_media_ImageWriter.cpp
+++ b/media/jni/android_media_ImageWriter.cpp
@@ -361,8 +361,7 @@
     ALOGV("%s:", __FUNCTION__);
     JNIImageWriterContext* const ctx = reinterpret_cast<JNIImageWriterContext *>(nativeCtx);
     if (ctx == NULL || thiz == NULL) {
-        jniThrowException(env, "java/lang/IllegalStateException",
-                "ImageWriterContext is not initialized");
+        // ImageWriter is already closed.
         return;
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 79761ec..a496548 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -41,6 +41,7 @@
 import android.database.ContentObserver;
 import android.graphics.PorterDuff;
 import android.graphics.drawable.Drawable;
+import android.graphics.drawable.Icon;
 import android.os.AsyncTask;
 import android.os.Build;
 import android.os.Handler;
@@ -1396,6 +1397,7 @@
 
             final StatusBarIcon ic = new StatusBarIcon(
                     entry.notification.getUser(),
+                    entry.notification.getPackageName(),
                     entry.notification.getNotification().getSmallIcon(),
                     entry.notification.getNotification().iconLevel,
                     entry.notification.getNotification().number,
@@ -1682,10 +1684,11 @@
 
         final StatusBarIcon ic = new StatusBarIcon(
                 sbn.getUser(),
-                    n.getSmallIcon(),
-                    n.iconLevel,
-                    n.number,
-                    n.tickerText);
+                sbn.getPackageName(),
+                n.getSmallIcon(),
+                n.iconLevel,
+                n.number,
+                n.tickerText);
         if (!iconView.set(ic)) {
             handleNotificationError(sbn, "Couldn't create icon: " + ic);
             return null;
@@ -1825,6 +1828,7 @@
                     // Update the icon
                     final StatusBarIcon ic = new StatusBarIcon(
                             notification.getUser(),
+                            notification.getPackageName(),
                             n.getSmallIcon(),
                             n.iconLevel,
                             n.number,
@@ -1847,6 +1851,7 @@
             if (DEBUG) Log.d(TAG, "not reusing notification for key: " + key);
             final StatusBarIcon ic = new StatusBarIcon(
                     notification.getUser(),
+                    notification.getPackageName(),
                     n.getSmallIcon(),
                     n.iconLevel,
                     n.number,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index dbabe3f..aedae52 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -125,16 +125,22 @@
 
         @Override
         public int compare(Entry a, Entry b) {
-            String mediaNotification = mEnvironment.getCurrentMediaNotificationKey();
-            boolean aMedia = a.key.equals(mediaNotification);
-            boolean bMedia = b.key.equals(mediaNotification);
-
             final StatusBarNotification na = a.notification;
             final StatusBarNotification nb = b.notification;
+            final int aPriority = na.getNotification().priority;
+            final int bPriority = nb.getNotification().priority;
 
-            boolean aSystemMax = na.getNotification().priority >= Notification.PRIORITY_MAX &&
+            String mediaNotification = mEnvironment.getCurrentMediaNotificationKey();
+
+            // PRIORITY_MIN media streams are allowed to drift to the bottom
+            final boolean aMedia = a.key.equals(mediaNotification)
+                    && aPriority > Notification.PRIORITY_MIN;
+            final boolean bMedia = b.key.equals(mediaNotification)
+                    && bPriority > Notification.PRIORITY_MIN;
+
+            boolean aSystemMax = aPriority >= Notification.PRIORITY_MAX &&
                     isSystemNotification(na);
-            boolean bSystemMax = nb.getNotification().priority >= Notification.PRIORITY_MAX &&
+            boolean bSystemMax = bPriority >= Notification.PRIORITY_MAX &&
                     isSystemNotification(nb);
             int d = nb.getScore() - na.getScore();
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
index 26d1c86..fcdd4b7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
@@ -124,6 +124,9 @@
 
     private void updateSlot(String slot, String iconPkg, int iconId) {
         if (!mDemoMode) return;
+        if (iconPkg == null) {
+            iconPkg = mContext.getPackageName();
+        }
         int removeIndex = -1;
         for (int i = 0; i < getChildCount(); i++) {
             StatusBarIconView v = (StatusBarIconView) getChildAt(i);
@@ -143,10 +146,10 @@
         if (iconId == 0) {
             if (removeIndex != -1) {
                 removeViewAt(removeIndex);
-                return;
             }
+            return;
         }
-        StatusBarIcon icon = new StatusBarIcon(iconPkg, UserHandle.CURRENT, iconId, 0, 0, "Demo");
+        StatusBarIcon icon = new StatusBarIcon(iconPkg, UserHandle.OWNER, iconId, 0, 0, "Demo");
         StatusBarIconView v = new StatusBarIconView(getContext(), null, null);
         v.setTag(slot);
         v.set(icon);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 495f0fd..c30cb34 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -491,7 +491,7 @@
     }
 
     public void closeQs() {
-        cancelAnimation();
+        cancelQsAnimation();
         setQsExpansion(mQsMinExpansionHeight);
     }
 
@@ -508,7 +508,7 @@
     }
 
     public void openQs() {
-        cancelAnimation();
+        cancelQsAnimation();
         if (mQsExpansionEnabled) {
             setQsExpansion(mQsMaxExpansionHeight);
         }
@@ -921,7 +921,7 @@
 
     @Override
     public void onOverscrollTopChanged(float amount, boolean isRubberbanded) {
-        cancelAnimation();
+        cancelQsAnimation();
         if (!mQsExpansionEnabled) {
             amount = 0f;
         }
@@ -953,7 +953,8 @@
     }
 
     private void onQsExpansionStarted(int overscrollAmount) {
-        cancelAnimation();
+        cancelQsAnimation();
+        cancelHeightAnimator();
 
         // Reset scroll position and apply that position to the expanded height.
         float height = mQsExpansionHeight - mScrollView.getScrollY() - overscrollAmount;
@@ -1391,7 +1392,7 @@
         return mVelocityTracker.getYVelocity();
     }
 
-    private void cancelAnimation() {
+    private void cancelQsAnimation() {
         if (mQsExpansionAnimator != null) {
             mQsExpansionAnimator.cancel();
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 9d4997c..094d5f0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -535,7 +535,7 @@
      */
     protected abstract boolean isInContentBounds(float x, float y);
 
-    private void cancelHeightAnimator() {
+    protected void cancelHeightAnimator() {
         if (mHeightAnimator != null) {
             mHeightAnimator.cancel();
         }
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 69198ed..cd90d27 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -3460,6 +3460,7 @@
             mKeyguardIndicationController.setVisible(true);
             mNotificationPanel.resetViews();
             mKeyguardUserSwitcher.setKeyguard(true, fromShadeLocked);
+            mStatusBarView.removePendingHideExpandedRunnables();
         } else {
             mKeyguardIndicationController.setVisible(false);
             mKeyguardUserSwitcher.setKeyguard(false,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index dfd280a..6a46924 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -42,6 +42,12 @@
     private ScrimController mScrimController;
     private float mMinFraction;
     private float mPanelFraction;
+    private Runnable mHideExpandedRunnable = new Runnable() {
+        @Override
+        public void run() {
+            mBar.makeExpandedInvisible();
+        }
+    };
 
     public PhoneStatusBarView(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -118,15 +124,14 @@
                     + Log.getStackTraceString(new Throwable()));
         }
         // Close the status bar in the next frame so we can show the end of the animation.
-        postOnAnimation(new Runnable() {
-            @Override
-            public void run() {
-                mBar.makeExpandedInvisible();
-            }
-        });
+        postOnAnimation(mHideExpandedRunnable);
         mLastFullyOpenedPanel = null;
     }
 
+    public void removePendingHideExpandedRunnables() {
+        removeCallbacks(mHideExpandedRunnable);
+    }
+
     @Override
     public void onPanelFullyOpened(PanelView openPanel) {
         super.onPanelFullyOpened(openPanel);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java
index 0eb7197..d1e4963 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java
@@ -116,7 +116,7 @@
             // Unknown network, need to add it.
             if (ap.getSecurity() != AccessPoint.SECURITY_NONE) {
                 Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
-                intent.putExtra(EXTRA_START_CONNECT_SSID, ap.getSsid());
+                intent.putExtra(EXTRA_START_CONNECT_SSID, ap.getSsidStr());
                 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                 fireSettingsIntentCallback(intent);
                 return true;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 18b5820..1ba87da 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -408,7 +408,7 @@
         boolean hasNoSims = mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
         if (hasNoSims != mHasNoSims) {
             mHasNoSims = hasNoSims;
-            notifyListeners();
+            mCallbackHandler.setNoSims(mHasNoSims);
         }
     }
 
@@ -660,8 +660,8 @@
             }
             String nosim = args.getString("nosim");
             if (nosim != null) {
-                boolean show = nosim.equals("show");
-                mCallbackHandler.setNoSims(show);
+                mHasNoSims = nosim.equals("show");
+                mCallbackHandler.setNoSims(mHasNoSims);
             }
             String mobile = args.getString("mobile");
             if (mobile != null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 1bf4547..5700732 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -228,6 +228,7 @@
     private ScrimController mScrimController;
     private boolean mForceNoOverlappingRendering;
     private NotificationOverflowContainer mOverflowContainer;
+    private final ArrayList<Pair<ExpandableNotificationRow, Boolean>> mTmpList = new ArrayList<>();
 
     public NotificationStackScrollLayout(Context context) {
         this(context, null);
@@ -1608,7 +1609,7 @@
     }
 
     @Override
-    protected void onViewRemoved(View child) {
+    public void onViewRemoved(View child) {
         super.onViewRemoved(child);
         // we only call our internal methods if this is actually a removal and not just a
         // notification which becomes a child notification
@@ -1651,8 +1652,7 @@
      * @return Whether an animation was generated.
      */
     private boolean generateRemoveAnimation(View child) {
-        if (mAddedHeadsUpChildren.contains(child)) {
-            removeChildFromHeadsUpChangeAnimations(child);
+        if (removeRemovedChildFromHeadsUpChangeAnimations(child)) {
             mAddedHeadsUpChildren.remove(child);
             return false;
         }
@@ -1671,15 +1671,27 @@
         return false;
     }
 
-    private void removeChildFromHeadsUpChangeAnimations(View child) {
-        ArrayList<Pair<ExpandableNotificationRow, Boolean> > toRemove = new ArrayList<>();
+    /**
+     * Remove a removed child view from the heads up animations if it was just added there
+     *
+     * @return whether any child was removed from the list to animate
+     */
+    private boolean removeRemovedChildFromHeadsUpChangeAnimations(View child) {
+        boolean hasAddEvent = false;
         for (Pair<ExpandableNotificationRow, Boolean> eventPair : mHeadsUpChangeAnimations) {
             ExpandableNotificationRow row = eventPair.first;
+            boolean isHeadsUp = eventPair.second;
             if (child == row) {
-                toRemove.add(eventPair);
+                mTmpList.add(eventPair);
+                hasAddEvent |= isHeadsUp;
             }
         }
-        mHeadsUpChangeAnimations.removeAll(toRemove);
+        if (hasAddEvent) {
+            // This child was just added lets remove all events.
+            mHeadsUpChangeAnimations.removeAll(mTmpList);
+        }
+        mTmpList.clear();
+        return hasAddEvent;
     }
 
     /**
@@ -1745,7 +1757,7 @@
     }
 
     @Override
-    protected void onViewAdded(View child) {
+    public void onViewAdded(View child) {
         super.onViewAdded(child);
         onViewAddedInternal(child);
     }
diff --git a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java
index d9f0598..ca6aaeb 100644
--- a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java
@@ -131,11 +131,14 @@
         intent.putExtra("mobile", "show");
         intent.putExtra("sims", "1");
         intent.putExtra("nosim", "false");
-        intent.putExtra("fully", "true");
         intent.putExtra("level", "4");
         intent.putExtra("datatypel", "");
         getContext().sendBroadcast(intent);
 
+        // Need to send this after so that the sim controller already exists.
+        intent.putExtra("fully", "true");
+        getContext().sendBroadcast(intent);
+
         intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_BATTERY);
         intent.putExtra("level", "100");
         intent.putExtra("plugged", "false");
diff --git a/packages/SystemUI/src/com/android/systemui/volume/Events.java b/packages/SystemUI/src/com/android/systemui/volume/Events.java
index 12dca94..893c939 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/Events.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/Events.java
@@ -16,11 +16,13 @@
 
 package com.android.systemui.volume;
 
+import android.content.Context;
 import android.media.AudioManager;
 import android.media.AudioSystem;
 import android.provider.Settings.Global;
 import android.util.Log;
 
+import com.android.internal.logging.MetricsLogger;
 import com.android.systemui.volume.VolumeDialogController.State;
 
 import java.util.Arrays;
@@ -47,6 +49,7 @@
     public static final int EVENT_ZEN_MODE_CHANGED = 13; // (mode|int)
     public static final int EVENT_SUPPRESSOR_CHANGED = 14;  // (component|string) (name|string)
     public static final int EVENT_MUTE_CHANGED = 15;  // (stream|int) (muted|bool)
+    public static final int EVENT_TOUCH_LEVEL_DONE = 16;  // (stream|int) (level|bool)
 
     private static final String[] EVENT_TAGS = {
         "show_dialog",
@@ -65,6 +68,7 @@
         "zen_mode_changed",
         "suppressor_changed",
         "mute_changed",
+        "touch_level_done",
     };
 
     public static final int DISMISS_REASON_UNKNOWN = 0;
@@ -100,36 +104,59 @@
 
     public static Callback sCallback;
 
-    public static void writeEvent(int tag, Object... list) {
+    public static void writeEvent(Context context, int tag, Object... list) {
         final long time = System.currentTimeMillis();
         final StringBuilder sb = new StringBuilder("writeEvent ").append(EVENT_TAGS[tag]);
         if (list != null && list.length > 0) {
             sb.append(" ");
             switch (tag) {
                 case EVENT_SHOW_DIALOG:
+                    MetricsLogger.visible(context, MetricsLogger.VOLUME_DIALOG);
+                    MetricsLogger.histogram(context, "volume_from_keyguard",
+                            (Boolean) list[1] ? 1 : 0);
                     sb.append(SHOW_REASONS[(Integer) list[0]]).append(" keyguard=").append(list[1]);
                     break;
                 case EVENT_EXPAND:
+                    MetricsLogger.visibility(context, MetricsLogger.VOLUME_DIALOG_DETAILS,
+                            (Boolean) list[0]);
                     sb.append(list[0]);
                     break;
                 case EVENT_DISMISS_DIALOG:
+                    MetricsLogger.hidden(context, MetricsLogger.VOLUME_DIALOG);
                     sb.append(DISMISS_REASONS[(Integer) list[0]]);
                     break;
                 case EVENT_ACTIVE_STREAM_CHANGED:
+                    MetricsLogger.action(context, MetricsLogger.ACTION_VOLUME_STREAM,
+                            (Integer) list[0]);
                     sb.append(AudioSystem.streamToString((Integer) list[0]));
                     break;
                 case EVENT_ICON_CLICK:
+                    MetricsLogger.action(context, MetricsLogger.ACTION_VOLUME_ICON,
+                            (Integer) list[1]);
                     sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
                             .append(iconStateToString((Integer) list[1]));
                     break;
+                case EVENT_TOUCH_LEVEL_DONE:
+                    MetricsLogger.action(context, MetricsLogger.ACTION_VOLUME_SLIDER,
+                            (Integer) list[1]);
+                    // fall through
                 case EVENT_TOUCH_LEVEL_CHANGED:
                 case EVENT_LEVEL_CHANGED:
                 case EVENT_MUTE_CHANGED:
                     sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
                             .append(list[1]);
                     break;
-                case EVENT_INTERNAL_RINGER_MODE_CHANGED:
+                case EVENT_KEY:
+                    MetricsLogger.action(context, MetricsLogger.ACTION_VOLUME_KEY,
+                            (Integer) list[1]);
+                    sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
+                            .append(list[1]);
+                    break;
                 case EVENT_EXTERNAL_RINGER_MODE_CHANGED:
+                    MetricsLogger.action(context, MetricsLogger.ACTION_RINGER_MODE,
+                            (Integer) list[0]);
+                    // fall through
+                case EVENT_INTERNAL_RINGER_MODE_CHANGED:
                     sb.append(ringerModeToString((Integer) list[0]));
                     break;
                 case EVENT_ZEN_MODE_CHANGED:
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
index aa891b6..5b2eb84 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
@@ -369,7 +369,7 @@
         row.icon.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {
-                Events.writeEvent(Events.EVENT_ICON_CLICK, row.stream, row.iconState);
+                Events.writeEvent(mContext, Events.EVENT_ICON_CLICK, row.stream, row.iconState);
                 mController.setActiveStream(row.stream);
                 if (row.stream == AudioManager.STREAM_RING) {
                     final boolean hasVibrator = mController.hasVibrator();
@@ -417,7 +417,7 @@
         if (mShowing) return;
         mShowing = true;
         mDialog.show();
-        Events.writeEvent(Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked());
+        Events.writeEvent(mContext, Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked());
         mController.notifyVisible(true);
     }
 
@@ -444,7 +444,7 @@
         if (!mShowing) return;
         mShowing = false;
         mDialog.dismiss();
-        Events.writeEvent(Events.EVENT_DISMISS_DIALOG, reason);
+        Events.writeEvent(mContext, Events.EVENT_DISMISS_DIALOG, reason);
         setExpandedH(false);
         mController.notifyVisible(false);
         synchronized (mSafetyWarningLock) {
@@ -834,7 +834,7 @@
         public void onClick(View v) {
             if (mExpanding) return;
             final boolean newExpand = !mExpanded;
-            Events.writeEvent(Events.EVENT_EXPAND, v);
+            Events.writeEvent(mContext, Events.EVENT_EXPAND, newExpand);
             setExpandedH(newExpand);
         }
     };
@@ -845,7 +845,7 @@
             mSettingsButton.postDelayed(new Runnable() {
                 @Override
                 public void run() {
-                    Events.writeEvent(Events.EVENT_SETTINGS_CLICK);
+                    Events.writeEvent(mContext, Events.EVENT_SETTINGS_CLICK);
                     if (mCallback != null) {
                         mCallback.onSettingsClicked();
                     }
@@ -933,7 +933,8 @@
                 if (mRow.requestedLevel != userLevel) {
                     mController.setStreamVolume(mRow.stream, userLevel);
                     mRow.requestedLevel = userLevel;
-                    Events.writeEvent(Events.EVENT_TOUCH_LEVEL_CHANGED, mRow.stream, userLevel);
+                    Events.writeEvent(mContext, Events.EVENT_TOUCH_LEVEL_CHANGED, mRow.stream,
+                            userLevel);
                 }
             }
         }
@@ -951,6 +952,7 @@
             mRow.tracking = false;
             mRow.userAttempt = SystemClock.uptimeMillis();
             int userLevel = getImpliedLevel(seekBar, seekBar.getProgress());
+            Events.writeEvent(mContext, Events.EVENT_TOUCH_LEVEL_DONE, mRow.stream, userLevel);
             if (mRow.ss.level != userLevel) {
                 mHandler.sendMessageDelayed(mHandler.obtainMessage(H.RECHECK, mRow),
                         USER_ATTEMPT_GRACE_PERIOD);
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java
index c6d9e46..9a59a2a 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java
@@ -104,7 +104,7 @@
 
     public VolumeDialogController(Context context, ComponentName component) {
         mContext = context.getApplicationContext();
-        Events.writeEvent(Events.EVENT_COLLECTION_STARTED);
+        Events.writeEvent(mContext, Events.EVENT_COLLECTION_STARTED);
         mComponent = component;
         mWorkerThread = new HandlerThread(VolumeDialogController.class.getSimpleName());
         mWorkerThread.start();
@@ -168,7 +168,7 @@
         if (D.BUG) Log.d(TAG, "destroy");
         if (mDestroyed) return;
         mDestroyed = true;
-        Events.writeEvent(Events.EVENT_COLLECTION_STOPPED);
+        Events.writeEvent(mContext, Events.EVENT_COLLECTION_STOPPED);
         mMediaSessions.destroy();
         mObserver.destroy();
         mReceiver.destroy();
@@ -293,7 +293,8 @@
         if (showUI) {
             changed |= updateActiveStreamW(stream);
         }
-        changed |= updateStreamLevelW(stream, mAudio.getLastAudibleStreamVolume(stream));
+        int lastAudibleStreamVolume = mAudio.getLastAudibleStreamVolume(stream);
+        changed |= updateStreamLevelW(stream, lastAudibleStreamVolume);
         changed |= checkRoutedToBluetoothW(showUI ? AudioManager.STREAM_MUSIC : stream);
         if (changed) {
             mCallbacks.onStateChanged(mState);
@@ -308,14 +309,14 @@
             mCallbacks.onShowSilentHint();
         }
         if (changed && fromKey) {
-            Events.writeEvent(Events.EVENT_KEY);
+            Events.writeEvent(mContext, Events.EVENT_KEY, stream, lastAudibleStreamVolume);
         }
     }
 
     private boolean updateActiveStreamW(int activeStream) {
         if (activeStream == mState.activeStream) return false;
         mState.activeStream = activeStream;
-        Events.writeEvent(Events.EVENT_ACTIVE_STREAM_CHANGED, activeStream);
+        Events.writeEvent(mContext, Events.EVENT_ACTIVE_STREAM_CHANGED, activeStream);
         if (D.BUG) Log.d(TAG, "updateActiveStreamW " + activeStream);
         final int s = activeStream < DYNAMIC_STREAM_START_INDEX ? activeStream : -1;
         if (D.BUG) Log.d(TAG, "forceVolumeControlStream " + s);
@@ -364,7 +365,7 @@
         if (ss.level == level) return false;
         ss.level = level;
         if (isLogWorthy(stream)) {
-            Events.writeEvent(Events.EVENT_LEVEL_CHANGED, stream, level);
+            Events.writeEvent(mContext, Events.EVENT_LEVEL_CHANGED, stream, level);
         }
         return true;
     }
@@ -387,7 +388,7 @@
         if (ss.muted == muted) return false;
         ss.muted = muted;
         if (isLogWorthy(stream)) {
-            Events.writeEvent(Events.EVENT_MUTE_CHANGED, stream, muted);
+            Events.writeEvent(mContext, Events.EVENT_MUTE_CHANGED, stream, muted);
         }
         if (muted && isRinger(stream)) {
             updateRingerModeInternalW(mAudio.getRingerModeInternal());
@@ -410,7 +411,7 @@
         if (Objects.equals(mState.effectsSuppressor, effectsSuppressor)) return false;
         mState.effectsSuppressor = effectsSuppressor;
         mState.effectsSuppressorName = getApplicationName(mContext, mState.effectsSuppressor);
-        Events.writeEvent(Events.EVENT_SUPPRESSOR_CHANGED, mState.effectsSuppressor,
+        Events.writeEvent(mContext, Events.EVENT_SUPPRESSOR_CHANGED, mState.effectsSuppressor,
                 mState.effectsSuppressorName);
         return true;
     }
@@ -434,21 +435,21 @@
                 Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF);
         if (mState.zenMode == zen) return false;
         mState.zenMode = zen;
-        Events.writeEvent(Events.EVENT_ZEN_MODE_CHANGED, zen);
+        Events.writeEvent(mContext, Events.EVENT_ZEN_MODE_CHANGED, zen);
         return true;
     }
 
     private boolean updateRingerModeExternalW(int rm) {
         if (rm == mState.ringerModeExternal) return false;
         mState.ringerModeExternal = rm;
-        Events.writeEvent(Events.EVENT_EXTERNAL_RINGER_MODE_CHANGED, rm);
+        Events.writeEvent(mContext, Events.EVENT_EXTERNAL_RINGER_MODE_CHANGED, rm);
         return true;
     }
 
     private boolean updateRingerModeInternalW(int rm) {
         if (rm == mState.ringerModeInternal) return false;
         mState.ringerModeInternal = rm;
-        Events.writeEvent(Events.EVENT_INTERNAL_RINGER_MODE_CHANGED, rm);
+        Events.writeEvent(mContext, Events.EVENT_INTERNAL_RINGER_MODE_CHANGED, rm);
         return true;
     }
 
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index b737de3..30680ed 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -1298,7 +1298,7 @@
         synchronized (mLock) {
             ensureGroupStateLoadedLocked(userId);
 
-            ArrayList<AppWidgetProviderInfo> result = null;
+            ArrayList<AppWidgetProviderInfo> result = new ArrayList<AppWidgetProviderInfo>();
 
             final int providerCount = mProviders.size();
             for (int i = 0; i < providerCount; i++) {
@@ -1315,9 +1315,6 @@
                 if (providerProfileId == profileId
                         && mSecurityPolicy.isProviderInCallerOrInProfileAndWhitelListed(
                             provider.id.componentName.getPackageName(), providerProfileId)) {
-                    if (result == null) {
-                        result = new ArrayList<>();
-                    }
                     result.add(cloneIfLocalBinder(info));
                 }
             }
diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java
index c76fc1c..743aafb 100644
--- a/services/core/java/com/android/server/LocationManagerService.java
+++ b/services/core/java/com/android/server/LocationManagerService.java
@@ -1958,6 +1958,27 @@
         return p.getProperties();
     }
 
+    /**
+     * @return null if the provider does not exist
+     * @throws SecurityException if the provider is not allowed to be
+     * accessed by the caller
+     */
+    @Override
+    public String getNetworkProviderPackage() {
+        LocationProviderInterface p;
+        synchronized (mLock) {
+            if (mProvidersByName.get(LocationManager.NETWORK_PROVIDER) == null) {
+                return null;
+            }
+            p = mProvidersByName.get(LocationManager.NETWORK_PROVIDER);
+        }
+
+        if (p instanceof LocationProviderProxy) {
+            return ((LocationProviderProxy) p).getConnectedPackageName();
+        }
+        return null;
+    }
+
     @Override
     public boolean isProviderEnabled(String provider) {
         // Fused provider is accessed indirectly via criteria rather than the provider-based APIs,
diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java
index 236af37..87cb40e 100644
--- a/services/core/java/com/android/server/am/ServiceRecord.java
+++ b/services/core/java/com/android/server/am/ServiceRecord.java
@@ -445,6 +445,11 @@
                             // icon, but this used to be able to slip through, so for
                             // those dirty apps we will create a notification clearly
                             // blaming the app.
+                            Slog.v(TAG, "Attempted to start a foreground service ("
+                                    + name
+                                    + ") with a broken notification (no icon: "
+                                    + localForegroundNoti
+                                    + ")");
 
                             CharSequence appName = appInfo.loadLabel(
                                     ams.mContext.getPackageManager());
@@ -461,6 +466,12 @@
                                 // it's ugly, but it clearly identifies the app
                                 notiBuilder.setSmallIcon(appInfo.icon);
 
+                                // mark as foreground
+                                notiBuilder.setFlag(Notification.FLAG_FOREGROUND_SERVICE, true);
+
+                                // we are doing the app a kindness here
+                                notiBuilder.setPriority(Notification.PRIORITY_MIN);
+
                                 Intent runningIntent = new Intent(
                                         Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                                 runningIntent.setData(Uri.fromParts("package",
@@ -498,6 +509,8 @@
                         nm.enqueueNotification(localPackageName, localPackageName,
                                 appUid, appPid, null, localForegroundId, localForegroundNoti,
                                 outId, userId);
+
+                        foregroundNoti = localForegroundNoti; // save it for amending next time
                     } catch (RuntimeException e) {
                         Slog.w(TAG, "Error showing notification for service", e);
                         // If it gave us a garbage notification, it doesn't
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index d39b25f..47d3bde 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -1542,11 +1542,7 @@
 
     // UI update and Broadcast Intent
     private void sendVolumeUpdate(int streamType, int oldIndex, int index, int flags) {
-        if (!isPlatformVoice() && (streamType == AudioSystem.STREAM_RING)) {
-            streamType = AudioSystem.STREAM_NOTIFICATION;
-        } else {
-            streamType = mStreamVolumeAlias[streamType];
-        }
+        streamType = mStreamVolumeAlias[streamType];
 
         if (streamType == AudioSystem.STREAM_MUSIC) {
             flags = updateFlagsForSystemAudio(flags);
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index dbcfa19..6fb9a5c 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -3739,13 +3739,14 @@
             attrs.gravity = Gravity.BOTTOM;
             mDockLayer = win.getSurfaceLayer();
         } else if (attrs.type == TYPE_VOICE_INTERACTION) {
-            pf.left = df.left = of.left = cf.left = vf.left = mUnrestrictedScreenLeft;
+            pf.left = df.left = of.left = mUnrestrictedScreenLeft;
             pf.top = df.top = of.top = mUnrestrictedScreenTop;
-            pf.right = df.right = of.right = cf.right = vf.right = mUnrestrictedScreenLeft
-                    + mUnrestrictedScreenWidth;
-            pf.bottom = df.bottom = of.bottom = cf.bottom = mUnrestrictedScreenTop
-                    + mUnrestrictedScreenHeight;
+            pf.right = df.right = of.right = mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
+            pf.bottom = df.bottom = of.bottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
             cf.bottom = vf.bottom = mStableBottom;
+            // Note: In Phone landscape mode, the button bar should also be excluded.
+            cf.right = vf.right = mStableRight;
+            cf.left = vf.left = mStableLeft;
             cf.top = vf.top = mStableTop;
         } else if (win == mStatusBar) {
             pf.left = df.left = of.left = mUnrestrictedScreenLeft;
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index e085d89..fa1ed54 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -1124,13 +1124,14 @@
      * {@hide}
      */
     public static int getSimStateForSlotIdx(int slotIdx) {
-        int simState;
+        int simState = TelephonyManager.SIM_STATE_UNKNOWN;
 
         try {
             ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
-            simState = iSub.getSimStateForSlotIdx(slotIdx);
+            if (iSub != null) {
+                simState = iSub.getSimStateForSlotIdx(slotIdx);
+            }
         } catch (RemoteException ex) {
-            simState = TelephonyManager.SIM_STATE_UNKNOWN;
         }
         logd("getSimStateForSubscriber: simState=" + simState + " slotIdx=" + slotIdx);
         return simState;
@@ -1144,7 +1145,9 @@
     public boolean isActiveSubId(int subId) {
         try {
             ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
-            return iSub.isActiveSubId(subId);
+            if (iSub != null) {
+                return iSub.isActiveSubId(subId);
+            }
         } catch (RemoteException ex) {
         }
         return false;
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml
index d282fc9..0f3fb95 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml
@@ -13,37 +13,41 @@
      limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-            android:width="64dp"
-            android:height="64dp"
-            android:viewportWidth="7.30625"
-            android:viewportHeight="12.25"
-            android:autoMirrored="true">
+    android:autoMirrored="true"
+    android:height="64dp"
+    android:viewportHeight="12.25"
+    android:viewportWidth="7.30625"
+    android:width="64dp" >
 
     <group>
         <clip-path
-                android:name="clip1"
-                android:pathData="
+            android:name="clip1"
+            android:pathData="
                 M 3.65, 6.125
                 m-.001, 0
                 a .001,.001 0 1,0 .002,0
-                a .001,.001 0 1,0-.002,0z"/>
-        <path
-                android:name="one"
-                android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125
-                l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0
-                l-5.046875,0.0 0.0-1.0Z"
-                android:fillColor="#ff88ff"/>
+                a .001,.001 0 1,0-.002,0z" />
 
+        <path
+            android:name="one"
+            android:fillColor="#ff88ff"
+            android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125
+                l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0
+                l-5.046875,0.0 0.0-1.0Z" />
+    </group>
+    <group>
         <clip-path
-                android:name="clip2"
-                android:pathData="
+            android:name="clip2"
+            android:pathData="
                 M 3.65, 6.125
                 m-6, 0
                 a 6,6 0 1,0 12,0
-                a 6,6 0 1,0-12,0z"/>
+                a 6,6 0 1,0-12,0z" />
+
         <path
-                android:name="two"
-                android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375
+            android:name="two"
+            android:fillColor="#ff88ff"
+            android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375
                         q 1.1718752-1.1875 1.4687502-1.53125 0.578125-0.625 0.796875-1.0625
                         q 0.234375-0.453125 0.234375-0.875 0.0-0.703125-0.5-1.140625
                         q-0.484375-0.4375-1.2656252-0.4375-0.5625,0.0-1.1875,0.1875
@@ -51,7 +55,7 @@
                         q 0.625-0.15625 1.140625-0.15625 1.3593752,0.0 2.1718752,0.6875
                         q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125-0.203125,1.015625
                         q-0.203125,0.484375-0.734375,1.140625-0.15625,0.171875-0.9375,0.984375
-                        q-0.78125024,0.8125-2.2187502,2.265625Z"
-                android:fillColor="#ff88ff"/>
+                        q-0.78125024,0.8125-2.2187502,2.265625Z" />
     </group>
-</vector>
+
+</vector>
\ No newline at end of file
diff --git a/tools/aapt2/BinaryResourceParser.cpp b/tools/aapt2/BinaryResourceParser.cpp
index 3559f43..4f1947a 100644
--- a/tools/aapt2/BinaryResourceParser.cpp
+++ b/tools/aapt2/BinaryResourceParser.cpp
@@ -116,9 +116,11 @@
 BinaryResourceParser::BinaryResourceParser(const std::shared_ptr<ResourceTable>& table,
                                            const std::shared_ptr<IResolver>& resolver,
                                            const Source& source,
+                                           const std::u16string& defaultPackage,
                                            const void* data,
                                            size_t len) :
-        mTable(table), mResolver(resolver), mSource(source), mData(data), mDataLen(len) {
+        mTable(table), mResolver(resolver), mSource(source), mDefaultPackage(defaultPackage),
+        mData(data), mDataLen(len) {
 }
 
 bool BinaryResourceParser::parse() {
@@ -177,6 +179,9 @@
             if (!type) {
                 return false;
             }
+            if (outSymbol->package.empty()) {
+                outSymbol->package = mTable->getPackage();
+            }
             outSymbol->type = *type;
 
             // Since we scan the symbol table in order, we can start looking for the
@@ -350,7 +355,22 @@
 
     size_t len = strnlen16(reinterpret_cast<const char16_t*>(packageHeader->name),
             sizeof(packageHeader->name) / sizeof(packageHeader->name[0]));
-    mTable->setPackage(StringPiece16(reinterpret_cast<const char16_t*>(packageHeader->name), len));
+    if (mTable->getPackage().empty() && len == 0) {
+        mTable->setPackage(mDefaultPackage);
+    } else if (len > 0) {
+        StringPiece16 thisPackage(reinterpret_cast<const char16_t*>(packageHeader->name), len);
+        if (mTable->getPackage().empty()) {
+            mTable->setPackage(thisPackage);
+        } else if (thisPackage != mTable->getPackage()) {
+            Logger::error(mSource)
+                    << "incompatible packages: "
+                    << mTable->getPackage()
+                    << " vs. "
+                    << thisPackage
+                    << std::endl;
+            return false;
+        }
+    }
 
     ResChunkPullParser parser(getChunkData(packageHeader->header),
                               getChunkDataLen(packageHeader->header));
diff --git a/tools/aapt2/BinaryResourceParser.h b/tools/aapt2/BinaryResourceParser.h
index 32876cd..3aab301 100644
--- a/tools/aapt2/BinaryResourceParser.h
+++ b/tools/aapt2/BinaryResourceParser.h
@@ -45,6 +45,7 @@
     BinaryResourceParser(const std::shared_ptr<ResourceTable>& table,
                          const std::shared_ptr<IResolver>& resolver,
                          const Source& source,
+                         const std::u16string& defaultPackage,
                          const void* data, size_t len);
 
     BinaryResourceParser(const BinaryResourceParser&) = delete; // No copy.
@@ -97,12 +98,12 @@
 
     const Source mSource;
 
+    // The package name of the resource table.
+    std::u16string mDefaultPackage;
+
     const void* mData;
     const size_t mDataLen;
 
-    // The package name of the resource table.
-    std::u16string mPackage;
-
     // The array of symbol entries. Each element points to an offset
     // in the table and an index into the symbol table string pool.
     const SymbolTable_entry* mSymbolEntries = nullptr;
diff --git a/tools/aapt2/Linker.cpp b/tools/aapt2/Linker.cpp
index f3f04a5..c37cc93 100644
--- a/tools/aapt2/Linker.cpp
+++ b/tools/aapt2/Linker.cpp
@@ -160,7 +160,7 @@
 void Linker::visit(Reference& reference, ValueVisitorArgs& a) {
     Args& args = static_cast<Args&>(a);
 
-    if (!reference.name.isValid()) {
+    if (reference.name.entry.empty()) {
         // We can't have a completely bad reference.
         if (!reference.id.isValid()) {
             Logger::error() << "srsly? " << args.referrer << std::endl;
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp
index 41c229d..54a7329 100644
--- a/tools/aapt2/Main.cpp
+++ b/tools/aapt2/Main.cpp
@@ -756,8 +756,8 @@
                 zipFile->uncompress(entry));
         assert(uncompressedData);
 
-        BinaryResourceParser parser(table, resolver, source, uncompressedData.get(),
-                                    entry->getUncompressedLen());
+        BinaryResourceParser parser(table, resolver, source, options.appInfo.package, 
+                                    uncompressedData.get(), entry->getUncompressedLen());
         if (!parser.parse()) {
             return false;
         }
@@ -1085,50 +1085,47 @@
     }
 
     bool isStaticLib = false;
+    if (options.phase == AaptOptions::Phase::Link) {
+        flag::requiredFlag("--manifest", "AndroidManifest.xml of your app",
+                [&options](const StringPiece& arg) {
+                    options.manifest = Source{ arg.toString() };
+                });
+
+        flag::optionalFlag("-I", "add an Android APK to link against",
+                [&options](const StringPiece& arg) {
+                    options.libraries.push_back(Source{ arg.toString() });
+                });
+
+        flag::optionalFlag("--java", "directory in which to generate R.java",
+                [&options](const StringPiece& arg) {
+                    options.generateJavaClass = Source{ arg.toString() };
+                });
+
+        flag::optionalFlag("--proguard", "file in which to output proguard rules",
+                [&options](const StringPiece& arg) {
+                    options.generateProguardRules = Source{ arg.toString() };
+                });
+
+        flag::optionalSwitch("--static-lib", "generate a static Android library", true,
+                             &isStaticLib);
+
+        flag::optionalFlag("--binding", "Output directory for binding XML files",
+                [&options](const StringPiece& arg) {
+                    options.bindingOutput = Source{ arg.toString() };
+                });
+        flag::optionalSwitch("--no-version", "Disables automatic style and layout versioning",
+                             false, &options.versionStylesAndLayouts);
+    }
+
     if (options.phase == AaptOptions::Phase::Compile ||
             options.phase == AaptOptions::Phase::Link) {
-        if (options.phase == AaptOptions::Phase::Compile) {
-            flag::requiredFlag("--package", "Android package name",
-                    [&options](const StringPiece& arg) {
-                        options.appInfo.package = util::utf8ToUtf16(arg);
-                    });
-        } else if (options.phase == AaptOptions::Phase::Link) {
-            flag::requiredFlag("--manifest", "AndroidManifest.xml of your app",
-                    [&options](const StringPiece& arg) {
-                        options.manifest = Source{ arg.toString() };
-                    });
-
-            flag::optionalFlag("-I", "add an Android APK to link against",
-                    [&options](const StringPiece& arg) {
-                        options.libraries.push_back(Source{ arg.toString() });
-                    });
-
-            flag::optionalFlag("--java", "directory in which to generate R.java",
-                    [&options](const StringPiece& arg) {
-                        options.generateJavaClass = Source{ arg.toString() };
-                    });
-
-            flag::optionalFlag("--proguard", "file in which to output proguard rules",
-                    [&options](const StringPiece& arg) {
-                        options.generateProguardRules = Source{ arg.toString() };
-                    });
-
-            flag::optionalSwitch("--static-lib", "generate a static Android library", true,
-                                 &isStaticLib);
-
-            flag::optionalFlag("--binding", "Output directory for binding XML files",
-                    [&options](const StringPiece& arg) {
-                        options.bindingOutput = Source{ arg.toString() };
-                    });
-            flag::optionalSwitch("--no-version", "Disables automatic style and layout versioning",
-                                 false, &options.versionStylesAndLayouts);
-        }
-
         // Common flags for all steps.
         flag::requiredFlag("-o", "Output path", [&options](const StringPiece& arg) {
             options.output = Source{ arg.toString() };
         });
-    } else if (options.phase == AaptOptions::Phase::DumpStyleGraph) {
+    }
+
+    if (options.phase == AaptOptions::Phase::DumpStyleGraph) {
         flag::requiredFlag("--style", "Name of the style to dump",
                 [&options](const StringPiece& arg, std::string* outError) -> bool {
                     Reference styleReference;
@@ -1191,7 +1188,7 @@
                 zipFile->uncompress(entry));
         assert(uncompressedData);
 
-        BinaryResourceParser parser(table, resolver, source, uncompressedData.get(),
+        BinaryResourceParser parser(table, resolver, source, {}, uncompressedData.get(),
                                     entry->getUncompressedLen());
         if (!parser.parse()) {
             return false;
@@ -1223,16 +1220,17 @@
         if (!loadAppInfo(options.manifest, &options.appInfo)) {
             return false;
         }
-    }
 
-    // Verify we have some common options set.
-    if (options.appInfo.package.empty()) {
-        Logger::error() << "no package name specified." << std::endl;
-        return false;
+        if (options.appInfo.package.empty()) {
+            Logger::error() << "no package name specified." << std::endl;
+            return false;
+        }
     }
 
     // Every phase needs a resource table.
     std::shared_ptr<ResourceTable> table = std::make_shared<ResourceTable>();
+
+    // The package name is empty when in the compile phase.
     table->setPackage(options.appInfo.package);
     if (options.appInfo.package == u"android") {
         table->setPackageId(0x01);
diff --git a/tools/aapt2/TableFlattener.cpp b/tools/aapt2/TableFlattener.cpp
index 539c48f..b7c04f0 100644
--- a/tools/aapt2/TableFlattener.cpp
+++ b/tools/aapt2/TableFlattener.cpp
@@ -79,7 +79,7 @@
 
         // Write the key.
         if (!Res_INTERNALID(key.id.id) && !key.id.isValid()) {
-            assert(key.name.isValid());
+            assert(!key.name.entry.empty());
             mSymbols->push_back(std::make_pair(ResourceNameRef(key.name),
                     mOut->size() - sizeof(*outMapEntry)));
         }
@@ -284,13 +284,6 @@
 bool TableFlattener::flatten(BigBuffer* out, const ResourceTable& table) {
     const size_t beginning = out->size();
 
-    if (table.getPackage().size() == 0) {
-        Logger::error()
-                << "ResourceTable has no package name."
-                << std::endl;
-        return false;
-    }
-
     if (table.getPackageId() == ResourceTable::kUnsetPackageId) {
         Logger::error()
                 << "ResourceTable has no package ID set."
diff --git a/tools/aapt2/data/Makefile b/tools/aapt2/data/Makefile
index 3387135..91ff5fe 100644
--- a/tools/aapt2/data/Makefile
+++ b/tools/aapt2/data/Makefile
@@ -50,7 +50,7 @@
 # returns: out/values-v4.apk: res/values-v4/styles.xml res/values-v4/colors.xml
 define make-collect-rule
 $(LOCAL_OUT)/$1.apk: $(filter $(LOCAL_RESOURCE_DIR)/$1/%,$(PRIVATE_RESOURCES))
-	$(AAPT) compile --package $(LOCAL_PACKAGE) -o $$@ $$^
+	$(AAPT) compile -o $$@ $$^
 endef
 
 # Collect: out/values-v4.apk <- res/values-v4/styles.xml res/values-v4/colors.xml
diff --git a/tools/aapt2/data/lib/Makefile b/tools/aapt2/data/lib/Makefile
index 372c225..741be9a 100644
--- a/tools/aapt2/data/lib/Makefile
+++ b/tools/aapt2/data/lib/Makefile
@@ -48,7 +48,7 @@
 # returns: out/values-v4.apk: res/values-v4/styles.xml res/values-v4/colors.xml
 define make-collect-rule
 $(LOCAL_OUT)/$1.apk: $(filter $(LOCAL_RESOURCE_DIR)/$1/%,$(PRIVATE_RESOURCES))
-	$(AAPT) compile --package $(LOCAL_PACKAGE) -o $$@ $$^
+	$(AAPT) compile -o $$@ $$^
 endef
 
 # Collect: out/values-v4.apk <- res/values-v4/styles.xml res/values-v4/colors.xml
