Merge "StrictMode: shut up VM penalty logging on debug builds."
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index f0aa878..2d2f205 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -6127,6 +6127,14 @@
         public static final int STATUS_CHANGING_LOCALE = 3;
 
         /**
+         * The status that indicates that there are no accounts and no contacts
+         * on the device.
+         *
+         * @hide
+         */
+        public static final int STATUS_NO_ACCOUNTS_NO_CONTACTS = 4;
+
+        /**
          * Additional data associated with the status.
          *
          * @hide
diff --git a/docs/html/guide/topics/manifest/manifest-element.jd b/docs/html/guide/topics/manifest/manifest-element.jd
index a35c5a1..7f21e6b 100644
--- a/docs/html/guide/topics/manifest/manifest-element.jd
+++ b/docs/html/guide/topics/manifest/manifest-element.jd
@@ -159,6 +159,9 @@
 storage. However, the system will not allow the user to move the application to external storage if
 this attribute is set to {@code internalOnly}, which is the default setting.</p>
 
+<p>Read <a href="{@docRoot}guide/appendix/install-location.html">App Install Location</a> for
+more information about using this attribute (including how to maintain backward compatibility).</p>
+
 <p>Introduced in: API Level 8.</p>
 
 
@@ -173,7 +176,7 @@
 
 <p>
 <dt>see also:</dt>
-<dd><a href="{@docRoot}guide/appendix/install-location.html">App Install Location</a><br/>
+<dd>
 <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
 
 </dl>
diff --git a/media/java/android/media/videoeditor/AudioTrack.java b/media/java/android/media/videoeditor/AudioTrack.java
index d02709e..32ff553 100755
--- a/media/java/android/media/videoeditor/AudioTrack.java
+++ b/media/java/android/media/videoeditor/AudioTrack.java
@@ -102,7 +102,7 @@
         // Ducking is enabled by default

         mDuckingThreshold = 0;

         mDuckedTrackVolume = 0;

-        mIsDuckingEnabled = true;

+        mIsDuckingEnabled = false;

 

         // The audio waveform file is generated later

         mAudioWaveformFilename = null;

@@ -369,14 +369,15 @@
     /**

      * Enable ducking by specifying the required parameters

      *

-     * @param threshold Ducking will be activated when the relative energy in

+     * @param threshold Ducking will be activated when the energy in

      *      the media items audio signal goes above this value. The valid

-     *      range of values is 0 to 100.

+     *      range of values is 0db to 90dB. 0dB is equivalent to disabling

+     *      ducking.

      * @param duckedTrackVolume The relative volume of the audio track when ducking

      *      is active. The valid range of values is 0 to 100.

      */

     public void enableDucking(int threshold, int duckedTrackVolume) {

-        if (threshold < 0 || threshold > 100) {

+        if (threshold < 0 || threshold > 90) {

             throw new IllegalArgumentException("Invalid threshold value: " + threshold);

         }

 

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 1f4c9d1..d290bd9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -77,7 +77,7 @@
     public static final int MSG_CLOSE_RECENTS_PANEL = 1021;
     public static final int MSG_HIDE_SHADOWS = 1030;
     public static final int MSG_SHOW_SHADOWS = 1031;
-    public static final int MSG_SHOW_SHADOWS_NO_COLLAPSE = 1032;
+    public static final int MSG_RESTORE_SHADOWS = 1032;
 
     private static final int MAX_IMAGE_LEVEL = 10000;
     private static final boolean USE_2D_RECENTS = true;
@@ -406,14 +406,18 @@
                     if (mRecentsPanel != null) mRecentsPanel.setVisibility(View.GONE);
                     break;
                 case MSG_HIDE_SHADOWS:
+                    if (DEBUG) Slog.d(TAG, "hiding shadows (lights on)");
                     mShadowController.hideAllShadows();
                     break;
                 case MSG_SHOW_SHADOWS:
+                    if (DEBUG) Slog.d(TAG, "showing shadows (lights out)");
                     animateCollapse();
-                    // fall through
-                case MSG_SHOW_SHADOWS_NO_COLLAPSE:
                     mShadowController.showAllShadows();
                     break;
+                case MSG_RESTORE_SHADOWS:
+                    if (DEBUG) Slog.d(TAG, "quickly re-showing shadows if appropriate");
+                    mShadowController.refresh();
+                    break;
             }
         }
     }
