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
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user