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

Commit cc30ec73 authored by Zoey Chen's avatar Zoey Chen Committed by Automerger Merge Worker
Browse files

Merge "[Telephony] PhoneStateListener redesign" am: 9c18ff8a am: 888f0fd9

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1519463

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifce0d04dc09cf496a97c11800024312b1c316dfb
parents ffd2d173 888f0fd9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
import android.telephony.ServiceState;
@@ -235,6 +236,13 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
                barringInfo);
    }

    @Override
    public void notifyPhysicalChannelConfig(Phone sender,
                                                   List<PhysicalChannelConfig> configs) {
        int subId = sender.getSubId();
        mTelephonyRegistryMgr.notifyPhysicalChannelConfigForSubscriber(subId, configs);
    }

    /**
     * Convert the {@link DataActivityState} enum into the TelephonyManager.DATA_* constants for the
     * public API.
+2 −1
Original line number Diff line number Diff line
@@ -2690,8 +2690,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    }

    /** Notify {@link PhysicalChannelConfig} changes. */
    public void notifyPhysicalChannelConfiguration(List<PhysicalChannelConfig> configs) {
    public void notifyPhysicalChannelConfig(List<PhysicalChannelConfig> configs) {
        mPhysicalChannelConfigRegistrants.notifyRegistrants(new AsyncResult(null, configs, null));
        mNotifier.notifyPhysicalChannelConfig(this, configs);
    }

    public List<PhysicalChannelConfig> getPhysicalChannelConfigList() {
+4 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
import android.telephony.PreciseDataConnectionState;
import android.telephony.ServiceState;
import android.telephony.TelephonyDisplayInfo;
@@ -116,4 +117,7 @@ public interface PhoneNotifier {

    /** Notify barring info has changed */
    void notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo);

    /** Notify of change to PhysicalChannelConfig. */
    void notifyPhysicalChannelConfig(Phone sender, List<PhysicalChannelConfig> configs);
}
+2 −2
Original line number Diff line number Diff line
@@ -1702,7 +1702,7 @@ public class ServiceStateTracker extends Handler {
                        log("EVENT_PHYSICAL_CHANNEL_CONFIG: size=" + list.size() + " list="
                                + list);
                    }
                    mPhone.notifyPhysicalChannelConfiguration(list);
                    mPhone.notifyPhysicalChannelConfig(list);
                    mLastPhysicalChannelConfigList = list;
                    boolean hasChanged = false;
                    if (updateNrStateFromPhysicalChannelConfigs(list, mSS)) {
@@ -2153,7 +2153,7 @@ public class ServiceStateTracker extends Handler {
    }

    private boolean isNrPhysicalChannelConfig(PhysicalChannelConfig config) {
        return config.getRat() == TelephonyManager.NETWORK_TYPE_NR;
        return config.getNetworkType() == TelephonyManager.NETWORK_TYPE_NR;
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class PhysicalChannelConfigTest {
                .setPhysicalCellId(PHYSICAL_CELL_ID)
                .build();

        assertThat(config.getRat()).isEqualTo(RAT);
        assertThat(config.getNetworkType()).isEqualTo(RAT);
        assertThat(config.getConnectionStatus()).isEqualTo(CONNECTION_STATUS);
        assertThat(config.getCellBandwidthDownlink()).isEqualTo(CELL_BANDWIDTH);
        assertThat(config.getFrequencyRange()).isEqualTo(FREQUENCY_RANGE);
Loading