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

Commit ba329c1f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11406759 from 5936ad79 to 24Q2-release

Change-Id: I123b6a9b6e2203b385927391d5fe2b062a19f9d2
parents 628972a8 5936ad79
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -550,7 +550,7 @@ public class GsmCdmaPhone extends Phone {
            mIdentifierDisclosureNotifier =
                    mTelephonyComponentFactory
                            .inject(CellularIdentifierDisclosureNotifier.class.getName())
                            .makeIdentifierDisclosureNotifier();
                            .makeIdentifierDisclosureNotifier(mSafetySource);
            mCi.registerForCellularIdentifierDisclosures(
                    this, EVENT_CELL_IDENTIFIER_DISCLOSURE, null);
        }
@@ -3745,7 +3745,7 @@ public class GsmCdmaPhone extends Phone {
                if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()
                        && mIdentifierDisclosureNotifier != null
                        && disclosure != null) {
                    mIdentifierDisclosureNotifier.addDisclosure(getSubId(), disclosure);
                    mIdentifierDisclosureNotifier.addDisclosure(mContext, getSubId(), disclosure);
                }
                break;

@@ -5389,9 +5389,9 @@ public class GsmCdmaPhone extends Phone {
        // flag is enabled.
        if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()) {
            if (prefEnabled) {
            mIdentifierDisclosureNotifier.enable();
                mIdentifierDisclosureNotifier.enable(mContext);
            } else {
            mIdentifierDisclosureNotifier.disable();
                mIdentifierDisclosureNotifier.disable(mContext);
            }
        } else {
            logi("Not toggling enable state for disclosure notifier. Feature flag "
+4 −1
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@ public class SimResponse extends IRadioSimResponse.Stub {
            android.hardware.radio.sim.CarrierRestrictions carrierRestrictions,
            int multiSimPolicy) {
        RILRequest rr = mRil.processResponse(HAL_SERVICE_SIM, responseInfo);
        boolean carrierLockInfoSupported = mRil.getHalVersion(HAL_SERVICE_SIM).greater(
                RIL.RADIO_HAL_VERSION_2_2);
        if (rr == null) {
            return;
        }
@@ -132,7 +134,8 @@ public class SimResponse extends IRadioSimResponse.Stub {
                RILUtils.convertAidlCarrierInfoList(
                        carrierRestrictions.allowedCarrierInfoList)).setExcludedCarrierInfo(
                RILUtils.convertAidlCarrierInfoList(
                        carrierRestrictions.excludedCarrierInfoList)).build();
                        carrierRestrictions.excludedCarrierInfoList)).setCarrierLockInfoFeature(
                carrierLockInfoSupported).build();
        if (responseInfo.error == RadioError.NONE) {
            RadioResponse.sendMessageResponse(rr.mResult, ret);
        }
+3 −2
Original line number Diff line number Diff line
@@ -583,8 +583,9 @@ public class TelephonyComponentFactory {
    }

    /** Create CellularIdentifierDisclosureNotifier. */
    public CellularIdentifierDisclosureNotifier makeIdentifierDisclosureNotifier() {
        return CellularIdentifierDisclosureNotifier.getInstance();
    public CellularIdentifierDisclosureNotifier makeIdentifierDisclosureNotifier(
            CellularNetworkSecuritySafetySource safetySource) {
        return CellularIdentifierDisclosureNotifier.getInstance(safetySource);
    }

    /** Create NullCipherNotifier. */
+56 −3
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ public class DomainSelectionConnection {
    protected static final int EVENT_QUALIFIED_NETWORKS_CHANGED = 2;
    protected static final int EVENT_SERVICE_CONNECTED = 3;
    protected static final int EVENT_SERVICE_BINDING_TIMEOUT = 4;
    protected static final int EVENT_RESET_NETWORK_SCAN_DONE = 5;
    protected static final int EVENT_LAST = EVENT_RESET_NETWORK_SCAN_DONE;

    private static final int DEFAULT_BIND_RETRY_TIMEOUT_MS = 4 * 1000;

@@ -73,6 +75,7 @@ public class DomainSelectionConnection {
    private static final int STATUS_DOMAIN_SELECTED  = 1 << 1;
    private static final int STATUS_WAIT_BINDING     = 1 << 2;
    private static final int STATUS_WAIT_SCAN_RESULT = 1 << 3;
    private static final int STATUS_WAIT_RESET_SCAN_RESULT = 1 << 4;

    /** Callback to receive responses from DomainSelectionConnection. */
    public interface DomainSelectionConnectionCallback {
@@ -85,6 +88,16 @@ public class DomainSelectionConnection {
        void onSelectionTerminated(@DisconnectCauses int cause);
    }

    private static class ScanRequest {
        final int[] mPreferredNetworks;
        final int mScanType;

        ScanRequest(int[] preferredNetworks, int scanType) {
            mPreferredNetworks = preferredNetworks;
            mScanType = scanType;
        }
    }

    /**
     * A wrapper class for {@link ITransportSelectorCallback} interface.
     */
@@ -166,7 +179,8 @@ public class DomainSelectionConnection {
        @Override
        public void onRequestEmergencyNetworkScan(
                @NonNull @RadioAccessNetworkType int[] preferredNetworks,
                @EmergencyScanType int scanType, @NonNull IWwanSelectorResultCallback cb) {
                @EmergencyScanType int scanType, boolean resetScan,
                @NonNull IWwanSelectorResultCallback cb) {
            synchronized (mLock) {
                if (checkState(STATUS_DISPOSED)) {
                    return;
@@ -176,7 +190,7 @@ public class DomainSelectionConnection {
                mHandler.post(() -> {
                    synchronized (mLock) {
                        DomainSelectionConnection.this.onRequestEmergencyNetworkScan(
                                preferredNetworks, scanType);
                                preferredNetworks, scanType, resetScan);
                    }
                });
            }
@@ -261,6 +275,17 @@ public class DomainSelectionConnection {
                        }
                    }
                    break;
                case EVENT_RESET_NETWORK_SCAN_DONE:
                    synchronized (mLock) {
                        clearState(STATUS_WAIT_RESET_SCAN_RESULT);
                        if (checkState(STATUS_DISPOSED)
                                || (mPendingScanRequest == null)) {
                            return;
                        }
                        onRequestEmergencyNetworkScan(mPendingScanRequest.mPreferredNetworks,
                                mPendingScanRequest.mScanType, false);
                    }
                    break;
                default:
                    loge("handleMessage unexpected msg=" + msg.what);
                    break;
@@ -306,6 +331,8 @@ public class DomainSelectionConnection {

    private @NonNull AndroidFuture<Integer> mOnComplete;

    private @Nullable ScanRequest mPendingScanRequest;

    /**
     * Creates an instance.
     *
@@ -435,10 +462,11 @@ public class DomainSelectionConnection {
     *
     * @param preferredNetworks The ordered list of preferred networks to scan.
     * @param scanType Indicates the scan preference, such as full service or limited service.
     * @param resetScan Indicates that the previous scan result shall be reset before scanning.
     */
    public void onRequestEmergencyNetworkScan(
            @NonNull @RadioAccessNetworkType int[] preferredNetworks,
            @EmergencyScanType int scanType) {
            @EmergencyScanType int scanType, boolean resetScan) {
        // Can be overridden if required

        synchronized (mLock) {
@@ -450,6 +478,29 @@ public class DomainSelectionConnection {
                return;
            }

            if (checkState(STATUS_WAIT_RESET_SCAN_RESULT)) {
                if (mPendingScanRequest != null) {
                    /* Consecutive scan requests without cancellation is not an expected use case.
                     * DomainSelector should cancel the previous request or wait for the result
                     * before requesting a new scan.*/
                    logi("onRequestEmergencyNetworkScan consecutive scan requests");
                    return;
                } else {
                    // The reset has not been completed.
                    // case1) Long delay in cancelEmergencyNetworkScan by modem.
                    // case2) A consecutive scan requests with short interval from DomainSelector.
                    logi("onRequestEmergencyNetworkScan reset not completed");
                }
                mPendingScanRequest = new ScanRequest(preferredNetworks, scanType);
                return;
            } else if (resetScan) {
                setState(STATUS_WAIT_RESET_SCAN_RESULT);
                mPendingScanRequest = new ScanRequest(preferredNetworks, scanType);
                mPhone.cancelEmergencyNetworkScan(resetScan,
                        mHandler.obtainMessage(EVENT_RESET_NETWORK_SCAN_DONE));
                return;
            }

            if (!mRegisteredRegistrant) {
                mPhone.registerForEmergencyNetworkScan(mHandler,
                        EVENT_EMERGENCY_NETWORK_SCAN_RESULT, null);
@@ -457,6 +508,7 @@ public class DomainSelectionConnection {
            }
            setState(STATUS_WAIT_SCAN_RESULT);
            mPhone.triggerEmergencyNetworkScan(preferredNetworks, scanType, null);
            mPendingScanRequest = null;
        }
    }

@@ -492,6 +544,7 @@ public class DomainSelectionConnection {
    }

    private void onCancel(boolean resetScan) {
        mPendingScanRequest = null;
        if (checkState(STATUS_WAIT_SCAN_RESULT)) {
            clearState(STATUS_WAIT_SCAN_RESULT);
            mPhone.cancelEmergencyNetworkScan(resetScan, null);
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public class NormalCallDomainSelectionConnection extends DomainSelectionConnecti
    /** {@inheritDoc} */
    @Override
    public void onRequestEmergencyNetworkScan(@RadioAccessNetworkType int[] preferredNetworks,
            @EmergencyScanType int scanType) {
            @EmergencyScanType int scanType, boolean resetScan) {
        // Not expected with normal calling.
        // Override to prevent abnormal behavior.
    }
Loading