Loading Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ java_library { ], libs: [ "telephony-resources", "unsupportedappusage", "framework-telephony", // TODO link to framework-minus-apex stub and framework-wifi-stubs Loading src/java/com/android/ims/ImsCall.java +4 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading Loading @@ -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 Loading src/java/com/android/ims/ImsManager.java +12 −12 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); } Loading Loading @@ -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(); } /** Loading Loading @@ -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() { Loading Loading @@ -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); Loading src/java/com/android/ims/ImsUt.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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()); Loading Loading @@ -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); Loading src/java/com/android/ims/internal/TelephonyResourceUtils.java 0 → 100644 +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; } } Loading
Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ java_library { ], libs: [ "telephony-resources", "unsupportedappusage", "framework-telephony", // TODO link to framework-minus-apex stub and framework-wifi-stubs Loading
src/java/com/android/ims/ImsCall.java +4 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading Loading @@ -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 Loading
src/java/com/android/ims/ImsManager.java +12 −12 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); } Loading Loading @@ -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(); } /** Loading Loading @@ -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() { Loading Loading @@ -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); Loading
src/java/com/android/ims/ImsUt.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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()); Loading Loading @@ -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); Loading
src/java/com/android/ims/internal/TelephonyResourceUtils.java 0 → 100644 +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; } }