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

Commit d3039f1f authored by Zoey Chen's avatar Zoey Chen Committed by Android (Google) Code Review
Browse files

Merge "[Telephony] Notify onDataEnabled"

parents c50e1508 02307b89
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.telephony.PreciseDataConnectionState;
import android.telephony.ServiceState;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager.DataEnabledReason;
import android.telephony.TelephonyRegistryManager;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.ims.ImsReasonInfo;
@@ -243,6 +244,11 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
        mTelephonyRegistryMgr.notifyPhysicalChannelConfigForSubscriber(subId, configs);
    }

    @Override
    public void notifyDataEnabled(boolean enabled, @DataEnabledReason int reason) {
        mTelephonyRegistryMgr.notifyDataEnabled(enabled, reason);
    }

    /**
     * Convert the {@link DataActivityState} enum into the TelephonyManager.DATA_* constants for the
     * public API.
+6 −0
Original line number Diff line number Diff line
@@ -2706,6 +2706,12 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mNotifier.notifyOutgoingEmergencySms(this, emergencyNumber);
    }

    /** Notify the data enabled changes. */
    public void notifyDataEnabled(boolean enabled,
            @TelephonyManager.DataEnabledReason int reason) {
        mNotifier.notifyDataEnabled(enabled, reason);
    }

    /**
     * @return true if a mobile originating emergency call is active
     */
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.telephony.PhysicalChannelConfig;
import android.telephony.PreciseDataConnectionState;
import android.telephony.ServiceState;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager.DataEnabledReason;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.ims.ImsReasonInfo;

@@ -121,4 +122,7 @@ public interface PhoneNotifier {
    /** Notify of change to PhysicalChannelConfig. */
    void notifyPhysicalChannelConfig(Phone sender, List<PhysicalChannelConfig> configs);

    /** Notify DataEnabled has changed. */
    void notifyDataEnabled(boolean enabled, @DataEnabledReason int reason);

}
+1 −0
Original line number Diff line number Diff line
@@ -494,6 +494,7 @@ public class DataEnabledSettings {

    private void notifyDataEnabledChanged(boolean enabled, int reason) {
        mOverallDataEnabledChangedRegistrants.notifyResult(new Pair<>(enabled, reason));
        mPhone.notifyDataEnabled(enabled, reason);
    }

    public void registerForDataEnabledChanged(Handler h, int what, Object obj) {