From 9030d9235aabf7c45687f68801f9a4a09f9b776f Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Wed, 11 May 2016 14:22:59 -0700 Subject: 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: NIGHTLIES-2935 --- src/com/android/settings/applications/InstalledAppDetails.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index f2e6392..cc1b241 100755 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -1019,8 +1019,10 @@ public class InstalledAppDetails extends AppInfoBase private final BroadcastReceiver mCheckKillProcessesReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - updateForceStopButton(getResultCode() != Activity.RESULT_CANCELED); - refreshUi(); + if (getActivity() != null && !getActivity().isDestroyed()) { + updateForceStopButton(getResultCode() != Activity.RESULT_CANCELED); + refreshUi(); + } } }; -- cgit v1.1