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

Commit ba658c94 authored by Brad Ebinger's avatar Brad Ebinger Committed by Automerger Merge Worker
Browse files

When the associated subId indication comes in, do not destroy UCE am: e9a8f9ff

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/net/ims/+/1622044

Change-Id: I1574c3588e4d72b3924c396afe43e1a7a8f99454
parents 532570cd e9a8f9ff
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -206,12 +206,12 @@ public class RcsFeatureManager implements FeatureUpdates {
    /**
     * Update the capabilities for this RcsFeature.
     */
    public void updateCapabilities() throws android.telephony.ims.ImsException {
        boolean optionsSupport = isOptionsSupported();
        boolean presenceSupported = isPresenceSupported();
    public void updateCapabilities(int newSubId) throws android.telephony.ims.ImsException {
        boolean optionsSupport = isOptionsSupported(newSubId);
        boolean presenceSupported = isPresenceSupported(newSubId);

        logi("Update capabilities for slot " + mSlotId + ": options=" + optionsSupport
                + ", presence=" + presenceSupported);
        logi("Update capabilities for slot " + mSlotId + " and sub " + newSubId + ": options="
                + optionsSupport+ ", presence=" + presenceSupported);

        if (optionsSupport || presenceSupported) {
            CapabilityChangeRequest request = new CapabilityChangeRequest();
@@ -458,36 +458,35 @@ public class RcsFeatureManager implements FeatureUpdates {
        }
    }

    private boolean isOptionsSupported() {
        return isCapabilityTypeSupported(mContext, mSlotId, CAPABILITY_OPTIONS);
    private boolean isOptionsSupported(int subId) {
        return isCapabilityTypeSupported(mContext, subId, CAPABILITY_OPTIONS);
    }

    private boolean isPresenceSupported() {
        return isCapabilityTypeSupported(mContext, mSlotId, CAPABILITY_PRESENCE);
    private boolean isPresenceSupported(int subId) {
        return isCapabilityTypeSupported(mContext, subId, CAPABILITY_PRESENCE);
    }

    /*
     * Check if the given type of capability is supported.
     */
    private static boolean isCapabilityTypeSupported(
        Context context, int slotId, int capabilityType) {
        Context context, int subId, int capabilityType) {

        int subId = sSubscriptionManagerProxy.getSubId(slotId);
        if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
            Log.e(TAG, "isCapabilityTypeSupported: Getting subIds is failure! slotId=" + slotId);
            Log.e(TAG, "isCapabilityTypeSupported: Invalid subId=" + subId);
            return false;
        }

        CarrierConfigManager configManager =
            (CarrierConfigManager) context.getSystemService(Context.CARRIER_CONFIG_SERVICE);
        if (configManager == null) {
            Log.e(TAG, "isCapabilityTypeSupported: CarrierConfigManager is null, " + slotId);
            Log.e(TAG, "isCapabilityTypeSupported: CarrierConfigManager is null, " + subId);
            return false;
        }

        PersistableBundle b = configManager.getConfigForSubId(subId);
        if (b == null) {
            Log.e(TAG, "isCapabilityTypeSupported: PersistableBundle is null, " + slotId);
            Log.e(TAG, "isCapabilityTypeSupported: PersistableBundle is null, " + subId);
            return false;
        }

+5 −0
Original line number Diff line number Diff line
@@ -36,4 +36,9 @@ public interface ControllerBase {
     * Notify to destroy this instance. The UceController instance is unusable after destroyed.
     */
    void onDestroy();

    /**
     * Notify the controller that the Carrier Config has changed.
     */
    void onCarrierConfigChanged();
}
+10 −0
Original line number Diff line number Diff line
@@ -301,6 +301,16 @@ public class UceController {
        mLooper.quit();
    }

    /**
     * Notify all associated classes that the carrier configuration has changed for the subId.
     */
    public void onCarrierConfigChanged() {
        mEabController.onCarrierConfigChanged();
        mPublishController.onCarrierConfigChanged();
        mSubscribeController.onCarrierConfigChanged();
        mOptionsController.onCarrierConfigChanged();
    }

    /*
     * The implementation of the interface UceControllerCallback. These methods are called by other
     * controllers.
+7 −0
Original line number Diff line number Diff line
@@ -113,6 +113,13 @@ public class EabControllerImpl implements EabController {
        mEabBulkCapabilityUpdater.onDestroy();
    }

    @Override
    public void onCarrierConfigChanged() {
        // Pick up changes to CarrierConfig and run any applicable cleanup tasks associated with
        // that configuration.
        mCapabilityCleanupRunnable.run();
    }

    /**
     * Set the callback for sending the request to UceController.
     */
+5 −0
Original line number Diff line number Diff line
@@ -62,6 +62,11 @@ public class OptionsControllerImpl implements OptionsController {
        mRcsFeatureManager = null;
    }

    @Override
    public void onCarrierConfigChanged() {
        // Nothing required here.
    }

    @Override
    public void sendCapabilitiesRequest(Uri contactUri, @NonNull List<String> deviceFeatureTags,
            IOptionsResponseCallback c) throws RemoteException {
Loading