@@ -1071,15 +1075,15 @@
                         switch (action) {
                             case MotionEvent.ACTION_CANCEL:
                             case MotionEvent.ACTION_UP:
-                                mHandler.removeMessages(MSG_SHOW_SHADOWS_NO_COLLAPSE);
+                                mHandler.removeMessages(MSG_RESTORE_SHADOWS);
                                 if (mShowShadows) {
-                                    mHandler.sendEmptyMessageDelayed(MSG_SHOW_SHADOWS_NO_COLLAPSE, 
+                                    mHandler.sendEmptyMessageDelayed(MSG_RESTORE_SHADOWS, 
                                             v == mNotificationShadow ? 5000 : 500);
                                 }
                                 last = true;
                                 break;
                             case MotionEvent.ACTION_DOWN:
-                                mHandler.removeMessages(MSG_SHOW_SHADOWS_NO_COLLAPSE);
+                                mHandler.removeMessages(MSG_RESTORE_SHADOWS);
                                 setShadowForButton(mTouchTarget, false);
                                 break;
                         }
@@ -1093,22 +1097,22 @@
             };
         }
 
+        public void refresh() {
+            setShadowForButton(mBackButton, mShowShadows);
+            setShadowForButton(mHomeButton, mShowShadows);
+            setShadowForButton(mRecentButton, mShowShadows);
+            setShadowForButton(mMenuButton, mShowShadows);
+            setShadowForButton(mNotificationArea, mShowShadows);
+        }
+
         public void showAllShadows() {
             mShowShadows = true;
-            setShadowForButton(mBackButton, true);
-            setShadowForButton(mHomeButton, true);
-            setShadowForButton(mRecentButton, true);
-            setShadowForButton(mMenuButton, true);
-            setShadowForButton(mNotificationArea, true);
+            refresh();
         }
 
         public void hideAllShadows() {
             mShowShadows = false;
-            setShadowForButton(mBackButton, false);
-            setShadowForButton(mHomeButton, false);
-            setShadowForButton(mRecentButton, false);
-            setShadowForButton(mMenuButton, false);
-            setShadowForButton(mNotificationArea, false);
+            refresh();
         }
 
         // Use View.INVISIBLE for things hidden due to shadowing, and View.GONE for things that are
diff --git a/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java b/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
index 5518e11..486e7aa 100644
--- a/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
@@ -130,9 +130,10 @@
 
     /** {@inheritDoc} */
     public void cleanUp() {
-        // hide the dialog.
+        // dismiss the dialog.
         if (mSimUnlockProgressDialog != null) {
-            mSimUnlockProgressDialog.hide();
+            mSimUnlockProgressDialog.dismiss();
+            mSimUnlockProgressDialog = null;
         }
         mUpdateMonitor.removeCallback(this);
     }
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 8d25d50..84bc100 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -557,6 +557,9 @@
 
     public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(InputMethodInfo imi) {
         synchronized (mMethodMap) {
+            if (imi == null && mCurMethodId != null) {
+                imi = mMethodMap.get(mCurMethodId);
+            }
             return mSettings.getEnabledInputMethodSubtypeListLocked(imi);
         }
     }
@@ -2043,18 +2046,20 @@
                     getEnabledInputMethodsAndSubtypeListLocked();
             ArrayList<InputMethodSubtype> enabledSubtypes =
                     new ArrayList<InputMethodSubtype>();
-            for (Pair<String, ArrayList<String>> imsPair : imsList) {
-                InputMethodInfo info = mMethodMap.get(imsPair.first);
-                if (info != null && info.getId().equals(imi.getId())) {
-                    ArrayList<InputMethodSubtype> subtypes = info.getSubtypes();
-                    for (InputMethodSubtype ims: subtypes) {
-                        for (String s: imsPair.second) {
-                            if (String.valueOf(ims.hashCode()).equals(s)) {
-                                enabledSubtypes.add(ims);
+            if (imi != null) {
+                for (Pair<String, ArrayList<String>> imsPair : imsList) {
+                    InputMethodInfo info = mMethodMap.get(imsPair.first);
+                    if (info != null && info.getId().equals(imi.getId())) {
+                        ArrayList<InputMethodSubtype> subtypes = info.getSubtypes();
+                        for (InputMethodSubtype ims: subtypes) {
+                            for (String s: imsPair.second) {
+                                if (String.valueOf(ims.hashCode()).equals(s)) {
+                                    enabledSubtypes.add(ims);
+                                }
                             }
                         }
+                        break;
                     }
-                    break;
                 }
             }
             return enabledSubtypes;
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java
index 35d5564..a77e73e 100644
--- a/telephony/java/com/android/internal/telephony/RIL.java
+++ b/telephony/java/com/android/internal/telephony/RIL.java
@@ -141,6 +141,7 @@
                 this.mNext = sPool;
                 sPool = this;
                 sPoolSize++;
+                mResult = null;
             }
         }
     }