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

Commit 2545f065 authored by hoffc's avatar hoffc
Browse files

Fix force close for updating UI after activity destroyed.

If activity is finishing or destroyed, getting activity context will return null results in settings app force close.

Directly return if network select activity is finishing or destroyed when handling network scan callback.

Bug: 372123288
Change-Id: Ia8c89569761b66da58cafd0140ceda29ac7d678c
parent 28f83ffa
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -368,6 +368,11 @@ public class NetworkSelectSettings extends DashboardFragment {

    @VisibleForTesting
    protected void scanResultHandler(NetworkScanRepository.NetworkScanResult results) {
        if (isFinishingOrDestroyed()) {
            Log.d(TAG, "scanResultHandler: activity isFinishingOrDestroyed, directly return");
            return;
        }

        mCellInfoList = filterOutSatellitePlmn(results.getCellInfos());
        Log.d(TAG, "CellInfoList: " + CellInfoUtil.cellInfoListToString(mCellInfoList));
        updateAllPreferenceCategory();