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

Commit 01101b4f authored by nagarw's avatar nagarw Committed by Gerrit - the friendly Code Review server
Browse files

/platform/frameworks/base: Fix SystemUI crash on Recent App

Issue: SystemUI crash is observed when Context MenuItem is
       selected on the recent apps activity [Long pressing
       two recent apps at same time or Long press, lock and
       unlock the screen]

Fix: Changed the code to make sure that only one context
     menu is active at a time and also dismissed the
     context menu on pause of the RecentsActivity

CRs-Fixed: 539509

Change-Id: Ia50bed7bfad6fde7beeaec37fa6402177eee1d40
parent f3b7c05d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ public class RecentsActivity extends Activity {
                R.anim.recents_return_to_launcher_enter,
                R.anim.recents_return_to_launcher_exit);
        mForeground = false;
        if (mRecentsPanel != null) {
            mRecentsPanel.dismissContextMenuIfAny();
        }
        super.onPause();
    }

+8 −0
Original line number Diff line number Diff line
@@ -288,6 +288,11 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
        return pointInside(x, y, (View) mRecentsContainer);
    }

    public void dismissContextMenuIfAny() {
        if(mPopup != null) {
            mPopup.dismiss();
        }
    }
    public void show(boolean show) {
        show(show, null, false, false);
    }
@@ -756,6 +761,9 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener

    public void handleLongPress(
            final View selectedView, final View anchorView, final View thumbnailView) {
        if(mPopup != null) {
            mPopup.dismiss();
        }
        thumbnailView.setSelected(true);
        final PopupMenu popup =
            new PopupMenu(mContext, anchorView == null ? selectedView : anchorView);