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

Commit 35b276b8 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Don't send null data call list response

Test: atest DataServiceCallbackTest
Bug: 230123585
Change-Id: Iefe5754282611a51c8e7e023d2840729c9615924
parent 596ddbac
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -108,8 +108,8 @@ public class CellularDataService extends DataService {
                                    ar.exception != null
                                            ? DataServiceCallback.RESULT_ERROR_ILLEGAL_STATE
                                            : RESULT_SUCCESS,
                                    ar.exception != null ? Collections.EMPTY_LIST
                                            : (List<DataCallResponse>) ar.result
                                    ar.result != null ? (List<DataCallResponse>) ar.result
                                            : Collections.EMPTY_LIST
                                    );
                            break;
                        case DATA_CALL_LIST_CHANGED:
+4 −2
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import com.android.internal.telephony.PhoneConfigurationManager;
import com.android.internal.telephony.util.TelephonyUtils;
import com.android.telephony.Rlog;

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -118,7 +119,7 @@ public class DataServiceManager extends Handler {

    private String mLastBoundPackageName;

    private List<DataCallResponse> mLastDataCallResponseList;
    private List<DataCallResponse> mLastDataCallResponseList = Collections.EMPTY_LIST;

    private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
        @Override
@@ -328,7 +329,8 @@ public class DataServiceManager extends Handler {

        @Override
        public void onDataCallListChanged(List<DataCallResponse> dataCallList) {
            mLastDataCallResponseList = dataCallList;
            mLastDataCallResponseList =
                    dataCallList != null ? dataCallList : Collections.EMPTY_LIST;
            mDataCallListChangedRegistrants.notifyRegistrants(
                    new AsyncResult(null, dataCallList, null));
        }