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

Commit 4f490c58 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix the memory leak caused by the accessibility menu in SystemUI" into main

parents 2022c070 9b772df2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -387,6 +387,10 @@ public class AccessibilityMenuService extends AccessibilityService
        unregisterReceiver(mToggleMenuReceiver);
        mPrefs.unregisterOnSharedPreferenceChangeListener(mSharedPreferenceChangeListener);
        sInitialized = false;
        if (mA11yMenuLayout != null) {
            mA11yMenuLayout.clearLayout();
            mA11yMenuLayout = null;
        }
        return super.onUnbind(intent);
    }

+8 −0
Original line number Diff line number Diff line
@@ -151,6 +151,14 @@ public class A11yMenuOverlayLayout {
        return mLayout;
    }

    public void clearLayout() {
        if (mLayout != null) {
            mWindowManager.removeView(mLayout);
            mLayout.setOnTouchListener(null);
            mLayout = null;
        }
    }

    /** Updates view layout with new layout parameters only. */
    public void updateViewLayout() {
        if (mLayout == null || mLayoutParameter == null) {