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

Commit c4d1b7ba authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6314400 from 332f3351 to rvc-release

Change-Id: I8660621c586ab778e6d32a01e80830a4a7c27b37
parents 213fc2ed 332f3351
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,11 +25,11 @@ import android.telephony.BarringInfo;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.DisplayInfo;
import android.telephony.PhoneCapability;
import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
import android.telephony.ServiceState;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyRegistryManager;
import android.telephony.data.ApnSetting;
@@ -202,9 +202,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
    }

    @Override
    public void notifyDisplayInfoChanged(Phone sender, DisplayInfo displayInfo) {
    public void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo) {
        mTelephonyRegistryMgr.notifyDisplayInfoChanged(sender.getPhoneId(), sender.getSubId(),
                displayInfo);
                telephonyDisplayInfo);
    }

    @Override
+38 −32
Original line number Diff line number Diff line
@@ -308,10 +308,11 @@ public class DeviceStateMonitor extends Handler {
    }

    /**
     * @return True if signal strength update should be turned on.
     * @return True if signal strength update should be enabled. See details in
     *         android.hardware.radio@1.2::IndicationFilter::SIGNAL_STRENGTH.
     */
    private boolean shouldTurnOnSignalStrength() {
        // We should turn on signal strength update if one of the following condition is true.
    private boolean shouldEnableSignalStrengthReports() {
        // We should enable signal strength update if one of the following condition is true.
        // 1. The device is charging.
        // 2. When the screen is on.
        // 3. Any of system services is registrating to always listen to signal strength changes
@@ -319,49 +320,54 @@ public class DeviceStateMonitor extends Handler {
    }

    /**
     * @return True if full network update should be turned on. When off, only significant changes
     * will trigger the network update unsolicited response.
     * @return True if full network state update should be enabled. When off, only significant
     *         changes will trigger the network update unsolicited response. See details in
     *         android.hardware.radio@1.2::IndicationFilter::FULL_NETWORK_STATE.
     */
    private boolean shouldTurnOnFullNetworkUpdate() {
        return shouldTurnOnHighPowerConsumptionIndications();
    private boolean shouldEnableFullNetworkStateReports() {
        return shouldEnableHighPowerConsumptionIndications();
    }

    /**
     * @return True if data dormancy status update should be turned on.
     * @return True if data call dormancy changed update should be enabled. See details in
     *         android.hardware.radio@1.2::IndicationFilter::DATA_CALL_DORMANCY_CHANGED.
     */
    private boolean shouldTurnOnDormancyUpdate() {
        return shouldTurnOnHighPowerConsumptionIndications();
    private boolean shouldEnableDataCallDormancyChangedReports() {
        return shouldEnableHighPowerConsumptionIndications();
    }

    /**
     * @return True if link capacity estimate update should be turned on.
     * @return True if link capacity estimate update should be enabled. See details in
     *         android.hardware.radio@1.2::IndicationFilter::LINK_CAPACITY_ESTIMATE.
     */
    private boolean shouldTurnOnLinkCapacityEstimate() {
        return shouldTurnOnHighPowerConsumptionIndications();
    private boolean shouldEnableLinkCapacityEstimateReports() {
        return shouldEnableHighPowerConsumptionIndications();
    }

    /**
     * @return True if physical channel config update should be turned on.
     * @return True if physical channel config update should be enabled. See details in
     *         android.hardware.radio@1.2::IndicationFilter::PHYSICAL_CHANNEL_CONFIG.
     */
    private boolean shouldTurnOnPhysicalChannelConfig() {
        return shouldTurnOnHighPowerConsumptionIndications();
    private boolean shouldEnablePhysicalChannelConfigReports() {
        return shouldEnableHighPowerConsumptionIndications();
    }

    /**
     * @return True if BarryingInfo update should be turned on.
     * @return True if barring info update should be enabled. See details in
     *         android.hardware.radio@1.5::IndicationFilter::BARRING_INFO.
     */
    private boolean shouldTurnOnBarringInfo() {
        return shouldTurnOnHighPowerConsumptionIndications();
    private boolean shouldEnableBarringInfoReports() {
        return shouldEnableHighPowerConsumptionIndications();
    }

    /**
     * A common policy to determine if we should turn on necessary indications,
     * A common policy to determine if we should enable the necessary indications update,
     * for power consumption's sake.
     *
     * @return True if the response filter update should be turned on.
     * @return True if the response update should be enabled.
     */
    private boolean shouldTurnOnHighPowerConsumptionIndications() {
        // We should turn on update if one of the following condition is true.
    private boolean shouldEnableHighPowerConsumptionIndications() {
        // We should enable indications reports if one of the following condition is true.
        // 1. The device is charging.
        // 2. When the screen is on.
        // 3. When the tethering is on.
@@ -414,7 +420,7 @@ public class DeviceStateMonitor extends Handler {
     * @param state True if enabled/on, otherwise disabled/off.
     */
    private void onUpdateDeviceState(int eventType, boolean state) {
        final boolean shouldTurnOnBarringInfoOld = shouldTurnOnBarringInfo();
        final boolean shouldEnableBarringInfoReportsOld = shouldEnableBarringInfoReports();
        switch (eventType) {
            case EVENT_SCREEN_STATE_CHANGED:
                if (mIsScreenOn == state) return;
@@ -459,35 +465,35 @@ public class DeviceStateMonitor extends Handler {
        }

        int newFilter = 0;
        if (shouldTurnOnSignalStrength()) {
        if (shouldEnableSignalStrengthReports()) {
            newFilter |= IndicationFilter.SIGNAL_STRENGTH;
        }

        if (shouldTurnOnFullNetworkUpdate()) {
        if (shouldEnableFullNetworkStateReports()) {
            newFilter |= IndicationFilter.FULL_NETWORK_STATE;
        }

        if (shouldTurnOnDormancyUpdate()) {
        if (shouldEnableDataCallDormancyChangedReports()) {
            newFilter |= IndicationFilter.DATA_CALL_DORMANCY_CHANGED;
        }

        if (shouldTurnOnLinkCapacityEstimate()) {
        if (shouldEnableLinkCapacityEstimateReports()) {
            newFilter |= IndicationFilter.LINK_CAPACITY_ESTIMATE;
        }

        if (shouldTurnOnPhysicalChannelConfig()) {
        if (shouldEnablePhysicalChannelConfigReports()) {
            newFilter |= IndicationFilter.PHYSICAL_CHANNEL_CONFIG;
        }

        final boolean shouldTurnOnBarringInfo = shouldTurnOnBarringInfo();
        if (shouldTurnOnBarringInfo) {
        final boolean shouldEnableBarringInfoReports = shouldEnableBarringInfoReports();
        if (shouldEnableBarringInfoReports) {
            newFilter |= IndicationFilter.BARRING_INFO;
        }

        setUnsolResponseFilter(newFilter, false);

        // Pull barring info AFTER setting filter, the order matters
        if (shouldTurnOnBarringInfo && !shouldTurnOnBarringInfoOld) {
        if (shouldEnableBarringInfoReports && !shouldEnableBarringInfoReportsOld) {
            if (DBG) log("Manually pull barring info...", true);
            // use a null message since we don't care of receiving response
            mPhone.mCi.getBarringInfo(null);
+3 −3
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import android.telephony.CarrierRestrictionRules;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.ClientRequestStats;
import android.telephony.DisplayInfo;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.PhoneStateListener;
import android.telephony.PhysicalChannelConfig;
@@ -57,6 +56,7 @@ import android.telephony.RadioAccessSpecifier;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.telephony.data.ApnSetting;
import android.telephony.emergency.EmergencyNumber;
@@ -2416,8 +2416,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    }

    /** Send notification that display info has changed. */
    public void notifyDisplayInfoChanged(DisplayInfo displayInfo) {
        mNotifier.notifyDisplayInfoChanged(this, displayInfo);
    public void notifyDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) {
        mNotifier.notifyDisplayInfoChanged(this, telephonyDisplayInfo);
    }

    public void notifySignalStrength() {
+2 −2
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@ import android.telephony.BarringInfo;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.DisplayInfo;
import android.telephony.PhoneCapability;
import android.telephony.PreciseDataConnectionState;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.ims.ImsReasonInfo;

@@ -88,7 +88,7 @@ public interface PhoneNotifier {
    void notifyUserMobileDataStateChanged(Phone sender, boolean state);

    /** Send a notification that the display info has changed */
    void notifyDisplayInfoChanged(Phone sender, DisplayInfo displayInfo);
    void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo);

    /** Send a notification that the phone capability has changed */
    void notifyPhoneCapabilityChanged(PhoneCapability capability);
+5 −5
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ public class SubscriptionController extends ISub.Stub {
        int nameSource = cursor.getInt(cursor.getColumnIndexOrThrow(
                SubscriptionManager.NAME_SOURCE));
        int iconTint = cursor.getInt(cursor.getColumnIndexOrThrow(
                SubscriptionManager.COLOR));
                SubscriptionManager.HUE));
        String number = cursor.getString(cursor.getColumnIndexOrThrow(
                SubscriptionManager.NUMBER));
        int dataRoaming = cursor.getInt(cursor.getColumnIndexOrThrow(
@@ -1454,7 +1454,7 @@ public class SubscriptionController extends ISub.Stub {
        value.put(SubscriptionManager.ICC_ID, uniqueId);
        int color = getUnusedColor(mContext.getOpPackageName(), mContext.getAttributionTag());
        // default SIM color differs between slots
        value.put(SubscriptionManager.COLOR, color);
        value.put(SubscriptionManager.HUE, color);
        value.put(SubscriptionManager.SIM_SLOT_INDEX, slotIndex);
        value.put(SubscriptionManager.CARRIER_NAME, "");
        value.put(SubscriptionManager.CARD_ID, uniqueId);
@@ -1571,7 +1571,7 @@ public class SubscriptionController extends ISub.Stub {
        try {
            validateSubId(subId);
            ContentValues value = new ContentValues(1);
            value.put(SubscriptionManager.COLOR, tint);
            value.put(SubscriptionManager.HUE, tint);
            if (DBG) logd("[setIconTint]- tint:" + tint + " set");

            int result = mContext.getContentResolver().update(
@@ -1596,7 +1596,7 @@ public class SubscriptionController extends ISub.Stub {
     */
    public static int getNameSourcePriority(@SimDisplayNameSource int nameSource) {
        int index = Arrays.asList(
                SubscriptionManager.NAME_SOURCE_DEFAULT,
                SubscriptionManager.NAME_SOURCE_CARRIER_ID,
                SubscriptionManager.NAME_SOURCE_SIM_PNN,
                SubscriptionManager.NAME_SOURCE_SIM_SPN,
                SubscriptionManager.NAME_SOURCE_CARRIER,
@@ -1657,7 +1657,7 @@ public class SubscriptionController extends ISub.Stub {
            }
            ContentValues value = new ContentValues(1);
            value.put(SubscriptionManager.DISPLAY_NAME, nameToSet);
            if (nameSource >= SubscriptionManager.NAME_SOURCE_DEFAULT) {
            if (nameSource >= SubscriptionManager.NAME_SOURCE_CARRIER_ID) {
                if (DBG) logd("Set nameSource=" + nameSource);
                value.put(SubscriptionManager.NAME_SOURCE, nameSource);
            }
Loading