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

Commit 7a4618ef authored by Chen Xu's avatar Chen Xu Committed by android-build-merger
Browse files

Merge "add registrant for PhysicalChannelConfig change"

am: db3d3d8b

Change-Id: I2b8a8dc68d1ea2c463e3aaa0fcc023052b780b14
parents a44fe815 db3d3d8b
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.telephony.CallQuality;
import android.telephony.CellInfo;
import android.telephony.CellLocation;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
import android.telephony.PreciseCallState;
import android.telephony.Rlog;
import android.telephony.ServiceState;
@@ -195,20 +194,6 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
        mTelephonyRegistryMgr.notifyCellInfoChanged(subId, cellInfo);
    }

    @Override
    public void notifyPhysicalChannelConfiguration(Phone sender,
        List<PhysicalChannelConfig> configs) {
        int subId = sender.getSubId();
        int phoneId = sender.getPhoneId();
        try {
            if (mRegistry != null) {
                mRegistry.notifyPhysicalChannelConfigurationForSubscriber(phoneId, subId, configs);
            }
        } catch (RemoteException ex) {
            // system process is dead
        }
    }

    @Override
    public void notifyOtaspChanged(Phone sender, int otaspMode) {
        int subId = sender.getSubId();
+6 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import android.telephony.CellLocation;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.NetworkScanRequest;
import android.telephony.PhoneNumberUtils;
import android.telephony.PhysicalChannelConfig;
import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.telephony.SignalThresholdInfo;
@@ -4080,4 +4081,9 @@ public class GsmCdmaPhone extends Phone {
    public boolean canDisablePhysicalSubscription() {
        return mCi.canToggleUiccApplicationsEnablement();
    }

    @Override
    public List<PhysicalChannelConfig> getPhysicalChannelConfigList() {
        return mSST.getPhysicalChannelConfigList();
    }
}
+28 −1
Original line number Diff line number Diff line
@@ -354,6 +354,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {

    private final RegistrantList mRedialRegistrants = new RegistrantList();

    private final RegistrantList mPhysicalChannelConfigRegistrants = new RegistrantList();

    protected Registrant mPostDialHandler;

    protected final LocalLog mLocalLog;
@@ -2388,9 +2390,34 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mNotifier.notifyCellInfo(this, cellInfo);
    }

    /**
     * Registration point for PhysicalChannelConfig change.
     * @param h handler to notify
     * @param what what code of message when delivered
     * @param obj placed in Message.obj.userObj
     */
    public void registerForPhysicalChannelConfig(Handler h, int what, Object obj) {
        checkCorrectThread(h);
        Registrant registrant = new Registrant(h, what, obj);
        mPhysicalChannelConfigRegistrants.add(registrant);
        // notify first
        List<PhysicalChannelConfig> physicalChannelConfigs = getPhysicalChannelConfigList();
        if (physicalChannelConfigs != null) {
            registrant.notifyRegistrant(new AsyncResult(null, physicalChannelConfigs, null));
        }
    }

    public void unregisterForPhysicalChannelConfig(Handler h) {
        mPhysicalChannelConfigRegistrants.remove(h);
    }

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

    public List<PhysicalChannelConfig> getPhysicalChannelConfigList() {
        return null;
    }

    /**
+0 −4
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.telephony.CallQuality;
import android.telephony.CellInfo;
import android.telephony.CellLocation;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.ims.ImsReasonInfo;

@@ -60,9 +59,6 @@ public interface PhoneNotifier {

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

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

    void notifyPreciseCallState(Phone sender);

    void notifyDisconnectCause(Phone sender, int cause, int preciseCause);
+4 −0
Original line number Diff line number Diff line
@@ -816,6 +816,10 @@ public class ServiceStateTracker extends Handler {
    }
    public boolean getPowerStateFromCarrier() { return !mRadioDisabledByCarrier; }

    public List<PhysicalChannelConfig> getPhysicalChannelConfigList() {
        return mLastPhysicalChannelConfigList;
    }

    private SignalStrength mLastSignalStrength = null;
    @UnsupportedAppUsage
    protected boolean notifySignalStrength() {
Loading