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

Commit 36c71f13 authored by Adnan Begovic's avatar Adnan Begovic
Browse files

Settings: Ignore process kill receiver events if activity is destroyed.

  Following the logic for refresh ui attempts to getContext() from the
  underlying activity which may have already been destroyed causing
  an NPE.

Change-Id: Ibe110022ebedcc55a01f3bda66501580c8d92fed
TICKET: CYNGNOS-2803
(cherry picked from commit 9030d923)
parent 279419b9
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1019,9 +1019,11 @@ public class InstalledAppDetails extends AppInfoBase
    private final BroadcastReceiver mCheckKillProcessesReceiver = new BroadcastReceiver() {
    private final BroadcastReceiver mCheckKillProcessesReceiver = new BroadcastReceiver() {
        @Override
        @Override
        public void onReceive(Context context, Intent intent) {
        public void onReceive(Context context, Intent intent) {
            if (getActivity() != null && !getActivity().isDestroyed()) {
                updateForceStopButton(getResultCode() != Activity.RESULT_CANCELED);
                updateForceStopButton(getResultCode() != Activity.RESULT_CANCELED);
                refreshUi();
                refreshUi();
            }
            }
        }
    };
    };


    private final PermissionsResultCallback mPermissionCallback
    private final PermissionsResultCallback mPermissionCallback