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

Commit 3da80bd3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Resolving a leak of activity via SharedPreferencesImpl.MemoryCommitResult"

parents 6638b566 81aaa265
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
    public static final int REQUEST_ROTATE = 1;
    public static final int REQUEST_LOCK = 2;

    private final Activity mActivity;
    private Activity mActivity;
    private final SharedPreferences mSharedPrefs;

    private boolean mIgnoreAutoRotateSettings;
@@ -95,6 +95,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {

    @Override
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
        if (mDestroyed) return;
        boolean wasRotationEnabled = mHomeRotationEnabled;
        mHomeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY,
                getAllowRotationDefaultValue());
@@ -141,6 +142,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
    public void destroy() {
        if (!mDestroyed) {
            mDestroyed = true;
            mActivity = null;
            if (mSharedPrefs != null) {
                mSharedPrefs.unregisterOnSharedPreferenceChangeListener(this);
            }