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

Commit a93d8cf1 authored by Nagendra Prasad Nagarle Basavaraju's avatar Nagendra Prasad Nagarle Basavaraju Committed by Automerger Merge Worker
Browse files

[Telephony Fix] ServiceStateTracker fails to update the DB am: eae728cf

parents 3258c1f3 eae728cf
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -405,6 +405,11 @@ public class ServiceStateTracker extends Handler {
                    // state in case our service state was never broadcasted (we don't notify
                    // service states when the subId is invalid)
                    mPhone.notifyServiceStateChanged(mPhone.getServiceState());
                    // On SubscriptionId changed from invalid  to valid sub id, create
                    // ServiceStateProvider with valid sub id entry. Note: PollStateDone can update
                    // the DB again,for the SubID with any change detected at poll state request
                    log("Update SS information on moving from invalid to valid sub id");
                    updateServiceStateToDb(mPhone.getServiceState());
                }

                boolean restoreSelection = !context.getResources().getBoolean(
@@ -3803,10 +3808,7 @@ public class ServiceStateTracker extends Handler {
                mPhone.notifyServiceStateChanged(mPhone.getServiceState());
            }

            // insert into ServiceStateProvider. This will trigger apps to wake through JobScheduler
            mPhone.getContext().getContentResolver()
                    .insert(getUriForSubscriptionId(mPhone.getSubId()),
                            getContentValuesForServiceState(mSS));
            updateServiceStateToDb(mPhone.getServiceState());

            TelephonyMetrics.getInstance().writeServiceStateChanged(mPhone.getPhoneId(), mSS);
            mPhone.getVoiceCallSessionStats().onServiceStateChanged(mSS);
@@ -3936,6 +3938,16 @@ public class ServiceStateTracker extends Handler {
        }
    }

    /**
     * Insert SS information into ServiceStateProvider DB table for a sub id.
     * This will trigger apps to wake through JobScheduler
     */
    private void updateServiceStateToDb(ServiceState serviceState) {
        mPhone.getContext().getContentResolver()
                .insert(getUriForSubscriptionId(mPhone.getSubId()),
                        getContentValuesForServiceState(serviceState));
    }

    private String getOperatorNameFromEri() {
        String eriText = null;
        if (mPhone.isPhoneTypeCdma()) {