Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d071804 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issues #3257701 and #3267312

3257701 Preference headers have duplicated "title" and "summary" if
        title is not loaded from a resource
3267312 Fragment.onConfigurationChanged doesn't get called

Change-Id: I76e346ba88aa632ebb9aa413a2ce2645ebf357cd
parent 514d7d8d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1403,6 +1403,8 @@ public class Activity extends ContextThemeWrapper
    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 class Activity extends ContextThemeWrapper
    
    public void onLowMemory() {
        mCalled = true;
        mFragments.dispatchLowMemory();
    }
    
    /**
+23 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.app;
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 @@ final class FragmentManagerImpl extends FragmentManager {
        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;
+1 −1
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ public abstract class PreferenceActivity extends ListActivity implements
            if (summaryRes != 0) {
                return res.getText(summaryRes);
            }
            return title;
            return summary;
        }

        /**