Merge "Fix issues #3257701 and #3267312"
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index d679ef6..aaebbd0 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1403,6 +1403,8 @@
     public void onConfigurationChanged(Configuration newConfig) {
         mCalled = true;
 
+        mFragments.dispatchConfigurationChanged(newConfig);
+
         if (mWindow != null) {
             // Pass the configuration changed event to the window
             mWindow.onConfigurationChanged(newConfig);
@@ -1566,6 +1568,7 @@
     
     public void onLowMemory() {
         mCalled = true;
+        mFragments.dispatchLowMemory();
     }
     
     /**
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index fbad2fe..1b2d4df 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -19,6 +19,7 @@
 import android.animation.Animator;
 import android.animation.AnimatorInflater;
 import android.animation.AnimatorListenerAdapter;
+import android.content.res.Configuration;
 import android.content.res.TypedArray;
 import android.os.Bundle;
 import android.os.Handler;
@@ -1415,6 +1416,28 @@
         mActivity = null;
     }
     
+    public void dispatchConfigurationChanged(Configuration newConfig) {
+        if (mActive != null) {
+            for (int i=0; i<mAdded.size(); i++) {
+                Fragment f = mAdded.get(i);
+                if (f != null) {
+                    f.onConfigurationChanged(newConfig);
+                }
+            }
+        }
+    }
+
+    public void dispatchLowMemory() {
+        if (mActive != null) {
+            for (int i=0; i<mAdded.size(); i++) {
+                Fragment f = mAdded.get(i);
+                if (f != null) {
+                    f.onLowMemory();
+                }
+            }
+        }
+    }
+
     public boolean dispatchCreateOptionsMenu(Menu menu, MenuInflater inflater) {
         boolean show = false;
         ArrayList<Fragment> newMenus = null;
diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java
index 7492c96..41f0d10f2 100644
--- a/core/java/android/preference/PreferenceActivity.java
+++ b/core/java/android/preference/PreferenceActivity.java
@@ -394,7 +394,7 @@
             if (summaryRes != 0) {
                 return res.getText(summaryRes);
             }
-            return title;
+            return summary;
         }
 
         /**