diff options
Diffstat (limited to 'telephony/java')
12 files changed, 359 insertions, 15 deletions
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java new file mode 100644 index 0000000..b6f6888 --- /dev/null +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2015 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 android.telephony; + +import com.android.internal.telephony.ICarrierConfigLoader; + +import android.annotation.SystemApi; +import android.content.Context; +import android.os.Bundle; +import android.os.RemoteException; +import android.os.ServiceManager; + +/** + * Provides access to telephony configuration values that are carrier-specific. + * <p> + * Users should obtain an instance of this class by calling + * {@code mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);} + * </p> + * + * @see Context#getSystemService + * @see Context#CARRIER_CONFIG_SERVICE + */ +public class CarrierConfigManager { + + /** + * This intent is broadcast by the system when carrier config changes. + */ + public static final String + ACTION_CARRIER_CONFIG_CHANGED = "android.intent.action.carrier_config_changed"; + + /** + * Flag specifying whether VoLTE should be available for carrier, independent of carrier + * provisioning. If false: hard disabled. If true: then depends on carrier provisioning, + * availability, etc. + */ + public static final String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available"; + + /** + * Flag specifying whether VoLTE availability is based on provisioning. + */ + public static final String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned"; + + /** + * Flag specifying whether VoLTE TTY is supported. + */ + public static final String BOOL_CARRIER_VOLTE_TTY_SUPPORTED + = "bool_carrier_volte_tty_supported"; + + /** + * Show APN Settings for some CDMA carriers. + */ + public static final String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; + + /** + * If Voice Radio Technology is RIL_RADIO_TECHNOLOGY_LTE:14 or RIL_RADIO_TECHNOLOGY_UNKNOWN:0 + * this is the value that should be used instead. A configuration value of + * RIL_RADIO_TECHNOLOGY_UNKNOWN:0 means there is no replacement value and that the default + * assumption for phone type (GSM) should be used. + */ + public static final String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat"; + + /* The following 3 fields are related to carrier visual voicemail. */ + + /** + * The carrier number MO sms messages are sent to. + * + * @hide + */ + @SystemApi + public static final String STRING_VVM_DESTINATION_NUMBER = "string_vvm_destination_number"; + + /** + * The port through which the MO sms messages are sent through. + * + * @hide + */ + @SystemApi + public static final String SHORT_VVM_PORT_NUMBER = "string_vvm_port_number"; + + /** + * The type of visual voicemail protocol the carrier adheres to (see below). + * + * @hide + */ + @SystemApi + public static final String STRING_VVM_TYPE = "string_vvm_type"; + + /* Visual voicemail protocols */ + + /** + * The OMTP protocol. + * + * @hide + */ + @SystemApi + public static final String VVM_TYPE_OMTP = "vvm_type_omtp"; + + private final static String TAG = "CarrierConfigManager"; + + /** The default value for every variable. */ + private final static Bundle sDefaults; + + static { + sDefaults = new Bundle(); + sDefaults.putBoolean(BOOL_CARRIER_VOLTE_AVAILABLE, false); + sDefaults.putBoolean(BOOL_CARRIER_VOLTE_PROVISIONED, false); + sDefaults.putBoolean(BOOL_CARRIER_VOLTE_TTY_SUPPORTED, true); + sDefaults.putBoolean(BOOL_SHOW_APN_SETTING_CDMA, false); + + sDefaults.putInt(INT_VOLTE_REPLACEMENT_RAT, 0); + } + + /** + * Gets the configuration values for a particular subscription, which is associated with a + * specific SIM card. If an invalid subId is used, the returned config will contain default + * values. + * + * @param subId the subscription ID, normally obtained from {@link SubscriptionManager}. + * @return A {@link Bundle} containing the config for the given subId, or default values for an + * invalid subId. + */ + public Bundle getConfigForSubId(int subId) { + try { + return getICarrierConfigLoader().getConfigForSubId(subId); + } catch (RemoteException ex) { + Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " + + ex.toString()); + } catch (NullPointerException ex) { + Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " + + ex.toString()); + } + return null; + } + + /** + * Gets the configuration values for the default subscription. + * + * @see #getConfigForSubId + */ + public Bundle getConfig() { + return getConfigForSubId(SubscriptionManager.getDefaultSubId()); + } + + /** + * Calling this method triggers telephony services to fetch the current carrier configuration. + * <p> + * Normally this does not need to be called because the platform reloads config on its own. Call + * this method if your app wants to update config at an arbitrary moment. + * </p> + * <p> + * This method returns before the reload has completed, and + * {@link android.service.carrier.CarrierConfigService#onLoadConfig} will be called from an + * arbitrary thread. + * </p> + */ + public void reloadCarrierConfigForSubId(int subId) { + try { + getICarrierConfigLoader().reloadCarrierConfigForSubId(subId); + } catch (RemoteException ex) { + Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); + } catch (NullPointerException ex) { + Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); + } + } + + /** + * Request the carrier config loader to update the cofig for phoneId. + * + * Depending on simState, the config may be cleared or loaded from config app. + * This is only used by SubscriptionInfoUpdater. + * + * @hide + */ + @SystemApi + public void updateConfigForPhoneId(int phoneId, String simState) { + try { + getICarrierConfigLoader().updateConfigForPhoneId(phoneId, simState); + } catch (RemoteException ex) { + Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); + } catch (NullPointerException ex) { + Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); + } + } + + /** + * Returns a bundle with the default value for every supported configuration variable. + * + * @hide + */ + @SystemApi + public static Bundle getDefaultConfig() { + return sDefaults; + } + + /** @hide */ + private ICarrierConfigLoader getICarrierConfigLoader() { + return ICarrierConfigLoader.Stub + .asInterface(ServiceManager.getService(Context.CARRIER_CONFIG_SERVICE)); + } +} diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index e1a3de7..d0a1dc2 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -162,7 +162,6 @@ public class TelephonyManager { * Returns 1 for Single standby mode (Single SIM functionality) * Returns 2 for Dual standby mode.(Dual SIM functionality) */ - /** {@hide} */ public int getPhoneCount() { int phoneCount = 1; switch (getMultiSimConfiguration()) { @@ -639,7 +638,6 @@ public class TelephonyManager { * * @param slotId of which deviceID is returned */ - /** {@hide} */ public String getDeviceId(int slotId) { // FIXME this assumes phoneId == slotId try { diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 8740e19..604d32d 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -270,7 +270,6 @@ public class ImsCallProfile implements Parcelable { return "{ serviceType=" + mServiceType + ", callType=" + mCallType + ", restrictCause=" + mRestrictCause + - ", callExtras=" + mCallExtras.toString() + ", mediaProfile=" + mMediaProfile.toString() + " }"; } @@ -313,22 +312,31 @@ public class ImsCallProfile implements Parcelable { * @param callType The call type. * @return The video state. */ - public static int getVideoStateFromCallType(int callType) { - switch (callType) { - case CALL_TYPE_VT_NODIR: - return VideoProfile.VideoState.PAUSED | - VideoProfile.VideoState.BIDIRECTIONAL; + public static int getVideoStateFromImsCallProfile(ImsCallProfile callProfile) { + int videostate = VideoProfile.VideoState.AUDIO_ONLY; + switch (callProfile.mCallType) { case CALL_TYPE_VT_TX: - return VideoProfile.VideoState.TX_ENABLED; + videostate = VideoProfile.VideoState.TX_ENABLED; + break; case CALL_TYPE_VT_RX: - return VideoProfile.VideoState.RX_ENABLED; + videostate = VideoProfile.VideoState.RX_ENABLED; + break; case CALL_TYPE_VT: - return VideoProfile.VideoState.BIDIRECTIONAL; + videostate = VideoProfile.VideoState.BIDIRECTIONAL; + break; case CALL_TYPE_VOICE: - return VideoProfile.VideoState.AUDIO_ONLY; + videostate = VideoProfile.VideoState.AUDIO_ONLY; + break; default: - return VideoProfile.VideoState.AUDIO_ONLY; + videostate = VideoProfile.VideoState.AUDIO_ONLY; + break; } + if (callProfile.isVideoPaused() && videostate != VideoProfile.VideoState.AUDIO_ONLY) { + videostate |= VideoProfile.VideoState.PAUSED; + } else { + videostate &= ~VideoProfile.VideoState.PAUSED; + } + return videostate; } /** @@ -387,6 +395,14 @@ public class ImsCallProfile implements Parcelable { } /** + * Checks if video call is paused + * @return true if call is video paused + */ + public boolean isVideoPaused() { + return mMediaProfile.mVideoDirection == ImsStreamMediaProfile.DIRECTION_INACTIVE; + } + + /** * Determines if a video state is set in a video state bit-mask. * * @param videoState The video state bit mask. diff --git a/telephony/java/com/android/ims/ImsConfigListener.aidl b/telephony/java/com/android/ims/ImsConfigListener.aidl index e827774..64a5015 100644 --- a/telephony/java/com/android/ims/ImsConfigListener.aidl +++ b/telephony/java/com/android/ims/ImsConfigListener.aidl @@ -48,4 +48,26 @@ oneway interface ImsConfigListener { * @return void. */ void onSetFeatureResponse(int feature, int network, int value, int status); -}
\ No newline at end of file + + /** + * Notifies client the value of the get operation result on the video quality item. + * + * @param status. as defined in com.android.ims.ImsConfig#OperationStatusConstants. + * @param quality. as defined in com.android.ims.ImsConfig#OperationValuesConstants. + * @return void + * + * @throws ImsException if calling the IMS service results in an error. + */ + void onGetVideoQuality(int status, int quality); + + /** + * Notifies client the set value operation result for video quality item. + * Used by clients that need to be notified the set operation result. + * + * @param status. as defined in com.android.ims.ImsConfig#OperationStatusConstants. + * @return void + * + * @throws ImsException if calling the IMS service results in an error. + */ + void onSetVideoQuality(int status); +} diff --git a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl index 84d1c545..0443c3e 100644 --- a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl @@ -115,4 +115,12 @@ interface IImsCallSessionListener { * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} */ void callSessionTtyModeReceived(in IImsCallSession session, in int mode); + + /** + * Notifies of a change to the multiparty state for this {@code ImsCallSession}. + * + * @param session The call session. + * @param isMultiParty {@code true} if the session became multiparty, {@code false} otherwise. + */ + void callSessionMultipartyStateChanged(in IImsCallSession session, in boolean isMultiParty); } diff --git a/telephony/java/com/android/ims/internal/IImsConfig.aidl b/telephony/java/com/android/ims/internal/IImsConfig.aidl index 441e03e..7324814 100644 --- a/telephony/java/com/android/ims/internal/IImsConfig.aidl +++ b/telephony/java/com/android/ims/internal/IImsConfig.aidl @@ -100,4 +100,24 @@ interface IImsConfig { * @return void */ boolean getVolteProvisioned(); + + /** + * + * Gets the value for ims fature item video quality. + * + * @param listener. Video quality value returned asynchronously through listener. + * @return void + */ + oneway void getVideoQuality(ImsConfigListener listener); + + /** + * Sets the value for IMS feature item video quality. + * + * @param quality, defines the value of video quality. + * @param listener, provided if caller needs to be notified for set result. + * @return void + * + * @throws ImsException if calling the IMS service results in an error. + */ + oneway void setVideoQuality(int quality, ImsConfigListener listener); } diff --git a/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl index f867fcb..be8751b 100644 --- a/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl +++ b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl @@ -41,7 +41,9 @@ oneway interface IImsVideoCallCallback { void changePeerDimensions(int width, int height); - void changeCallDataUsage(int dataUsage); + void changeCallDataUsage(long dataUsage); void changeCameraCapabilities(in CameraCapabilities cameraCapabilities); + + void changeVideoQuality(int videoQuality); } diff --git a/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl new file mode 100644 index 0000000..b5cdd9a --- /dev/null +++ b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2015 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.internal.telephony; + +import android.os.Bundle; + +/** + * Interface used to interact with the CarrierConfigLoader + */ +interface ICarrierConfigLoader { + + Bundle getConfigForSubId(int subId); + + void reloadCarrierConfigForSubId(int subId); + + void updateConfigForPhoneId(int phoneId, String simState); +} diff --git a/telephony/java/com/android/internal/telephony/PhoneConstants.java b/telephony/java/com/android/internal/telephony/PhoneConstants.java index b8e8064..0ebd719 100644 --- a/telephony/java/com/android/internal/telephony/PhoneConstants.java +++ b/telephony/java/com/android/internal/telephony/PhoneConstants.java @@ -186,4 +186,11 @@ public class PhoneConstants { //FIXME maybe this shouldn't be here - sprout only public static final int CAPABILITY_3G = 1; + + /** + * Values for the adb property "persist.radio.videocall.audio.output" + */ + public static final int AUDIO_OUTPUT_ENABLE_SPEAKER = 0; + public static final int AUDIO_OUTPUT_DISABLE_SPEAKER = 1; + public static final int AUDIO_OUTPUT_DEFAULT = AUDIO_OUTPUT_ENABLE_SPEAKER; } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 082e8bb..12541d8 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -69,6 +69,14 @@ public interface RILConstants { int SS_MODIFIED_TO_USSD = 25; /* SS request modified to USSD */ int SUBSCRIPTION_NOT_SUPPORTED = 26; /* Subscription not supported */ int SS_MODIFIED_TO_SS = 27; /* SS request modified to different SS request */ + int SIM_ALREADY_POWERED_OFF = 29; /* SAP: 0x03, Error card aleready powered off */ + int SIM_ALREADY_POWERED_ON = 30; /* SAP: 0x05, Error card already powered on */ + int SIM_DATA_NOT_AVAILABLE = 31; /* SAP: 0x06, Error data not available */ + int SIM_SAP_CONNECT_FAILURE = 32; + int SIM_SAP_MSG_SIZE_TOO_LARGE = 33; + int SIM_SAP_MSG_SIZE_TOO_SMALL = 34; + int SIM_SAP_CONNECT_OK_CALL_ONGOING = 35; + int LCE_NOT_SUPPORTED = 36; /* Link Capacity Estimation (LCE) not supported */ /* NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE */ @@ -135,6 +143,11 @@ public interface RILConstants { int NV_CONFIG_ERASE_RESET = 2; int NV_CONFIG_FACTORY_RESET = 3; + /* LCE service related constants. */ + int LCE_NOT_AVAILABLE = -1; + int LCE_STOPPED = 0; + int LCE_ACTIVE = 1; + /* cat include/telephony/ril.h | \ egrep '^#define' | \ @@ -307,6 +320,9 @@ cat include/telephony/ril.h | \ int RIL_REQUEST_SHUTDOWN = 129; int RIL_REQUEST_GET_RADIO_CAPABILITY = 130; int RIL_REQUEST_SET_RADIO_CAPABILITY = 131; + int RIL_REQUEST_START_LCE = 132; + int RIL_REQUEST_STOP_LCE = 133; + int RIL_REQUEST_PULL_LCEDATA = 134; int RIL_UNSOL_RESPONSE_BASE = 1000; int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000; @@ -354,4 +370,5 @@ cat include/telephony/ril.h | \ int RIL_UNSOL_RADIO_CAPABILITY = 1042; int RIL_UNSOL_ON_SS = 1043; int RIL_UNSOL_STK_CC_ALPHA_NOTIFY = 1044; + int RIL_UNSOL_LCEDATA_RECV = 1045; } diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java index 92cd468..26faaba 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java +++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java @@ -319,6 +319,7 @@ public class TelephonyIntents { public static final String EXTRA_PLMN = "plmn"; public static final String EXTRA_SHOW_SPN = "showSpn"; public static final String EXTRA_SPN = "spn"; + public static final String EXTRA_DATA_SPN = "spnData"; /** * <p>Broadcast Action: It indicates one column of a subinfo record has been changed diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java index c89208d..645c3a1 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java +++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java @@ -209,4 +209,12 @@ public interface TelephonyProperties * Set to the sim count. */ static final String PROPERTY_SIM_COUNT = "ro.telephony.sim.count"; + + /** + * Controls audio route for video calls. + * 0 - Use the default audio routing strategy. + * 1 - Disable the speaker. Route the audio to Headset or Bluetooth + * or Earpiece, based on the default audio routing strategy. + */ + static final String PROPERTY_VIDEOCALL_AUDIO_OUTPUT = "persist.radio.call.audio.output"; } |