Merge "Use the correct dependency" into ics-factoryrom
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index be42608..fae2c6f 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4023,7 +4023,7 @@
     protected void finalize() throws Throwable {
         try {
             if (mNativeClass != 0) {
-                post(new Runnable() {
+                mPrivateHandler.post(new Runnable() {
                     @Override
                     public void run() {
                         destroy();
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index 5dfbe01..c270f21 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -245,6 +245,20 @@
 }
 
 static void
+decVideoSurfaceRef(JNIEnv *env, jobject thiz)
+{
+    sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
+    if (mp == NULL) {
+        return;
+    }
+
+    sp<ISurfaceTexture> old_st = getVideoSurfaceTexture(env, thiz);
+    if (old_st != NULL) {
+        old_st->decStrong(thiz);
+    }
+}
+
+static void
 setVideoSurface(JNIEnv *env, jobject thiz, jobject jsurface, jboolean mediaPlayerMustBeAlive)
 {
     sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
@@ -255,16 +269,15 @@
         return;
     }
 
-    sp<ISurfaceTexture> old_st = getVideoSurfaceTexture(env, thiz);
+    decVideoSurfaceRef(env, thiz);
+
     sp<ISurfaceTexture> new_st;
     if (jsurface) {
         sp<Surface> surface(Surface_getSurface(env, jsurface));
         new_st = surface->getSurfaceTexture();
         new_st->incStrong(thiz);
     }
-    if (old_st != NULL) {
-        old_st->decStrong(thiz);
-    }
+
     env->SetIntField(thiz, fields.surface_texture, (int)new_st.get());
 
     // This will fail if the media player has not been initialized yet. This
@@ -625,7 +638,7 @@
 android_media_MediaPlayer_release(JNIEnv *env, jobject thiz)
 {
     LOGV("release");
-    setVideoSurface(env, thiz, NULL, false /* mediaPlayerMustBeAlive */);
+    decVideoSurfaceRef(env, thiz);
     sp<MediaPlayer> mp = setMediaPlayer(env, thiz, 0);
     if (mp != NULL) {
         // this prevents native callbacks after the object is released
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
old mode 100644
new mode 100755
index c59dd3c..8ead45e
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -762,6 +762,26 @@
     }
 
     /**
+     * Returns the MSISDN string.
+     * for a GSM phone. Return null if it is unavailable.
+     * <p>
+     * Requires Permission:
+     *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+     *
+     * @hide
+     */
+    public String getMsisdn() {
+        try {
+            return getSubscriberInfo().getMsisdn();
+        } catch (RemoteException ex) {
+            return null;
+        } catch (NullPointerException ex) {
+            // This could happen before phone restarts due to crashing
+            return null;
+        }
+    }
+
+    /**
      * Returns the voice mail number. Return null if it is unavailable.
      * <p>
      * Requires Permission:
diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
old mode 100644
new mode 100755
index def770f..da0326c
--- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
+++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
@@ -54,6 +54,11 @@
     String getLine1AlphaTag();
 
     /**
+     * Retrieves MSISDN Number.
+     */
+    String getMsisdn();
+
+    /**
      * Retrieves the voice mail number.
      */
     String getVoiceMailNumber();
diff --git a/telephony/java/com/android/internal/telephony/PhoneSubInfo.java b/telephony/java/com/android/internal/telephony/PhoneSubInfo.java
old mode 100644
new mode 100755
index de18d0a..e8449ce
--- a/telephony/java/com/android/internal/telephony/PhoneSubInfo.java
+++ b/telephony/java/com/android/internal/telephony/PhoneSubInfo.java
@@ -105,6 +105,14 @@
     }
 
     /**
+     * Retrieves the MSISDN string.
+     */
+    public String getMsisdn() {
+        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
+        return mPhone.getMsisdn();
+    }
+
+    /**
      * Retrieves the voice mail number.
      */
     public String getVoiceMailNumber() {
diff --git a/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java b/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
old mode 100644
new mode 100755
index a287b2e..bd130de
--- a/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
+++ b/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
@@ -75,6 +75,13 @@
     }
 
     /**
+     * Retrieves the MSISDN Number.
+     */
+    public String getMsisdn() {
+        return mPhoneSubInfo.getMsisdn();
+    }
+
+    /**
      * Retrieves the voice mail number.
      */
     public String getVoiceMailNumber() {