diff options
Diffstat (limited to 'telephony/java/com/android')
25 files changed, 743 insertions, 344 deletions
diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 8740e19..2c4354b 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -143,6 +143,8 @@ public class ImsCallProfile implements Parcelable { public static final int OIR_DEFAULT = 0; // "user subscription default value" public static final int OIR_PRESENTATION_RESTRICTED = 1; public static final int OIR_PRESENTATION_NOT_RESTRICTED = 2; + public static final int OIR_PRESENTATION_UNKNOWN = 3; + public static final int OIR_PRESENTATION_PAYPHONE = 4; /** * Values for EXTRA_DIALSTRING @@ -270,7 +272,6 @@ public class ImsCallProfile implements Parcelable { return "{ serviceType=" + mServiceType + ", callType=" + mCallType + ", restrictCause=" + mRestrictCause + - ", callExtras=" + mCallExtras.toString() + ", mediaProfile=" + mMediaProfile.toString() + " }"; } @@ -313,22 +314,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.STATE_AUDIO_ONLY; + switch (callProfile.mCallType) { case CALL_TYPE_VT_TX: - return VideoProfile.VideoState.TX_ENABLED; + videostate = VideoProfile.STATE_TX_ENABLED; + break; case CALL_TYPE_VT_RX: - return VideoProfile.VideoState.RX_ENABLED; + videostate = VideoProfile.STATE_RX_ENABLED; + break; case CALL_TYPE_VT: - return VideoProfile.VideoState.BIDIRECTIONAL; + videostate = VideoProfile.STATE_BIDIRECTIONAL; + break; case CALL_TYPE_VOICE: - return VideoProfile.VideoState.AUDIO_ONLY; + videostate = VideoProfile.STATE_AUDIO_ONLY; + break; default: - return VideoProfile.VideoState.AUDIO_ONLY; + videostate = VideoProfile.STATE_AUDIO_ONLY; + break; } + if (callProfile.isVideoPaused() && !VideoProfile.isAudioOnly(videostate)) { + videostate |= VideoProfile.STATE_PAUSED; + } else { + videostate &= ~VideoProfile.STATE_PAUSED; + } + return videostate; } /** @@ -339,9 +349,9 @@ public class ImsCallProfile implements Parcelable { * @return The call type. */ public static int getCallTypeFromVideoState(int videoState) { - boolean videoTx = isVideoStateSet(videoState, VideoProfile.VideoState.TX_ENABLED); - boolean videoRx = isVideoStateSet(videoState, VideoProfile.VideoState.RX_ENABLED); - boolean isPaused = isVideoStateSet(videoState, VideoProfile.VideoState.PAUSED); + boolean videoTx = isVideoStateSet(videoState, VideoProfile.STATE_TX_ENABLED); + boolean videoRx = isVideoStateSet(videoState, VideoProfile.STATE_RX_ENABLED); + boolean isPaused = isVideoStateSet(videoState, VideoProfile.STATE_PAUSED); if (isPaused) { return ImsCallProfile.CALL_TYPE_VT_NODIR; } else if (videoTx && !videoRx) { @@ -365,6 +375,10 @@ public class ImsCallProfile implements Parcelable { return ImsCallProfile.OIR_PRESENTATION_RESTRICTED; case PhoneConstants.PRESENTATION_ALLOWED: return ImsCallProfile.OIR_PRESENTATION_NOT_RESTRICTED; + case PhoneConstants.PRESENTATION_PAYPHONE: + return ImsCallProfile.OIR_PRESENTATION_PAYPHONE; + case PhoneConstants.PRESENTATION_UNKNOWN: + return ImsCallProfile.OIR_PRESENTATION_UNKNOWN; default: return ImsCallProfile.OIR_DEFAULT; } @@ -381,12 +395,24 @@ public class ImsCallProfile implements Parcelable { return PhoneConstants.PRESENTATION_RESTRICTED; case ImsCallProfile.OIR_PRESENTATION_NOT_RESTRICTED: return PhoneConstants.PRESENTATION_ALLOWED; + case ImsCallProfile.OIR_PRESENTATION_PAYPHONE: + return PhoneConstants.PRESENTATION_PAYPHONE; + case ImsCallProfile.OIR_PRESENTATION_UNKNOWN: + return PhoneConstants.PRESENTATION_UNKNOWN; default: return PhoneConstants.PRESENTATION_UNKNOWN; } } /** + * 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/ImsReasonInfo.java b/telephony/java/com/android/ims/ImsReasonInfo.java index 0b1246b..9628915 100644 --- a/telephony/java/com/android/ims/ImsReasonInfo.java +++ b/telephony/java/com/android/ims/ImsReasonInfo.java @@ -25,26 +25,6 @@ import android.os.Parcelable; * @hide */ public class ImsReasonInfo implements Parcelable { - - /** - * Reason types, defines the error category. - * UNSPECIFIED - unknown error reason - * LOCAL - indicates the local/device error reason - * LOCAL_TIMEOUT - indicates the local error reason when a specific timer is expired - * STATUSCODE - indicates the interworking error reason by SIP status code received - * from the network - * MEDIA - indicates the media error reason (local resource, SDP parameter, etc.) - * USER - indicates the error reason by the local or remote user - * UT - indicates the error reason for the supplementary service configuration - */ - public static final int TYPE_UNSPECIFIED = 0; - public static final int TYPE_LOCAL = 1; - public static final int TYPE_TIMEOUT = 2; - public static final int TYPE_STATUSCODE = 3; - public static final int TYPE_MEDIA = 4; - public static final int TYPE_USER = 5; - public static final int TYPE_UT = 8; - /** * Specific code of each types */ @@ -229,23 +209,37 @@ public class ImsReasonInfo implements Parcelable { public static final int CODE_ECBM_NOT_SUPPORTED = 901; /** + * Ims Registration error code + */ + public static final int CODE_REGISTRATION_ERROR = 1000; + + /** + * CALL DROP error codes (Call could drop because of many reasons like Network not available, + * handover, failed, etc) + */ + + /** + * CALL DROP error code for the case when a device is ePDG capable and when the user is on an + * active wifi call and at the edge of coverage and there is no qualified LTE network available + * to handover the call to. We get a handover NOT_TRIGERRED message from the modem. This error + * code is received as part of the handover message. + */ + public static final int CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE = 1100; + + /** * Network string error messages. * mExtraMessage may have these values. */ public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED = "Forbidden. Not Authorized for Service"; - // For reason type - public int mReasonType; // For main reason code public int mCode; // For the extra code value; it depends on the code value. public int mExtraCode; // For the additional message of the reason info. public String mExtraMessage; - public ImsReasonInfo() { - mReasonType = TYPE_UNSPECIFIED; mCode = CODE_UNSPECIFIED; mExtraCode = CODE_UNSPECIFIED; mExtraMessage = null; @@ -256,14 +250,12 @@ public class ImsReasonInfo implements Parcelable { } public ImsReasonInfo(int code, int extraCode) { - mReasonType = (int) (code / 100); mCode = code; mExtraCode = extraCode; mExtraMessage = null; } public ImsReasonInfo(int code, int extraCode, String extraMessage) { - mReasonType = (int) (code / 100); mCode = code; mExtraCode = extraCode; mExtraMessage = extraMessage; @@ -291,20 +283,12 @@ public class ImsReasonInfo implements Parcelable { } /** - * - */ - public int getReasonType() { - return mReasonType; - } - - /** * Returns the string format of {@link ImsReasonInfo} * * @return the string format of {@link ImsReasonInfo} */ public String toString() { - return "ImsReasonInfo :: {" + mReasonType + ", " - + mCode + ", " + mExtraCode + ", " + mExtraMessage + "}"; + return "ImsReasonInfo :: {" + mCode + ", " + mExtraCode + ", " + mExtraMessage + "}"; } @Override @@ -314,14 +298,12 @@ public class ImsReasonInfo implements Parcelable { @Override public void writeToParcel(Parcel out, int flags) { - out.writeInt(mReasonType); out.writeInt(mCode); out.writeInt(mExtraCode); out.writeString(mExtraMessage); } private void readFromParcel(Parcel in) { - mReasonType = in.readInt(); mCode = in.readInt(); mExtraCode = in.readInt(); mExtraMessage = in.readString(); 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 c17637c..7324814 100644 --- a/telephony/java/com/android/ims/internal/IImsConfig.aidl +++ b/telephony/java/com/android/ims/internal/IImsConfig.aidl @@ -20,31 +20,11 @@ package com.android.ims.internal; import com.android.ims.ImsConfigListener; /** - * Provides APIs to get/set the IMS service capability/parameters. - * The parameters can be configured by operator and/or user. - * We define 4 storage locations for the IMS config items: - * 1) Default config:For factory out device or device after factory data reset, - * the default config is used to build the initial state of the master config value. - * 2) Provisioned value: as the parameters provisioned by operator need to be preserved - * across FDR(factory data reset)/BOTA(over the air software upgrade), the operator - * provisioned items should be stored in memory location preserved across FDR/BOTA. - * 3) Master value: as the provisioned value can override the user setting, - * and the master config are used by IMS stack. They should be stored in the - * storage based on IMS vendor implementations. - * 4) User setting: For items can be changed by both user/operator, the user - * setting should take effect in some cases. So the user setting should be stored in - * database like setting.db. + * Provides APIs to get/set the IMS service feature/capability/parameters. + * The config items include: + * 1) Items provisioned by the operator. + * 2) Items configured by user. Mainly service feature class. * - * Priority consideration if both operator/user can config the same item: - * 1) For feature config items, the master value is obtained from the provisioned value - * masks with the user setting. Specifically the provisioned values overrides - * the user setting if feature is provisioned off. Otherwise, user setting takes - * effect. - * 2) For non-feature config item: to be implemented based on cases. - * Special cases considered as below: - * 1) Factory out device, the master configuration is built from default config. - * 2) For Factory data reset/SW upgrade device, the master config is built by - * taking provisioned value overriding default config. * {@hide} */ interface IImsConfig { @@ -120,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/IImsRegistrationListener.aidl b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl index 1413e58..c910600 100644 --- a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl @@ -16,6 +16,7 @@ package com.android.ims.internal; +import com.android.ims.ImsReasonInfo; /** * A listener type for receiving notifications about the changes to * the IMS connection(registration). @@ -29,9 +30,14 @@ interface IImsRegistrationListener { void registrationConnected(); /** + * Notifies the application when the device is trying to connect the IMS network. + */ + void registrationProgressing(); + + /** * Notifies the application when the device is disconnected from the IMS network. */ - void registrationDisconnected(); + void registrationDisconnected(in ImsReasonInfo imsReasonInfo); /** * Notifies the application when its suspended IMS connection is resumed, diff --git a/telephony/java/com/android/ims/internal/IImsUt.aidl b/telephony/java/com/android/ims/internal/IImsUt.aidl index 50a0169..c531ea5 100644 --- a/telephony/java/com/android/ims/internal/IImsUt.aidl +++ b/telephony/java/com/android/ims/internal/IImsUt.aidl @@ -79,12 +79,13 @@ interface IImsUt { /** * Updates the configuration of the call forward. */ - int updateCallForward(int action, int condition, String number, int timeSeconds); + int updateCallForward(int action, int condition, String number, + int serviceClass, int timeSeconds); /** * Updates the configuration of the call waiting. */ - int updateCallWaiting(boolean enable); + int updateCallWaiting(boolean enable, int serviceClass); /** * Updates the configuration of the CLIR supplementary service. diff --git a/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl index f867fcb..9499c9f 100644 --- a/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl +++ b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl @@ -16,7 +16,6 @@ package com.android.ims.internal; -import android.telecom.CameraCapabilities; import android.telecom.VideoProfile; /** @@ -41,7 +40,9 @@ oneway interface IImsVideoCallCallback { void changePeerDimensions(int width, int height); - void changeCallDataUsage(int dataUsage); + void changeCallDataUsage(long dataUsage); - void changeCameraCapabilities(in CameraCapabilities cameraCapabilities); + void changeCameraCapabilities(in VideoProfile.CameraCapabilities cameraCapabilities); + + void changeVideoQuality(int videoQuality); } diff --git a/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl b/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl index 1fd88e7..39e83c6 100644 --- a/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl +++ b/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl @@ -16,6 +16,7 @@ package com.android.ims.internal; +import android.net.Uri; import android.view.Surface; import android.telecom.VideoProfile; @@ -52,7 +53,7 @@ oneway interface IImsVideoCallProvider { void setZoom(float value); - void sendSessionModifyRequest(in VideoProfile reqProfile); + void sendSessionModifyRequest(in VideoProfile fromProfile, in VideoProfile toProfile); void sendSessionModifyResponse(in VideoProfile responseProfile); @@ -60,5 +61,5 @@ oneway interface IImsVideoCallProvider { void requestCallDataUsage(); - void setPauseImage(String uri); + void setPauseImage(in Uri uri); } diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java index aae7617..c754068 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java +++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java @@ -34,7 +34,6 @@ import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.telephony.Rlog; import android.telephony.SubscriptionManager; -import android.util.Log; /** * Helper class to make it easier to run asynchronous caller-id lookup queries. diff --git a/telephony/java/com/android/internal/telephony/CellNetworkScanResult.aidl b/telephony/java/com/android/internal/telephony/CellNetworkScanResult.aidl new file mode 100644 index 0000000..7917a81 --- /dev/null +++ b/telephony/java/com/android/internal/telephony/CellNetworkScanResult.aidl @@ -0,0 +1,19 @@ +/* +** Copyright 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; + +parcelable CellNetworkScanResult; diff --git a/telephony/java/com/android/internal/telephony/CellNetworkScanResult.java b/telephony/java/com/android/internal/telephony/CellNetworkScanResult.java new file mode 100644 index 0000000..5a6bd1d --- /dev/null +++ b/telephony/java/com/android/internal/telephony/CellNetworkScanResult.java @@ -0,0 +1,126 @@ +/* +** Copyright 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.Parcel; +import android.os.Parcelable; +import java.util.ArrayList; +import java.util.List; + +/** + * Response for querying available cellular networks. + * + * @hide + */ +public class CellNetworkScanResult implements Parcelable { + + /** + * Possible status values. + */ + public static final int STATUS_SUCCESS = 1; + public static final int STATUS_RADIO_NOT_AVAILABLE = 2; + public static final int STATUS_RADIO_GENERIC_FAILURE = 3; + public static final int STATUS_UNKNOWN_ERROR = 4; + + private final int mStatus; + private final List<OperatorInfo> mOperators; + + /** + * Constructor. + * + * @hide + */ + public CellNetworkScanResult(int status, List<OperatorInfo> operators) { + mStatus = status; + mOperators = operators; + } + + /** + * Construct a CellNetworkScanResult from a given parcel. + */ + private CellNetworkScanResult(Parcel in) { + mStatus = in.readInt(); + int len = in.readInt(); + if (len > 0) { + mOperators = new ArrayList(); + for (int i = 0; i < len; ++i) { + mOperators.add(OperatorInfo.CREATOR.createFromParcel(in)); + } + } else { + mOperators = null; + } + } + + /** + * @return the status of the command. + */ + public int getStatus() { + return mStatus; + } + + /** + * @return the operators. + */ + public List<OperatorInfo> getOperators() { + return mOperators; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeInt(mStatus); + if (mOperators != null && mOperators.size() > 0) { + out.writeInt(mOperators.size()); + for (OperatorInfo network : mOperators) { + network.writeToParcel(out, flags); + } + } else { + out.writeInt(0); + } + } + + @Override + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("CellNetworkScanResult: {"); + sb.append(" status:").append(mStatus); + if (mOperators != null) { + for (OperatorInfo network : mOperators) { + sb.append(" network:").append(network); + } + } + sb.append("}"); + return sb.toString(); + } + + public static final Parcelable.Creator<CellNetworkScanResult> CREATOR + = new Parcelable.Creator<CellNetworkScanResult>() { + + @Override + public CellNetworkScanResult createFromParcel(Parcel in) { + return new CellNetworkScanResult(in); + } + + public CellNetworkScanResult[] newArray(int size) { + return new CellNetworkScanResult[size]; + } + }; +} 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..d77b27f --- /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.PersistableBundle; + +/** + * Interface used to interact with the CarrierConfigLoader + */ +interface ICarrierConfigLoader { + + PersistableBundle getConfigForSubId(int subId); + + void notifyConfigChangedForSubId(int subId); + + void updateConfigForPhoneId(int phoneId, String simState); +} diff --git a/telephony/java/com/android/internal/telephony/IMms.aidl b/telephony/java/com/android/internal/telephony/IMms.aidl index 49ac400..fa5073e 100644 --- a/telephony/java/com/android/internal/telephony/IMms.aidl +++ b/telephony/java/com/android/internal/telephony/IMms.aidl @@ -34,8 +34,7 @@ interface IMms { * PDU format * @param locationUrl the optional location url for where this message should be sent to * @param configOverrides the carrier-specific messaging configuration values to override for - * sending the message. See {@link android.telephony.MessagingConfigurationManager} for the - * value names and types. + * sending the message. See {@link android.telephony.SmsManager} for the value names and types. * @param sentIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is successfully sent, or failed */ @@ -51,8 +50,8 @@ interface IMms { * from the MMS WAP push notification * @param contentUri a contentUri to which the downloaded MMS message will be written * @param configOverrides the carrier-specific messaging configuration values to override for - * downloading the message. See {@link android.telephony.MessagingConfigurationManager} for the - * value names and types. + * downloading the message. See {@link android.telephony.SmsManager} for the value names and + * types. * @param downloadedIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is downloaded, or the download is failed */ @@ -165,8 +164,7 @@ interface IMms { * @param callingPkg the package name of the calling app * @param messageUri the URI of the stored message * @param configOverrides the carrier-specific messaging configuration values to override for - * sending the message. See {@link android.telephony.MessagingConfigurationManager} for the - * value names and types. + * sending the message. See {@link android.telephony.SmsManager} for the value names and types. * @param sentIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is successfully sent, or failed */ diff --git a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl index cea62ba..cbedb95 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl @@ -44,5 +44,6 @@ oneway interface IPhoneStateListener { void onDataConnectionRealTimeInfoChanged(in DataConnectionRealTimeInfo dcRtInfo); void onVoLteServiceStateChanged(in VoLteServiceState lteState); void onOemHookRawEvent(in byte[] rawData); + void onCarrierNetworkChange(in boolean active); } diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl index c91a59c..ed85392 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl @@ -25,12 +25,12 @@ interface IPhoneSubInfo { /** * Retrieves the unique device ID, e.g., IMEI for GSM phones. */ - String getDeviceId(); + String getDeviceId(String callingPackage); /** * Retrieves the unique Network Access ID */ - String getNaiForSubscriber(int subId); + String getNaiForSubscriber(int subId, String callingPackage); /** * Retrieves the unique device ID of a phone for the device, e.g., IMEI @@ -41,91 +41,91 @@ interface IPhoneSubInfo { /** * Retrieves the IMEI. */ - String getImeiForSubscriber(int subId); + String getImeiForSubscriber(int subId, String callingPackage); /** * Retrieves the software version number for the device, e.g., IMEI/SV * for GSM phones. */ - String getDeviceSvn(); + String getDeviceSvn(String callingPackage); /** * Retrieves the software version number of a subId for the device, e.g., IMEI/SV * for GSM phones. */ - String getDeviceSvnUsingSubId(int subId); + String getDeviceSvnUsingSubId(int subId, String callingPackage); /** * Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones. */ - String getSubscriberId(); + String getSubscriberId(String callingPackage); /** * Retrieves the unique subscriber ID of a given subId, e.g., IMSI for GSM phones. */ - String getSubscriberIdForSubscriber(int subId); + String getSubscriberIdForSubscriber(int subId, String callingPackage); /** * Retrieves the Group Identifier Level1 for GSM phones. */ - String getGroupIdLevel1(); + String getGroupIdLevel1(String callingPackage); /** * Retrieves the Group Identifier Level1 for GSM phones of a subId. */ - String getGroupIdLevel1ForSubscriber(int subId); + String getGroupIdLevel1ForSubscriber(int subId, String callingPackage); /** * Retrieves the serial number of the ICC, if applicable. */ - String getIccSerialNumber(); + String getIccSerialNumber(String callingPackage); /** * Retrieves the serial number of a given subId. */ - String getIccSerialNumberForSubscriber(int subId); + String getIccSerialNumberForSubscriber(int subId, String callingPackage); /** * Retrieves the phone number string for line 1. */ - String getLine1Number(); + String getLine1Number(String callingPackage); /** * Retrieves the phone number string for line 1 of a subcription. */ - String getLine1NumberForSubscriber(int subId); + String getLine1NumberForSubscriber(int subId, String callingPackage); /** * Retrieves the alpha identifier for line 1. */ - String getLine1AlphaTag(); + String getLine1AlphaTag(String callingPackage); /** * Retrieves the alpha identifier for line 1 of a subId. */ - String getLine1AlphaTagForSubscriber(int subId); + String getLine1AlphaTagForSubscriber(int subId, String callingPackage); /** * Retrieves MSISDN Number. */ - String getMsisdn(); + String getMsisdn(String callingPackage); /** * Retrieves the Msisdn of a subId. */ - String getMsisdnForSubscriber(int subId); + String getMsisdnForSubscriber(int subId, String callingPackage); /** * Retrieves the voice mail number. */ - String getVoiceMailNumber(); + String getVoiceMailNumber(String callingPackage); /** * Retrieves the voice mail number of a given subId. */ - String getVoiceMailNumberForSubscriber(int subId); + String getVoiceMailNumberForSubscriber(int subId, String callingPackage); /** * Retrieves the complete voice mail number. @@ -140,13 +140,13 @@ interface IPhoneSubInfo { /** * Retrieves the alpha identifier associated with the voice mail number. */ - String getVoiceMailAlphaTag(); + String getVoiceMailAlphaTag(String callingPackage); /** * Retrieves the alpha identifier associated with the voice mail number * of a subId. */ - String getVoiceMailAlphaTagForSubscriber(int subId); + String getVoiceMailAlphaTagForSubscriber(int subId, String callingPackage); /** * Returns the IMS private user identity (IMPI) that was loaded from the ISIM. diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index 70ac268..21c94c2 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -37,13 +37,6 @@ import com.android.internal.telephony.SmsRawData; interface ISms { /** * Retrieves all messages currently stored on ICC. - * - * @return list of SmsRawData of all sms on ICC - */ - List<SmsRawData> getAllMessagesFromIccEf(String callingPkg); - - /** - * Retrieves all messages currently stored on ICC. * @param subId the subId id. * @return list of SmsRawData of all sms on ICC */ @@ -57,20 +50,6 @@ interface ISms { * STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, * STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE) * @param pdu the raw PDU to store - * @return success or not - * - */ - boolean updateMessageOnIccEf(String callingPkg, int messageIndex, int newStatus, - in byte[] pdu); - - /** - * Update the specified message on the ICC. - * - * @param messageIndex record index of message to update - * @param newStatus new message status (STATUS_ON_ICC_READ, - * STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, - * STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE) - * @param pdu the raw PDU to store * @param subId the subId id. * @return success or not * @@ -84,17 +63,6 @@ interface ISms { * @param pdu the raw PDU to store * @param status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, * STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT) - * @return success or not - * - */ - boolean copyMessageToIccEf(String callingPkg, int status, in byte[] pdu, in byte[] smsc); - - /** - * Copy a raw SMS PDU to the ICC. - * - * @param pdu the raw PDU to store - * @param status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, - * STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT) * @param subId the subId id. * @return success or not * @@ -124,12 +92,14 @@ interface ISms { * @param deliveryIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is delivered to the recipient. The * raw pdu of the status report is in the extended data ("pdu"). + * @param subId the subId id. */ - void sendData(String callingPkg, in String destAddr, in String scAddr, in int destPort, - in byte[] data, in PendingIntent sentIntent, in PendingIntent deliveryIntent); + void sendDataForSubscriber(int subId, String callingPkg, in String destAddr, + in String scAddr, in int destPort, in byte[] data, in PendingIntent sentIntent, + in PendingIntent deliveryIntent); /** - * Send a data SMS. + * Send a data SMS. Only for use internally. * * @param smsc the SMSC to send the message through, or NULL for the * default SMSC @@ -152,7 +122,7 @@ interface ISms { * raw pdu of the status report is in the extended data ("pdu"). * @param subId the subId id. */ - void sendDataForSubscriber(int subId, String callingPkg, in String destAddr, + void sendDataForSubscriberWithSelfPermissions(int subId, String callingPkg, in String destAddr, in String scAddr, in int destPort, in byte[] data, in PendingIntent sentIntent, in PendingIntent deliveryIntent); @@ -178,12 +148,14 @@ interface ISms { * @param deliveryIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is delivered to the recipient. The * raw pdu of the status report is in the extended data ("pdu"). + * @param subId the subId on which the SMS has to be sent. */ - void sendText(String callingPkg, in String destAddr, in String scAddr, in String text, - in PendingIntent sentIntent, in PendingIntent deliveryIntent); + void sendTextForSubscriber(in int subId, String callingPkg, in String destAddr, + in String scAddr, in String text, in PendingIntent sentIntent, + in PendingIntent deliveryIntent); /** - * Send an SMS. + * Send an SMS. Internal use only. * * @param smsc the SMSC to send the message through, or NULL for the * default SMSC @@ -206,13 +178,14 @@ interface ISms { * raw pdu of the status report is in the extended data ("pdu"). * @param subId the subId on which the SMS has to be sent. */ - void sendTextForSubscriber(in int subId, String callingPkg, in String destAddr, - in String scAddr, in String text, in PendingIntent sentIntent, + void sendTextForSubscriberWithSelfPermissions(in int subId, String callingPkg, + in String destAddr, in String scAddr, in String text, in PendingIntent sentIntent, in PendingIntent deliveryIntent); /** * Inject an SMS PDU into the android platform. * + * @param subId the subId on which the SMS has to be injected. * @param pdu is the byte array of pdu to be injected into android application framework * @param format is the format of SMS pdu (android.telephony.SmsMessage.FORMAT_3GPP or * android.telephony.SmsMessage.FORMAT_3GPP2) @@ -221,33 +194,8 @@ interface ISms { * android application framework. This intent is broadcasted at * the same time an SMS received from radio is acknowledged back. */ - void injectSmsPdu(in byte[] pdu, String format, in PendingIntent receivedIntent); - - /** - * Send a multi-part text based SMS. - * - * @param destinationAddress the address to send the message to - * @param scAddress is the service center address or null to use - * the current default SMSC - * @param parts an <code>ArrayList</code> of strings that, in order, - * comprise the original message - * @param sentIntents if not null, an <code>ArrayList</code> of - * <code>PendingIntent</code>s (one for each message part) that is - * broadcast when the corresponding message part has been sent. - * The result code will be <code>Activity.RESULT_OK<code> for success, - * or one of these errors: - * <code>RESULT_ERROR_GENERIC_FAILURE</code> - * <code>RESULT_ERROR_RADIO_OFF</code> - * <code>RESULT_ERROR_NULL_PDU</code>. - * @param deliveryIntents if not null, an <code>ArrayList</code> of - * <code>PendingIntent</code>s (one for each message part) that is - * broadcast when the corresponding message part has been delivered - * to the recipient. The raw pdu of the status report is in the - * extended data ("pdu"). - */ - void sendMultipartText(String callingPkg, in String destinationAddress, in String scAddress, - in List<String> parts, in List<PendingIntent> sentIntents, - in List<PendingIntent> deliveryIntents); + void injectSmsPduForSubscriber( + int subId, in byte[] pdu, String format, in PendingIntent receivedIntent); /** * Send a multi-part text based SMS. @@ -286,31 +234,13 @@ interface ISms { * * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #disableCellBroadcast(int, int) - */ - boolean enableCellBroadcast(int messageIdentifier, int ranType); - - /** - * Enable reception of cell broadcast (SMS-CB) messages with the given - * message identifier and RAN type. The RAN type specify this message ID - * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients - * enable the same message identifier, they must both disable it for the - * device to stop receiving those messages. - * - * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) * @param subId for which the broadcast has to be enabled * @param ranType as defined in class SmsManager, the value can be one of these: * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #disableCellBroadcast(int, int) + * @see #disableCellBroadcastForSubscriber(int, int, int) */ boolean enableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType); @@ -323,56 +253,18 @@ interface ISms { * * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #enableCellBroadcast(int, int) - */ - boolean disableCellBroadcast(int messageIdentifier, int ranType); - - /** - * Disable reception of cell broadcast (SMS-CB) messages with the given - * message identifier and RAN type. The RAN type specify this message ID - * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients - * enable the same message identifier, they must both disable it for the - * device to stop receiving those messages. - * - * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) * @param subId for which the broadcast has to be disabled * @param ranType as defined in class SmsManager, the value can be one of these: * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #enableCellBroadcast(int, int) + * @see #enableCellBroadcastForSubscriber(int, int, int) */ boolean disableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType); /* * Enable reception of cell broadcast (SMS-CB) messages with the given - * message identifier range and RAN type. The RAN type specify this message - * ID range belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different - * clients enable a message identifier range, they must both disable it for - * the device to stop receiving those messages. - * - * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #disableCellBroadcastRange(int, int, int) - */ - boolean enableCellBroadcastRange(int startMessageId, int endMessageId, int ranType); - - /* - * Enable reception of cell broadcast (SMS-CB) messages with the given * message identifier range and RAN type. The RAN type specify this message ID range * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable * a message identifier range, they must both disable it for the device @@ -388,7 +280,7 @@ interface ISms { * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #disableCellBroadcastRange(int, int, int) + * @see #disableCellBroadcastRangeForSubscriber(int, int, int, int) */ boolean enableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType); @@ -404,33 +296,13 @@ interface ISms { * C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) - * @param ranType as defined in class SmsManager, the value can be one of these: - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM - * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA - * @return true if successful, false otherwise - * - * @see #enableCellBroadcastRange(int, int, int) - */ - boolean disableCellBroadcastRange(int startMessageId, int endMessageId, int ranType); - - /** - * Disable reception of cell broadcast (SMS-CB) messages with the given - * message identifier range and RAN type. The RAN type specify this message ID range - * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable - * a message identifier range, they must both disable it for the device - * to stop receiving those messages. - * - * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) - * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or - * C.R1001-G (3GPP2) * @param subId for which the broadcast has to be disabled * @param ranType as defined in class SmsManager, the value can be one of these: * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA * @return true if successful, false otherwise * - * @see #enableCellBroadcastRange(int, int, int, int) + * @see #enableCellBroadcastRangeForSubscriber(int, int, int, int) */ boolean disableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType); @@ -462,20 +334,10 @@ interface ISms { /** * SMS over IMS is supported if IMS is registered and SMS is supported * on IMS. - * - * @return true if SMS over IMS is supported, false otherwise - * - * @see #getImsSmsFormat() - */ - boolean isImsSmsSupported(); - - /** - * SMS over IMS is supported if IMS is registered and SMS is supported - * on IMS. * @param subId for subId which isImsSmsSupported is queried * @return true if SMS over IMS is supported, false otherwise * - * @see #getImsSmsFormat() + * @see #getImsSmsFormatForSubscriber(int) */ boolean isImsSmsSupportedForSubscriber(int subId); @@ -496,24 +358,12 @@ interface ISms { /** * Gets SMS format supported on IMS. SMS over IMS format is * either 3GPP or 3GPP2. - * - * @return android.telephony.SmsMessage.FORMAT_3GPP, - * android.telephony.SmsMessage.FORMAT_3GPP2 - * or android.telephony.SmsMessage.FORMAT_UNKNOWN - * - * @see #isImsSmsSupported() - */ - String getImsSmsFormat(); - - /** - * Gets SMS format supported on IMS. SMS over IMS format is - * either 3GPP or 3GPP2. * @param subId for subId which getImsSmsFormat is queried * @return android.telephony.SmsMessage.FORMAT_3GPP, * android.telephony.SmsMessage.FORMAT_3GPP2 * or android.telephony.SmsMessage.FORMAT_UNKNOWN * - * @see #isImsSmsSupported() + * @see #isImsSmsSupportedForSubscriber(int) */ String getImsSmsFormatForSubscriber(int subId); diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index acbc0aa..0555121 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -22,42 +22,48 @@ import com.android.internal.telephony.ISubscriptionListener; interface ISub { /** + * @param callingPackage The package maing the call. * @return a list of all subscriptions in the database, this includes * all subscriptions that have been seen. */ - List<SubscriptionInfo> getAllSubInfoList(); + List<SubscriptionInfo> getAllSubInfoList(String callingPackage); /** + * @param callingPackage The package maing the call. * @return the count of all subscriptions in the database, this includes * all subscriptions that have been seen. */ - int getAllSubInfoCount(); + int getAllSubInfoCount(String callingPackage); /** * Get the active SubscriptionInfo with the subId key * @param subId The unique SubscriptionInfo key in database + * @param callingPackage The package maing the call. * @return SubscriptionInfo, maybe null if its not active */ - SubscriptionInfo getActiveSubscriptionInfo(int subId); + SubscriptionInfo getActiveSubscriptionInfo(int subId, String callingPackage); /** * Get the active SubscriptionInfo associated with the iccId * @param iccId the IccId of SIM card + * @param callingPackage The package maing the call. * @return SubscriptionInfo, maybe null if its not active */ - SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId); + SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId, String callingPackage); /** * Get the active SubscriptionInfo associated with the slotIdx * @param slotIdx the slot which the subscription is inserted + * @param callingPackage The package maing the call. * @return SubscriptionInfo, maybe null if its not active */ - SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx); + SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx, String callingPackage); /** * Get the SubscriptionInfo(s) of the active subscriptions. The records will be sorted * by {@link SubscriptionInfo#getSimSlotIndex} then by {@link SubscriptionInfo#getSubscriptionId}. * + * @param callingPackage The package maing the call. * @return Sorted list of the currently {@link SubscriptionInfo} records available on the device. * <ul> * <li> @@ -74,12 +80,13 @@ interface ISub { * </li> * </ul> */ - List<SubscriptionInfo> getActiveSubscriptionInfoList(); + List<SubscriptionInfo> getActiveSubscriptionInfoList(String callingPackage); /** + * @param callingPackage The package making the call. * @return the number of active subscriptions */ - int getActiveSubInfoCount(); + int getActiveSubInfoCount(String callingPackage); /** * @return the maximum number of subscriptions this device will support at any one time. @@ -166,9 +173,10 @@ interface ISub { int[] getActiveSubIdList(); /** - * Get the SIM state for the subscriber + * Get the SIM state for the slot idx * @return SIM state as the ordinal of IccCardConstants.State */ - int getSimStateForSubscriber(int subId); + int getSimStateForSlotIdx(int slotIdx); + boolean isActiveSubId(int subId); } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index bf3ee09..6db88a7 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -18,10 +18,14 @@ package com.android.internal.telephony; import android.content.Intent; import android.os.Bundle; +import android.telecom.PhoneAccount; import android.telephony.CellInfo; import android.telephony.IccOpenLogicalChannelResponse; import android.telephony.NeighboringCellInfo; import android.telephony.RadioAccessFamily; +import android.telephony.ModemActivityInfo; +import com.android.internal.telephony.CellNetworkScanResult; +import com.android.internal.telephony.OperatorInfo; import java.util.List; @@ -44,6 +48,7 @@ interface ITelephony { /** * Place a call to the specified number. + * @param callingPackage The package making the call. * @param number the number to be called. */ void call(String callingPackage, String number); @@ -111,65 +116,74 @@ interface ITelephony { /** * Check if we are in either an active or holding call + * @param callingPackage the name of the package making the call. * @return true if the phone state is OFFHOOK. */ - boolean isOffhook(); + boolean isOffhook(String callingPackage); /** * Check if a particular subId has an active or holding call * * @param subId user preferred subId. + * @param callingPackage the name of the package making the call. * @return true if the phone state is OFFHOOK. */ - boolean isOffhookForSubscriber(int subId); + boolean isOffhookForSubscriber(int subId, String callingPackage); /** * Check if an incoming phone call is ringing or call waiting * on a particular subId. * * @param subId user preferred subId. + * @param callingPackage the name of the package making the call. * @return true if the phone state is RINGING. */ - boolean isRingingForSubscriber(int subId); + boolean isRingingForSubscriber(int subId, String callingPackage); /** * Check if an incoming phone call is ringing or call waiting. + * @param callingPackage the name of the package making the call. * @return true if the phone state is RINGING. */ - boolean isRinging(); + boolean isRinging(String callingPackage); /** * Check if the phone is idle. + * @param callingPackage the name of the package making the call. * @return true if the phone state is IDLE. */ - boolean isIdle(); + boolean isIdle(String callingPackage); /** * Check if the phone is idle on a particular subId. * * @param subId user preferred subId. + * @param callingPackage the name of the package making the call. * @return true if the phone state is IDLE. */ - boolean isIdleForSubscriber(int subId); + boolean isIdleForSubscriber(int subId, String callingPackage); /** * Check to see if the radio is on or not. + * @param callingPackage the name of the package making the call. * @return returns true if the radio is on. */ - boolean isRadioOn(); + boolean isRadioOn(String callingPackage); /** * Check to see if the radio is on or not on particular subId. * @param subId user preferred subId. + * @param callingPackage the name of the package making the call. * @return returns true if the radio is on. */ - boolean isRadioOnForSubscriber(int subId); + boolean isRadioOnForSubscriber(int subId, String callingPackage); /** * Check if the SIM pin lock is enabled. * @return true if the SIM pin lock is enabled. + * @param callingPackage The package making the call. */ - boolean isSimPinEnabled(); + boolean isSimPinEnabled(String callingPackage); /** * Supply a pin to unlock the SIM. Blocks until a result is determined. @@ -340,7 +354,7 @@ interface ITelephony { */ boolean isDataConnectivityPossible(); - Bundle getCellLocation(); + Bundle getCellLocation(String callingPkg); /** * Returns the neighboring cell information of the device. @@ -374,40 +388,46 @@ interface ITelephony { /** * Returns the CDMA ERI icon index to display + * @param callingPackage package making the call. */ - int getCdmaEriIconIndex(); + int getCdmaEriIconIndex(String callingPackage); /** * Returns the CDMA ERI icon index to display on particular subId. * @param subId user preferred subId. + * @param callingPackage package making the call. */ - int getCdmaEriIconIndexForSubscriber(int subId); + int getCdmaEriIconIndexForSubscriber(int subId, String callingPackage); /** * Returns the CDMA ERI icon mode, * 0 - ON * 1 - FLASHING + * @param callingPackage package making the call. */ - int getCdmaEriIconMode(); + int getCdmaEriIconMode(String callingPackage); /** * Returns the CDMA ERI icon mode on particular subId, * 0 - ON * 1 - FLASHING * @param subId user preferred subId. + * @param callingPackage package making the call. */ - int getCdmaEriIconModeForSubscriber(int subId); + int getCdmaEriIconModeForSubscriber(int subId, String callingPackage); /** * Returns the CDMA ERI text, + * @param callingPackage package making the call. */ - String getCdmaEriText(); + String getCdmaEriText(String callingPackage); /** * Returns the CDMA ERI text for particular subId, * @param subId user preferred subId. + * @param callingPackage package making the call. */ - String getCdmaEriTextForSubscriber(int subId); + String getCdmaEriTextForSubscriber(int subId, String callingPackage); /** * Returns true if OTA service provisioning needs to run. @@ -434,28 +454,30 @@ interface ITelephony { int getVoiceMessageCountForSubscriber(int subId); /** - * Returns the network type for data transmission - */ - int getNetworkType(); + * Returns the network type for data transmission + * @param callingPackage package making the call. + */ + int getNetworkType(String callingPackage); /** * Returns the network type of a subId. * @param subId user preferred subId. - * Returns the network type + * @param callingPackage package making the call. */ - int getNetworkTypeForSubscriber(int subId); + int getNetworkTypeForSubscriber(int subId, String callingPackage); /** - * Returns the network type for data transmission - */ - int getDataNetworkType(); + * Returns the network type for data transmission + * @param callingPackage package making the call. + */ + int getDataNetworkType(String callingPackage); /** - * Returns the data network type of a subId - * @param subId user preferred subId. - * Returns the network type - */ - int getDataNetworkTypeForSubscriber(int subId); + * Returns the data network type of a subId + * @param subId user preferred subId. + * @param callingPackage package making the call. + */ + int getDataNetworkTypeForSubscriber(int subId, String callingPackage); /** * Returns the network type for voice @@ -486,25 +508,27 @@ interface ITelephony { * is a tri-state return value as for a period of time * the mode may be unknown. * + * @param callingPackage the name of the calling package * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} * or {@link PHone#LTE_ON_CDMA_TRUE} */ - int getLteOnCdmaMode(); + int getLteOnCdmaMode(String callingPackage); /** * Return if the current radio is LTE on CDMA. This * is a tri-state return value as for a period of time * the mode may be unknown. * + * @param callingPackage the name of the calling package * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} * or {@link PHone#LTE_ON_CDMA_TRUE} */ - int getLteOnCdmaModeForSubscriber(int subId); + int getLteOnCdmaModeForSubscriber(int subId, String callingPackage); /** * Returns the all observed cell information of the device. */ - List<CellInfo> getAllCellInfo(); + List<CellInfo> getAllCellInfo(String callingPkg); /** * Sets minimum time in milli-seconds between onCellInfoChanged @@ -643,18 +667,20 @@ interface ITelephony { /* * Get the calculated preferred network type. * Used for device configuration by some CDMA operators. + * @param callingPackage The package making the call. * * @return the calculated preferred network type, defined in RILConstants.java. */ - int getCalculatedPreferredNetworkType(); + int getCalculatedPreferredNetworkType(String callingPackage); /* * Get the preferred network type. * Used for device configuration by some CDMA operators. * + * @param subId the id of the subscription to query. * @return the preferred network type, defined in RILConstants.java. */ - int getPreferredNetworkType(); + int getPreferredNetworkType(int subId); /** * Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning @@ -666,13 +692,38 @@ interface ITelephony { int getTetherApnRequired(); /** + * Set the network selection mode to automatic. + * + * @param subId the id of the subscription to update. + */ + void setNetworkSelectionModeAutomatic(int subId); + + /** + * Perform a radio scan and return the list of avialble networks. + * + * @param subId the id of the subscription. + * @return CellNetworkScanResult containing status of scan and networks. + */ + CellNetworkScanResult getCellNetworkScanResults(int subId); + + /** + * Ask the radio to connect to the input network and change selection mode to manual. + * + * @param subId the id of the subscription. + * @param operatorInfo the operator to attach to. + * @return true if the request suceeded. + */ + boolean setNetworkSelectionModeManual(int subId, in OperatorInfo operator); + + /** * Set the preferred network type. * Used for device configuration by some CDMA operators. * + * @param subId the id of the subscription to update. * @param networkType the preferred network type, defined in RILConstants.java. * @return true on success; false on any failure. */ - boolean setPreferredNetworkType(int networkType); + boolean setPreferredNetworkType(int subId, int networkType); /** * User enable/disable Mobile Data. @@ -691,8 +742,9 @@ interface ITelephony { /** * Get P-CSCF address from PCO after data connection is established or modified. * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN + * @param callingPackage The package making the call. */ - String[] getPcscfAddress(String apnType); + String[] getPcscfAddress(String apnType, String callingPackage); /** * Set IMS registration state @@ -725,20 +777,26 @@ interface ITelephony { int getCarrierPrivilegeStatus(); /** - * Similar to above, but check for pkg whose name is pkgname. + * Similar to above, but check for the package whose name is pkgName. */ - int checkCarrierPrivilegesForPackage(String pkgname); + int checkCarrierPrivilegesForPackage(String pkgName); /** - * Returns the package name of the carrier apps that should handle the input intent. + * Similar to above, but check across all phones. + */ + int checkCarrierPrivilegesForPackageAnyPhone(String pkgName); + + /** + * Returns list of the package names of the carrier apps that should handle the input intent + * and have carrier privileges for the given phoneId. * - * @param packageManager PackageManager for getting receivers. * @param intent Intent that will be sent. - * @return list of carrier app package names that can handle the intent. + * @param phoneId The phoneId on which the carrier app has carrier privileges. + * @return list of carrier app package names that can handle the intent on phoneId. * Returns null if there is an error and an empty list if there * are no matching packages. */ - List<String> getCarrierPackageNamesForIntent(in Intent intent); + List<String> getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId); /** * Set the line 1 phone number string and its alphatag for the current ICCID @@ -758,21 +816,23 @@ interface ITelephony { * {@link #setLine1NumberForDisplay}. Otherwise returns null. * * @param subId whose dialing number for line 1 is returned. + * @param callingPackage The package making the call. * @return the displayed dialing number if set, or null if not set. */ - String getLine1NumberForDisplay(int subId); + String getLine1NumberForDisplay(int subId, String callingPackage); /** * Returns the displayed alphatag of the dialing number if it was set * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null. * * @param subId whose alphatag associated with line 1 is returned. + * @param callingPackage The package making the call. * @return the displayed alphatag of the dialing number if set, or null if * not set. */ - String getLine1AlphaTagForDisplay(int subId); + String getLine1AlphaTagForDisplay(int subId, String callingPackage); - String[] getMergedSubscriberIds(); + String[] getMergedSubscriberIds(String callingPackage); /** * Override the operator branding for the current ICCID. @@ -848,9 +908,10 @@ interface ITelephony { * Get phone radio type and access technology. * * @param phoneId which phone you want to get + * @param callingPackage the name of the package making the call * @return phone radio type and access technology */ - int getRadioAccessFamily(in int phoneId); + int getRadioAccessFamily(in int phoneId, String callingPackage); /** * Enables or disables video calling. @@ -862,21 +923,83 @@ interface ITelephony { /** * Whether video calling has been enabled by the user. * - * @return {@code True} if the user has enabled video calling, {@code false} otherwise. + * @param callingPackage The package making the call. + * @return {@code true} if the user has enabled video calling, {@code false} otherwise. + */ + boolean isVideoCallingEnabled(String callingPackage); + + /** + * Whether the DTMF tone length can be changed. + * + * @return {@code true} if the DTMF tone length can be changed. */ - boolean isVideoCallingEnabled(); + boolean canChangeDtmfToneLength(); /** + * Whether the device is a world phone. + * + * @return {@code true} if the devices is a world phone. + */ + boolean isWorldPhone(); + + /** + * Whether the phone supports TTY mode. + * + * @return {@code true} if the device supports TTY mode. + */ + boolean isTtyModeSupported(); + + /** + * Whether the phone supports hearing aid compatibility. + * + * @return {@code true} if the device supports hearing aid compatibility. + */ + boolean isHearingAidCompatibilitySupported(); + /** * Get IMS Registration Status */ boolean isImsRegistered(); /** + * Returns the Status of Wi-Fi Calling + *@hide + */ + boolean isWifiCallingEnabled(); + + /** + * Returns the Status of Volte + *@hide + */ + boolean isVolteEnabled(); + + /** * Returns the unique device ID of phone, for example, the IMEI for * GSM and the MEID for CDMA phones. Return null if device ID is not available. * + * @param callingPackage The package making the call. * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ - String getDeviceId(); + String getDeviceId(String callingPackage); + + /** + * Returns the subscription ID associated with the specified PhoneAccount. + */ + int getSubIdForPhoneAccount(in PhoneAccount phoneAccount); + + void factoryReset(int subId); + + /** + * An estimate of the users's current locale based on the default SIM. + * + * The returned string will be a well formed BCP-47 language tag, or {@code null} + * if no locale could be derived. + */ + String getLocaleFromDefaultSim(); + + /** + * Return the modem activity info. + *@hide + */ + ModemActivityInfo getModemActivityInfo(); } diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index 7d8a8d6..76b69ce 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -69,4 +69,5 @@ interface ITelephonyRegistry { void notifyVoLteServiceStateChanged(in VoLteServiceState lteState); void notifyOemHookRawEventForSubscriber(in int subId, in byte[] rawData); void notifySubscriptionInfoChanged(); + void notifyCarrierNetworkChange(in boolean active); } diff --git a/telephony/java/com/android/internal/telephony/OperatorInfo.java b/telephony/java/com/android/internal/telephony/OperatorInfo.java new file mode 100644 index 0000000..a29d7c1 --- /dev/null +++ b/telephony/java/com/android/internal/telephony/OperatorInfo.java @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2006 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.Parcel; +import android.os.Parcelable; + +/** + * {@hide} + */ +public class OperatorInfo implements Parcelable { + public enum State { + UNKNOWN, + AVAILABLE, + CURRENT, + FORBIDDEN; + } + + private String mOperatorAlphaLong; + private String mOperatorAlphaShort; + private String mOperatorNumeric; + + private State mState = State.UNKNOWN; + + + public String + getOperatorAlphaLong() { + return mOperatorAlphaLong; + } + + public String + getOperatorAlphaShort() { + return mOperatorAlphaShort; + } + + public String + getOperatorNumeric() { + return mOperatorNumeric; + } + + public State + getState() { + return mState; + } + + OperatorInfo(String operatorAlphaLong, + String operatorAlphaShort, + String operatorNumeric, + State state) { + + mOperatorAlphaLong = operatorAlphaLong; + mOperatorAlphaShort = operatorAlphaShort; + mOperatorNumeric = operatorNumeric; + + mState = state; + } + + + public OperatorInfo(String operatorAlphaLong, + String operatorAlphaShort, + String operatorNumeric, + String stateString) { + this (operatorAlphaLong, operatorAlphaShort, + operatorNumeric, rilStateToState(stateString)); + } + + public OperatorInfo(String operatorAlphaLong, + String operatorAlphaShort, + String operatorNumeric) { + this(operatorAlphaLong, operatorAlphaShort, operatorNumeric, State.UNKNOWN); + } + + /** + * See state strings defined in ril.h RIL_REQUEST_QUERY_AVAILABLE_NETWORKS + */ + private static State rilStateToState(String s) { + if (s.equals("unknown")) { + return State.UNKNOWN; + } else if (s.equals("available")) { + return State.AVAILABLE; + } else if (s.equals("current")) { + return State.CURRENT; + } else if (s.equals("forbidden")) { + return State.FORBIDDEN; + } else { + throw new RuntimeException( + "RIL impl error: Invalid network state '" + s + "'"); + } + } + + + @Override + public String toString() { + return "OperatorInfo " + mOperatorAlphaLong + + "/" + mOperatorAlphaShort + + "/" + mOperatorNumeric + + "/" + mState; + } + + /** + * Parcelable interface implemented below. + * This is a simple effort to make OperatorInfo parcelable rather than + * trying to make the conventional containing object (AsyncResult), + * implement parcelable. This functionality is needed for the + * NetworkQueryService to fix 1128695. + */ + + @Override + public int describeContents() { + return 0; + } + + /** + * Implement the Parcelable interface. + * Method to serialize a OperatorInfo object. + */ + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(mOperatorAlphaLong); + dest.writeString(mOperatorAlphaShort); + dest.writeString(mOperatorNumeric); + dest.writeSerializable(mState); + } + + /** + * Implement the Parcelable interface + * Method to deserialize a OperatorInfo object, or an array thereof. + */ + public static final Creator<OperatorInfo> CREATOR = + new Creator<OperatorInfo>() { + @Override + public OperatorInfo createFromParcel(Parcel in) { + OperatorInfo opInfo = new OperatorInfo( + in.readString(), /*operatorAlphaLong*/ + in.readString(), /*operatorAlphaShort*/ + in.readString(), /*operatorNumeric*/ + (State) in.readSerializable()); /*state*/ + return opInfo; + } + + @Override + public OperatorInfo[] newArray(int size) { + return new OperatorInfo[size]; + } + }; +} diff --git a/telephony/java/com/android/internal/telephony/PhoneConstants.java b/telephony/java/com/android/internal/telephony/PhoneConstants.java index b8e8064..2a4032c 100644 --- a/telephony/java/com/android/internal/telephony/PhoneConstants.java +++ b/telephony/java/com/android/internal/telephony/PhoneConstants.java @@ -150,6 +150,10 @@ public class PhoneConstants { public static final String SLOT_KEY = "slot"; + /** Fired when a subscriptions phone state changes. */ + public static final String ACTION_SUBSCRIPTION_PHONE_STATE_CHANGED = + "android.intent.action.SUBSCRIPTION_PHONE_STATE"; + // FIXME: This is used to pass a subId via intents, we need to look at its usage, which is // FIXME: extensive, and see if this should be an array of all active subId's or ...? public static final String SUBSCRIPTION_KEY = "subscription"; @@ -186,4 +190,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..8d48c86 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,10 @@ 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_REQUEST_GET_ACTIVITY_INFO = 135; int RIL_UNSOL_RESPONSE_BASE = 1000; int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000; @@ -354,4 +371,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..f563839 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java +++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java @@ -16,8 +16,6 @@ package com.android.internal.telephony; -import android.content.Intent; - /** * The intents that the telephony services broadcast. * @@ -319,6 +317,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"; } |