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

Commit 276edfdc authored by Daniel Bright's avatar Daniel Bright Committed by Android (Google) Code Review
Browse files

Merge "Repoint telephony related translations"

parents 7147c577 7c849f91
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ 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,7 +23,6 @@ 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;
@@ -37,8 +36,10 @@ 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;

@@ -46,7 +47,6 @@ 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 || (mContext.getResources().getBoolean(
                    com.android.internal.R.bool.skipHoldBeforeMerge))) {
            if (mHold || (TelephonyResourceUtils.getTelephonyResources(mContext).getBoolean(
                    com.android.telephony.resources.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,6 +59,7 @@ 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;
@@ -518,8 +519,8 @@ public class ImsManager implements IFeatureConnector {
            return true;
        }

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

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

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

        return mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_device_wfc_ims_available) &&
                getBooleanCarrierConfig(
                        CarrierConfigManager.KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL) &&
                isGbaValid();
        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();
    }

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

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

package com.android.ims;

import android.content.Context;
import android.content.res.Resources;
import android.os.AsyncResult;
import android.os.Bundle;
@@ -31,6 +32,7 @@ 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;

@@ -81,14 +83,15 @@ 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(IImsUt iUt) {
    public ImsUt(Context context, IImsUt iUt) {
        mContext = context;
        miUt = iUt;

        if (miUt != null) {
            try {
                miUt.setListener(new IImsUtListenerProxy());
@@ -614,8 +617,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 = Resources.getSystem().getString(
                    com.android.internal.R.string.mmiError);
            errorString = TelephonyResourceUtils.getTelephonyResources(mContext)
                    .getString(com.android.telephony.resources.R.string.mmiError);
        }
        else {
            errorString = new String(error.mExtraMessage);
+44 −0
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;
    }
}