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

Commit 027af27f authored by Daniel Bright's avatar Daniel Bright
Browse files

Rollback telephony resources on ims

This reverts commit 7c849f91.

Bug: 149776042
Test: TeleServiceTests
Change-Id: Ic468ab4c7062820492433bf96790b9647e5d7b6d
parent 276edfdc
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ java_library {
    ],

    libs: [
        "telephony-resources",
        "unsupportedappusage",
        "framework-telephony",
        // TODO link to framework-minus-apex stub and framework-wifi-stubs
+4 −4
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.os.Bundle;
import android.os.Message;
import android.os.Parcel;
import android.telecom.Call;
import com.android.ims.internal.ConferenceParticipant;
import android.telecom.Connection;
import android.telephony.CallQuality;
import android.telephony.ServiceState;
@@ -36,10 +37,8 @@ import android.telephony.ims.ImsSuppServiceNotification;
import android.text.TextUtils;
import android.util.Log;

import com.android.ims.internal.ConferenceParticipant;
import com.android.ims.internal.ICall;
import com.android.ims.internal.ImsStreamMediaSession;
import com.android.ims.internal.TelephonyResourceUtils;
import com.android.internal.annotations.VisibleForTesting;
import com.android.telephony.Rlog;

@@ -47,6 +46,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

@@ -1421,8 +1421,8 @@ public class ImsCall implements ICall {

            // if skipHoldBeforeMerge = true, IMS service implementation will
            // merge without explicitly holding the call.
            if (mHold || (TelephonyResourceUtils.getTelephonyResources(mContext).getBoolean(
                    com.android.telephony.resources.R.bool.skipHoldBeforeMerge))) {
            if (mHold || (mContext.getResources().getBoolean(
                    com.android.internal.R.bool.skipHoldBeforeMerge))) {

                if (mMergePeer != null && !mMergePeer.isMultiparty() && !isMultiparty()) {
                    // We only set UPDATE_MERGE when we are adding the first
+12 −12
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ import com.android.ims.internal.IImsCallSession;
import com.android.ims.internal.IImsEcbm;
import com.android.ims.internal.IImsMultiEndpoint;
import com.android.ims.internal.IImsUt;
import com.android.ims.internal.TelephonyResourceUtils;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.util.HandlerExecutor;
@@ -519,8 +518,8 @@ public class ImsManager implements IFeatureConnector {
            return true;
        }

        return TelephonyResourceUtils.getTelephonyResources(mContext).getBoolean(
                com.android.telephony.resources.R.bool.config_device_volte_available)
        return mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_device_volte_available)
                && getBooleanCarrierConfig(CarrierConfigManager.KEY_CARRIER_VOLTE_AVAILABLE_BOOL)
                && isGbaValid();
    }
@@ -669,10 +668,10 @@ public class ImsManager implements IFeatureConnector {
            return true;
        }

        return TelephonyResourceUtils.getTelephonyResources(mContext).getBoolean(
                com.android.telephony.resources.R.bool.config_device_vt_available)
                && getBooleanCarrierConfig(CarrierConfigManager.KEY_CARRIER_VT_AVAILABLE_BOOL)
                && isGbaValid();
        return mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_device_vt_available) &&
                getBooleanCarrierConfig(CarrierConfigManager.KEY_CARRIER_VT_AVAILABLE_BOOL) &&
                isGbaValid();
    }

    /**
@@ -1189,10 +1188,11 @@ public class ImsManager implements IFeatureConnector {
            return true;
        }

        return TelephonyResourceUtils.getTelephonyResources(mContext).getBoolean(
                com.android.telephony.resources.R.bool.config_device_wfc_ims_available)
                && getBooleanCarrierConfig(CarrierConfigManager.KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL)
                && isGbaValid();
        return mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_device_wfc_ims_available) &&
                getBooleanCarrierConfig(
                        CarrierConfigManager.KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL) &&
                isGbaValid();
    }

    public boolean isSuppServicesOverUtEnabledByPlatform() {
@@ -1892,7 +1892,7 @@ public class ImsManager implements IFeatureConnector {
                        ImsReasonInfo.CODE_UT_NOT_SUPPORTED);
            }

            mUt = new ImsUt(mContext, iUt);
            mUt = new ImsUt(iUt);
        } catch (RemoteException e) {
            throw new ImsException("getSupplementaryServiceConfiguration()", e,
                    ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
+4 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.ims;

import android.content.Context;
import android.content.res.Resources;
import android.os.AsyncResult;
import android.os.Bundle;
@@ -32,7 +31,6 @@ import android.telephony.ims.ImsUtListener;

import com.android.ims.internal.IImsUt;
import com.android.ims.internal.IImsUtListener;
import com.android.ims.internal.TelephonyResourceUtils;
import com.android.internal.annotations.VisibleForTesting;
import com.android.telephony.Rlog;

@@ -83,15 +81,14 @@ public class ImsUt implements ImsUtInterface {

    // For synchronization of private variables
    private Object mLockObj = new Object();
    private final Context mContext;
    private final IImsUt miUt;
    private HashMap<Integer, Message> mPendingCmds =
            new HashMap<Integer, Message>();
    private Registrant mSsIndicationRegistrant;

    public ImsUt(Context context, IImsUt iUt) {
        mContext = context;
    public ImsUt(IImsUt iUt) {
        miUt = iUt;

        if (miUt != null) {
            try {
                miUt.setListener(new IImsUtListenerProxy());
@@ -617,8 +614,8 @@ public class ImsUt implements ImsUtInterface {
        // If ImsReasonInfo object does not have a String error code, use a
        // default error string.
        if (error.mExtraMessage == null) {
            errorString = TelephonyResourceUtils.getTelephonyResources(mContext)
                    .getString(com.android.telephony.resources.R.string.mmiError);
            errorString = Resources.getSystem().getString(
                    com.android.internal.R.string.mmiError);
        }
        else {
            errorString = new String(error.mExtraMessage);
+0 −44
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.ims.internal;

import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;

import com.android.telephony.Rlog;

/**
 * This class provides utility functions for Telephony Resources.
 * Copy of com.android.internal.telephony.util.TelephonyResourceUtils
 */
public final class TelephonyResourceUtils {
    static String TELEPHONY_RESOURCE_PACKAGE = "com.android.telephony.resources";
    private static final String TAG = "TelephonyResourceUtils-ims";

    /**
     * Retrieve resource for the telephony resource package.
     */
    public static Resources getTelephonyResources(Context context) {
        try {
            return context.getPackageManager()
                    .getResourcesForApplication(TELEPHONY_RESOURCE_PACKAGE);
        }  catch (PackageManager.NameNotFoundException ex) {
            Rlog.e(TAG, "No resource package found");
        }
        return null;
    }
}