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

Commit a333194d authored by Jack Yu's avatar Jack Yu Committed by Gerrit Code Review
Browse files

Merge "Stop exposing reasons through phone state listener"

parents 8ef74332 9e9e8dc8
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -153,12 +153,12 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
    }

    @Override
    public void notifyDataConnection(Phone sender, String reason, String apnType,
    public void notifyDataConnection(Phone sender, String apnType,
                                     PhoneConstants.DataState state) {
        doNotifyDataConnection(sender, reason, apnType, state);
        doNotifyDataConnection(sender, apnType, state);
    }

    private void doNotifyDataConnection(Phone sender, String reason, String apnType,
    private void doNotifyDataConnection(Phone sender, String apnType,
                                        PhoneConstants.DataState state) {
        int subId = sender.getSubId();
        long dds = SubscriptionManager.getDefaultDataSubscriptionId();
@@ -184,7 +184,6 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
                mRegistry.notifyDataConnectionForSubscriber(subId,
                    PhoneConstantConversions.convertDataState(state),
                        sender.isDataAllowed(ApnSetting.getApnTypesBitmaskFromString(apnType)),
                        reason,
                        sender.getActiveApnHost(apnType),
                        apnType,
                        linkProperties,
@@ -198,11 +197,11 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
    }

    @Override
    public void notifyDataConnectionFailed(Phone sender, String reason, String apnType) {
    public void notifyDataConnectionFailed(Phone sender, String apnType) {
        int subId = sender.getSubId();
        try {
            if (mRegistry != null) {
                mRegistry.notifyDataConnectionFailedForSubscriber(subId, reason, apnType);
                mRegistry.notifyDataConnectionFailedForSubscriber(subId, apnType);
            }
        } catch (RemoteException ex) {
            // system process is dead
@@ -286,11 +285,11 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
        }
    }

    public void notifyPreciseDataConnectionFailed(Phone sender, String reason, String apnType,
    public void notifyPreciseDataConnectionFailed(Phone sender, String apnType,
            String apn, String failCause) {
        // FIXME: subId?
        try {
            mRegistry.notifyPreciseDataConnectionFailed(reason, apnType, apn, failCause);
            mRegistry.notifyPreciseDataConnectionFailed(apnType, apn, failCause);
        } catch (RemoteException ex) {
            // system process is dead
        }
+10 −11
Original line number Diff line number Diff line
@@ -2207,20 +2207,19 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mNotifier.notifyMessageWaitingChanged(this);
    }

    public void notifyDataConnection(String reason, String apnType,
            PhoneConstants.DataState state) {
        mNotifier.notifyDataConnection(this, reason, apnType, state);
    public void notifyDataConnection(String apnType, PhoneConstants.DataState state) {
        mNotifier.notifyDataConnection(this, apnType, state);
    }

    public void notifyDataConnection(String reason, String apnType) {
        mNotifier.notifyDataConnection(this, reason, apnType, getDataConnectionState(apnType));
    public void notifyDataConnection(String apnType) {
        mNotifier.notifyDataConnection(this, apnType, getDataConnectionState(apnType));
    }

    public void notifyDataConnection(String reason) {
    public void notifyDataConnection() {
        String types[] = getActiveApnTypes();
        if (types != null) {
            for (String apnType : types) {
                mNotifier.notifyDataConnection(this, reason, apnType,
                mNotifier.notifyDataConnection(this, apnType,
                        getDataConnectionState(apnType));
            }
        }
@@ -3092,13 +3091,13 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    public void notifyCallForwardingIndicator() {
    }

    public void notifyDataConnectionFailed(String reason, String apnType) {
        mNotifier.notifyDataConnectionFailed(this, reason, apnType);
    public void notifyDataConnectionFailed(String apnType) {
        mNotifier.notifyDataConnectionFailed(this, apnType);
    }

    public void notifyPreciseDataConnectionFailed(String reason, String apnType, String apn,
    public void notifyPreciseDataConnectionFailed(String apnType, String apn,
            String failCause) {
        mNotifier.notifyPreciseDataConnectionFailed(this, reason, apnType, apn, failCause);
        mNotifier.notifyPreciseDataConnectionFailed(this, apnType, apn, failCause);
    }

    /**
+14 −16
Original line number Diff line number Diff line
@@ -29,40 +29,38 @@ import java.util.List;
 */
public interface PhoneNotifier {

    public void notifyPhoneState(Phone sender);
    void notifyPhoneState(Phone sender);

    public void notifyServiceState(Phone sender);
    void notifyServiceState(Phone sender);

    /** Notify registrants of the current CellLocation */
    void notifyCellLocation(Phone sender, CellLocation cl);

    public void notifySignalStrength(Phone sender);
    void notifySignalStrength(Phone sender);

    public void notifyMessageWaitingChanged(Phone sender);
    void notifyMessageWaitingChanged(Phone sender);

    public void notifyCallForwardingChanged(Phone sender);
    void notifyCallForwardingChanged(Phone sender);

    /** TODO - reason should never be null */
    public void notifyDataConnection(Phone sender, String reason, String apnType,
            PhoneConstants.DataState state);
    void notifyDataConnection(Phone sender, String apnType, PhoneConstants.DataState state);

    public void notifyDataConnectionFailed(Phone sender, String reason, String apnType);
    void notifyDataConnectionFailed(Phone sender, String apnType);

    public void notifyDataActivity(Phone sender);
    void notifyDataActivity(Phone sender);

    public void notifyOtaspChanged(Phone sender, int otaspMode);
    void notifyOtaspChanged(Phone sender, int otaspMode);

    public void notifyCellInfo(Phone sender, List<CellInfo> cellInfo);
    void notifyCellInfo(Phone sender, List<CellInfo> cellInfo);

    /** Notify of change to PhysicalChannelConfiguration. */
    void notifyPhysicalChannelConfiguration(Phone sender, List<PhysicalChannelConfig> configs);

    public void notifyPreciseCallState(Phone sender);
    void notifyPreciseCallState(Phone sender);

    public void notifyDisconnectCause(int cause, int preciseCause);
    void notifyDisconnectCause(int cause, int preciseCause);

    public void notifyPreciseDataConnectionFailed(Phone sender, String reason, String apnType,
            String apn, String failCause);
    void notifyPreciseDataConnectionFailed(Phone sender, String apnType, String apn,
                                                  String failCause);

    /** send a notification that the SRVCC state has changed.*/
    void notifySrvccStateChanged(Phone sender, @TelephonyManager.SrvccState int state);
+2 −8
Original line number Diff line number Diff line
@@ -3062,7 +3062,7 @@ public class ServiceStateTracker extends Handler {
            }

            if (hasCssIndicatorChanged) {
                mPhone.notifyDataConnection(Phone.REASON_CSS_INDICATOR_CHANGED);
                mPhone.notifyDataConnection();
            }

            mReasonDataDenied = mNewReasonDataDenied;
@@ -3199,13 +3199,7 @@ public class ServiceStateTracker extends Handler {

        if (hasDataRegStateChanged || hasRilDataRadioTechnologyChanged) {
            notifyDataRegStateRilRadioTechnologyChanged();

            if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
                    == mSS.getRilDataRadioTechnology()) {
                mPhone.notifyDataConnection(Phone.REASON_IWLAN_AVAILABLE);
            } else {
                mPhone.notifyDataConnection(null);
            }
            mPhone.notifyDataConnection();
        }

        if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) {
+1 −4
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.telephony.data.DataCallResponse;

import com.android.internal.telephony.DctConstants;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.dataconnection.DataConnection.UpdateLinkPropertyResult;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
@@ -395,9 +394,7 @@ public class DcController extends StateMachine {
                                        if (DBG) log("onDataStateChanged: simple change");

                                        for (ApnContext apnContext : apnContexts) {
                                             mPhone.notifyDataConnection(
                                                 PhoneConstants.REASON_LINK_PROPERTIES_CHANGED,
                                                 apnContext.getApnType());
                                            mPhone.notifyDataConnection(apnContext.getApnType());
                                        }
                                    }
                                } else {
Loading