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

Commit eeedd7de authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Dialer: fix memory leak in DialpadFragment"

parents 1f01e495 c74b5c17
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -396,6 +396,13 @@ public class DialpadFragment extends AnalyticsFragment
            mDelete.setOnLongClickListener(this);
        }

        // Populate the overflow menu in onCreate instead of onResume to avoid PopupMenu's memory leak.
        mOverflowMenuButton = mDialpadView.getOverflowMenuButton();
        mOverflowPopupMenu = buildOptionsMenu(mOverflowMenuButton);
        mOverflowMenuButton.setOnTouchListener(mOverflowPopupMenu.getDragToOpenListener());
        mOverflowMenuButton.setOnClickListener(this);
        mOverflowMenuButton.setVisibility(isDigitsEmpty() ? View.INVISIBLE : View.VISIBLE);

        mSpacer = fragmentView.findViewById(R.id.spacer);
        mSpacer.setOnTouchListener(new View.OnTouchListener() {
            @Override
@@ -709,15 +716,6 @@ public class DialpadFragment extends AnalyticsFragment

        mSmsPackageComponentName = DialerUtils.getSmsComponent(activity);

        // Populate the overflow menu in onResume instead of onCreate, so that if the SMS activity
        // is disabled while Dialer is paused, the "Send a text message" option can be correctly
        // removed when resumed.
        mOverflowMenuButton = mDialpadView.getOverflowMenuButton();
        mOverflowPopupMenu = buildOptionsMenu(mOverflowMenuButton);
        mOverflowMenuButton.setOnTouchListener(mOverflowPopupMenu.getDragToOpenListener());
        mOverflowMenuButton.setOnClickListener(this);
        mOverflowMenuButton.setVisibility(isDigitsEmpty() ? View.INVISIBLE : View.VISIBLE);

        if (getTelephonyManager().isMultiSimEnabled() &&
                MoreContactUtils.shouldShowOperator(mContext)) {
            if (SubscriptionManager.isVoicePromptEnabled()) {