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

Commit 239b8158 authored by Xin Li's avatar Xin Li
Browse files

Merge pi-dev-plus-aosp-without-vendor into stage-dr1-aosp-master

Bug: 111615259
Change-Id: I2ec5fa66768ceaffac7d8befb3afa717e51cb1a6
parents dfc8e7fb fb1320ab
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -122,6 +122,13 @@ public class SubscriptionInfoUpdater extends Handler {

    public SubscriptionInfoUpdater(
            Looper looper, Context context, Phone[] phone, CommandsInterface[] ci) {
        this(looper, context, phone, ci,
                IPackageManager.Stub.asInterface(ServiceManager.getService("package")));
    }

    @VisibleForTesting public SubscriptionInfoUpdater(
            Looper looper, Context context, Phone[] phone,
            CommandsInterface[] ci, IPackageManager packageMgr) {
        super(looper);
        logd("Constructor invoked");

@@ -129,7 +136,7 @@ public class SubscriptionInfoUpdater extends Handler {
        mPhone = phone;
        mSubscriptionManager = SubscriptionManager.from(mContext);
        mEuiccManager = (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE);
        mPackageManager = IPackageManager.Stub.asInterface(ServiceManager.getService("package"));
        mPackageManager = packageMgr;

        mCarrierServiceBindHelper = new CarrierServiceBindHelper(mContext);
        initializeCarrierApps();
+0 −11
Original line number Diff line number Diff line
@@ -1131,17 +1131,6 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
        }
    }

    /**
     * @return true if the ImsResolver is in the process of resolving a dynamic query and should not
     * be considered available, false if the ImsResolver is idle.
     */
    public boolean isResolvingBinding() {
        return mHandler.hasMessages(HANDLER_START_DYNAMIC_FEATURE_QUERY)
                // We haven't processed this message yet, so it is still resolving.
                || mHandler.hasMessages(HANDLER_DYNAMIC_FEATURE_CHANGE)
                || mFeatureQueryManager.isQueryInProgress();
    }

    private String printFeatures(Set<ImsFeatureConfiguration.FeatureSlotPair> features) {
        StringBuilder featureString = new StringBuilder();
        featureString.append("features: [");
+21 −8
Original line number Diff line number Diff line
@@ -458,6 +458,9 @@ public class ImsPhoneConnection extends Connection implements
                Rlog.d(LOG_TAG, "onDisconnect: no parent");
            }
            synchronized (this) {
                if (mRttTextHandler != null) {
                    mRttTextHandler.tearDown();
                }
                if (mImsCall != null) mImsCall.close();
                mImsCall = null;
            }
@@ -973,9 +976,12 @@ public class ImsPhoneConnection extends Connection implements
    }

    public void sendRttModifyRequest(android.telecom.Connection.RttTextStream textStream) {
        ImsCall imsCall = getImsCall();
        if (imsCall != null) {
            getImsCall().sendRttModifyRequest();
            setCurrentRttTextStream(textStream);
        }
    }

    /**
     * Sends the user's response to a remotely-issued RTT upgrade request
@@ -987,6 +993,7 @@ public class ImsPhoneConnection extends Connection implements
        boolean accept = textStream != null;
        ImsCall imsCall = getImsCall();

        if (imsCall != null) {
            imsCall.sendRttModifyResponse(accept);
            if (accept) {
                setCurrentRttTextStream(textStream);
@@ -994,6 +1001,7 @@ public class ImsPhoneConnection extends Connection implements
                Rlog.e(LOG_TAG, "sendRttModifyResponse: foreground call has no connections");
            }
        }
    }

    public void onRttMessageReceived(String message) {
        synchronized (this) {
@@ -1046,7 +1054,12 @@ public class ImsPhoneConnection extends Connection implements
    // Make sure to synchronize on ImsPhoneConnection.this before calling.
    private void createRttTextHandler() {
        mRttTextHandler = new ImsRttTextHandler(Looper.getMainLooper(),
                (message) -> getImsCall().sendRttMessage(message));
                (message) -> {
                    ImsCall imsCall = getImsCall();
                    if (imsCall != null) {
                        imsCall.sendRttMessage(message);
                    }
                });
        mRttTextHandler.initialize(mRttTextStream);
    }

+9 −7
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.telephony.Rlog;
import com.android.internal.annotations.VisibleForTesting;

import java.io.IOException;
import java.nio.channels.ClosedByInterruptException;
import java.util.concurrent.CountDownLatch;

public class ImsRttTextHandler extends Handler {
@@ -79,17 +80,16 @@ public class ImsRttTextHandler extends Handler {
                String charsReceived;
                try {
                    charsReceived = mReaderThreadRttTextStream.read();
                } catch (ClosedByInterruptException e) {
                    Rlog.i(LOG_TAG, "RttReaderThread - Thread interrupted. Finishing.");
                    break;
                } catch (IOException e) {
                    Rlog.e(LOG_TAG, "RttReaderThread - IOException encountered " +
                            "reading from in-call: %s", e);
                            "reading from in-call: ", e);
                    obtainMessage(TEARDOWN).sendToTarget();
                    break;
                }
                if (charsReceived == null) {
                    if (Thread.currentThread().isInterrupted()) {
                        Rlog.i(LOG_TAG, "RttReaderThread - Thread interrupted. Finishing.");
                        break;
                    }
                    Rlog.e(LOG_TAG, "RttReaderThread - Stream closed unexpectedly. Attempt to " +
                            "reinitialize.");
                    obtainMessage(TEARDOWN).sendToTarget();
@@ -145,7 +145,7 @@ public class ImsRttTextHandler extends Handler {
                int numCodepointsBuffered = mBufferedTextToNetwork
                        .codePointCount(0, mBufferedTextToNetwork.length());
                if (numCodepointsBuffered >= MAX_BUFFERED_CHARACTER_COUNT) {
                    sendMessageAtFrontOfQueue(obtainMessage(ATTEMPT_SEND_TO_NETWORK));
                    sendMessage(obtainMessage(ATTEMPT_SEND_TO_NETWORK));
                } else {
                    sendEmptyMessageDelayed(
                            ATTEMPT_SEND_TO_NETWORK, MAX_BUFFERING_DELAY_MILLIS);
@@ -175,12 +175,13 @@ public class ImsRttTextHandler extends Handler {
            case EXPIRE_SENT_CODEPOINT_COUNT:
                mCodepointsAvailableForTransmission += msg.arg1;
                if (mCodepointsAvailableForTransmission > 0) {
                    sendMessageAtFrontOfQueue(obtainMessage(ATTEMPT_SEND_TO_NETWORK));
                    sendMessage(obtainMessage(ATTEMPT_SEND_TO_NETWORK));
                }
                break;
            case TEARDOWN:
                try {
                    if (mReaderThread != null) {
                        mReaderThread.interrupt();
                        mReaderThread.join(1000);
                    }
                } catch (InterruptedException e) {
@@ -202,6 +203,7 @@ public class ImsRttTextHandler extends Handler {
    }

    public void initialize(Connection.RttTextStream rttTextStream) {
        Rlog.i(LOG_TAG, "Initializing: " + this);
        obtainMessage(INITIALIZE, rttTextStream).sendToTarget();
    }

+12 −0
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ public class UiccCardApplication {
    private boolean       mDesiredFdnEnabled;
    private boolean       mIccLockEnabled;
    private boolean       mDesiredPinLocked;

    // App state will be ignored while deciding whether the card is ready or not.
    private boolean       mIgnoreApp;
    private boolean       mIccFdnAvailable = true; // Default is enabled.

    private CommandsInterface mCi;
@@ -101,6 +104,7 @@ public class UiccCardApplication {
        mPin1Replaced = (as.pin1_replaced != 0);
        mPin1State = as.pin1;
        mPin2State = as.pin2;
        mIgnoreApp = false;

        mContext = c;
        mCi = ci;
@@ -874,6 +878,14 @@ public class UiccCardApplication {
        return mUiccProfile.getPhoneId();
    }

    public boolean isAppIgnored() {
        return mIgnoreApp;
    }

    public void setAppIgnoreState(boolean ignore) {
        mIgnoreApp = ignore;
    }

    protected UiccProfile getUiccProfile() {
        return mUiccProfile;
    }
Loading