diff options
Diffstat (limited to 'telephony/java')
12 files changed, 67 insertions, 80 deletions
diff --git a/telephony/java/Android.bp b/telephony/java/Android.bp new file mode 100644 index 000000000000..3941b300206f --- /dev/null +++ b/telephony/java/Android.bp @@ -0,0 +1,18 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + // SPDX-license-identifier-BSD + default_applicable_licenses: ["frameworks_base_license"], +} + +filegroup { + name: "framework-telephony-sources", + srcs: [ + "**/*.java", + "**/*.aidl", + ], + visibility: ["//frameworks/base"], +} diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index bdb8355b532a..55241cb199aa 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -4924,14 +4924,15 @@ public class CarrierConfigManager { /** * Determines whether or not to use (IP) data connectivity as a supplemental condition to * control the visibility of the no-calling indicator for this carrier in the System UI. Setting - * the configuration to true may make sense to a carrier which provides OTT calling. + * the configuration to true may make sense for carriers that provide OTT calling. * - * Config = true: do not show no-calling indication if (IP) data connectivity is available - * or telephony has voice registration. - * Config = false: do not show no-calling indication if telephony has voice registration. + * Config = true: show no-calling indication only if telephony does not have voice registration + * and if no (IP) data connectivity is available. + * Config = false: show no-calling indication only if telephony does not have voice + * registration. */ - public static final String KEY_HIDE_NO_CALLING_INDICATOR_ON_DATA_NETWORK_BOOL = - "hide_no_calling_indicator_on_data_network_bool"; + public static final String KEY_USE_IP_FOR_CALLING_INDICATOR_BOOL = + "use_ip_for_calling_indicator_bool"; /** * Determine whether or not to display a call strength indicator for this carrier in the System @@ -5554,7 +5555,7 @@ public class CarrierConfigManager { sDefaults.putStringArray(KEY_MISSED_INCOMING_CALL_SMS_ORIGINATOR_STRING_ARRAY, new String[0]); sDefaults.putStringArray(KEY_APN_PRIORITY_STRING_ARRAY, new String[] { - "default:0", "enterprise:1", "mms:2", "supl:2", "dun:2", "hipri:3", "fota:2", + "enterprise:0", "default:1", "mms:2", "supl:2", "dun:2", "hipri:3", "fota:2", "ims:2", "cbs:2", "ia:2", "emergency:2", "mcx:3", "xcap:3" }); sDefaults.putStringArray(KEY_MISSED_INCOMING_CALL_SMS_PATTERN_STRING_ARRAY, new String[0]); @@ -5571,7 +5572,7 @@ public class CarrierConfigManager { sDefaults.putStringArray(KEY_ALLOWED_INITIAL_ATTACH_APN_TYPES_STRING_ARRAY, new String[]{"ia", "default", "ims", "mms", "dun", "emergency"}); sDefaults.putBoolean(KEY_CARRIER_PROVISIONS_WIFI_MERGED_NETWORKS_BOOL, false); - sDefaults.putBoolean(KEY_HIDE_NO_CALLING_INDICATOR_ON_DATA_NETWORK_BOOL, false); + sDefaults.putBoolean(KEY_USE_IP_FOR_CALLING_INDICATOR_BOOL, false); sDefaults.putBoolean(KEY_DISPLAY_CALL_STRENGTH_INDICATOR_BOOL, true); sDefaults.putString(KEY_CARRIER_PROVISIONING_APP_STRING, ""); sDefaults.putBoolean(KEY_DISPLAY_NO_DATA_NOTIFICATION_ON_PERMANENT_FAILURE_BOOL, false); diff --git a/telephony/java/android/telephony/PreciseDataConnectionState.java b/telephony/java/android/telephony/PreciseDataConnectionState.java index 9ea624b60988..ce2f3f924554 100644 --- a/telephony/java/android/telephony/PreciseDataConnectionState.java +++ b/telephony/java/android/telephony/PreciseDataConnectionState.java @@ -166,14 +166,12 @@ public final class PreciseDataConnectionState implements Parcelable { /** * @return The unique id of the data connection * - * Note this is the id assigned in {@link DataCallResponse}. + * Note this is the id assigned by the data service. * The id remains the same for data connection handover between * {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN} and * {@link AccessNetworkConstants#TRANSPORT_TYPE_WWAN} * - * @hide */ - @SystemApi public int getId() { return mId; } diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index 6441565d731b..4004e37dc4e0 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -151,13 +151,14 @@ public class SubscriptionInfo implements Parcelable { /** * The access rules for this subscription, if it is embedded and defines any. + * This does not include access rules for non-embedded subscriptions. */ @Nullable private UiccAccessRule[] mNativeAccessRules; /** * The carrier certificates for this subscription that are saved in carrier configs. - * The other carrier certificates are embedded on Uicc and stored as part of mNativeAccessRules. + * This does not include access rules from the Uicc, whether embedded or non-embedded. */ @Nullable private UiccAccessRule[] mCarrierConfigAccessRules; @@ -664,7 +665,6 @@ public class SubscriptionInfo implements Parcelable { * is authorized to manage this subscription. * TODO and fix it properly in R / master: either deprecate this and have 3 APIs * native + carrier + all, or have this return all by default. - * @throws UnsupportedOperationException if this subscription is not embedded. * @hide */ @SystemApi diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 67fe783ee7a4..d8ac08298530 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -2633,7 +2633,10 @@ public class SubscriptionManager { if (subInfo != null) { overrideConfig.mcc = subInfo.getMcc(); overrideConfig.mnc = subInfo.getMnc(); - if (overrideConfig.mnc == 0) overrideConfig.mnc = Configuration.MNC_ZERO; + if (overrideConfig.mnc == 0) { + overrideConfig.mnc = Configuration.MNC_ZERO; + cacheKey = null; + } } if (useRootLocale) { @@ -2867,6 +2870,10 @@ public class SubscriptionManager { * Checks whether the app with the given context is authorized to manage the given subscription * according to its metadata. * + * Only supported for embedded subscriptions (if {@link SubscriptionInfo#isEmbedded} returns + * true). To check for permissions for non-embedded subscription as well, + * {@see android.telephony.TelephonyManager#hasCarrierPrivileges}. + * * @param info The subscription to check. * @return whether the app is authorized to manage this subscription per its metadata. */ @@ -2879,6 +2886,10 @@ public class SubscriptionManager { * be authorized if it is included in the {@link android.telephony.UiccAccessRule} of the * {@link android.telephony.SubscriptionInfo} with the access status. * + * Only supported for embedded subscriptions (if {@link SubscriptionInfo#isEmbedded} returns + * true). To check for permissions for non-embedded subscription as well, + * {@see android.telephony.TelephonyManager#hasCarrierPrivileges}. + * * @param info The subscription to check. * @param packageName Package name of the app to check. * @return whether the app is authorized to manage this subscription per its access rules. @@ -3482,8 +3493,8 @@ public class SubscriptionManager { * @param subscriptionId the unique Subscription ID in database */ @RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE) - public void setDeviceToDeviceStatusSharingPreference( - @DeviceToDeviceStatusSharingPreference int sharing, int subscriptionId) { + public void setDeviceToDeviceStatusSharingPreference(int subscriptionId, + @DeviceToDeviceStatusSharingPreference int sharing) { if (VDBG) { logd("[setDeviceToDeviceStatusSharing] + sharing: " + sharing + " subId: " + subscriptionId); @@ -3514,8 +3525,8 @@ public class SubscriptionManager { * @param subscriptionId The unique Subscription ID in database */ @RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE) - public void setDeviceToDeviceStatusSharingContacts(@NonNull List<Uri> contacts, - int subscriptionId) { + public void setDeviceToDeviceStatusSharingContacts(int subscriptionId, + @NonNull List<Uri> contacts) { String contactString = serializeUriLists(contacts); if (VDBG) { logd("[setDeviceToDeviceStatusSharingContacts] + contacts: " + contactString diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index c98ce78adc53..b3886c274ae4 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1907,14 +1907,14 @@ public class TelephonyManager { * the IMEI/SV for GSM phones. Return null if the software version is * not available. * <p> - * Requires Permission: READ_PRIVILEGED_PHONE_STATE. + * Requires Permission: READ_PHONE_STATE. * * @param slotIndex of which deviceID is returned * * @hide */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @Nullable public String getDeviceSoftwareVersion(int slotIndex) { ITelephony telephony = getITelephony(); @@ -8974,6 +8974,9 @@ public class TelephonyManager { * call will return true. This access is granted by the owner of the UICC * card and does not depend on the registered carrier. * + * Note that this API applies to both physical and embedded subscriptions and + * is a superset of the checks done in SubscriptionManager#canManageSubscription. + * * @return true if the app has carrier privileges. */ public boolean hasCarrierPrivileges() { @@ -8987,6 +8990,9 @@ public class TelephonyManager { * call will return true. This access is granted by the owner of the UICC * card and does not depend on the registered carrier. * + * Note that this API applies to both physical and embedded subscriptions and + * is a superset of the checks done in SubscriptionManager#canManageSubscription. + * * @param subId The subscription to use. * @return true if the app has carrier privileges. * @hide diff --git a/telephony/java/android/telephony/ims/RcsContactUceCapability.java b/telephony/java/android/telephony/ims/RcsContactUceCapability.java index a133eadb3517..acfa13380948 100644 --- a/telephony/java/android/telephony/ims/RcsContactUceCapability.java +++ b/telephony/java/android/telephony/ims/RcsContactUceCapability.java @@ -282,20 +282,6 @@ public final class RcsContactUceCapability implements Parcelable { * <p> * Note: this is only populated if {@link #getCapabilityMechanism} is * {@link RcsContactUceCapability#CAPABILITY_MECHANISM_OPTIONS} - * @hide - */ - public @NonNull List<String> getOptionsFeatureTags() { - if (mCapabilityMechanism != CAPABILITY_MECHANISM_OPTIONS) { - return Collections.emptyList(); - } - return Collections.unmodifiableList(new ArrayList<>(mFeatureTags)); - } - - /** - * @return The feature tags present in the OPTIONS response from the network. - * <p> - * Note: this is only populated if {@link #getCapabilityMechanism} is - * {@link RcsContactUceCapability#CAPABILITY_MECHANISM_OPTIONS} */ public @NonNull Set<String> getFeatureTags() { if (mCapabilityMechanism != CAPABILITY_MECHANISM_OPTIONS) { diff --git a/telephony/java/android/telephony/ims/SipMessage.java b/telephony/java/android/telephony/ims/SipMessage.java index ad6d73c39962..b5295637d4dd 100644 --- a/telephony/java/android/telephony/ims/SipMessage.java +++ b/telephony/java/android/telephony/ims/SipMessage.java @@ -24,6 +24,7 @@ import android.annotation.SystemApi; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; +import android.text.TextUtils; import com.android.internal.telephony.SipMessageParsingUtils; @@ -60,14 +61,19 @@ public final class SipMessage implements Parcelable { */ public SipMessage(@NonNull String startLine, @NonNull String headerSection, @NonNull byte[] content) { - if (startLine == null || headerSection == null || content == null) { - throw new IllegalArgumentException("One or more null parameters entered"); - } + Objects.requireNonNull(startLine, "Required parameter is null: startLine"); + Objects.requireNonNull(headerSection, "Required parameter is null: headerSection"); + Objects.requireNonNull(content, "Required parameter is null: content"); + mStartLine = startLine; mHeaderSection = headerSection; mContent = content; mViaBranchParam = SipMessageParsingUtils.getTransactionId(mHeaderSection); + if (TextUtils.isEmpty(mViaBranchParam)) { + throw new IllegalArgumentException("header section MUST contain a branch parameter " + + "inside of the Via header."); + } mCallIdParam = SipMessageParsingUtils.getCallId(mHeaderSection); } @@ -107,11 +113,9 @@ public final class SipMessage implements Parcelable { /** * @return the branch parameter enclosed in the Via header key's value. See RFC 3261 section - * 20.42 for more information on the Via header. If {@code null}, then there was either no - * Via parameter found in this SIP message's headers or no branch parameter found in the - * Via header. + * 20.42 for more information on the Via header. */ - public @Nullable String getViaBranchParameter() { + public @NonNull String getViaBranchParameter() { return mViaBranchParam; } diff --git a/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java b/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java index 739946be2e5b..5c9ec53d713b 100644 --- a/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java +++ b/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java @@ -28,8 +28,6 @@ import android.telephony.ims.SipDelegateImsConfiguration; import android.telephony.ims.SipDelegateManager; import android.telephony.ims.SipMessage; import android.telephony.ims.stub.SipDelegate; -import android.text.TextUtils; -import android.util.Log; import java.util.ArrayList; import java.util.Set; @@ -187,11 +185,6 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe private void notifyLocalMessageFailedToBeReceived(SipMessage m, int reason) { String transactionId = m.getViaBranchParameter(); - if (TextUtils.isEmpty(transactionId)) { - Log.w(LOG_TAG, "failure to parse SipMessage."); - throw new IllegalArgumentException("Malformed SipMessage, can not determine " - + "transaction ID."); - } SipDelegate d = mDelegate; if (d != null) { mExecutor.execute(() -> d.notifyMessageReceiveError(transactionId, reason)); diff --git a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java index 3cd27264295c..ad02fe55902f 100644 --- a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java +++ b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java @@ -28,7 +28,6 @@ import android.telephony.ims.SipMessage; import android.telephony.ims.stub.DelegateConnectionMessageCallback; import android.telephony.ims.stub.DelegateConnectionStateCallback; import android.telephony.ims.stub.SipDelegate; -import android.text.TextUtils; import android.util.ArraySet; import android.util.Log; @@ -267,12 +266,6 @@ public class SipDelegateConnectionAidlWrapper implements SipDelegateConnection, private void notifyLocalMessageFailedToSend(SipMessage m, int reason) { String transactionId = m.getViaBranchParameter(); - if (TextUtils.isEmpty(transactionId)) { - Log.w(LOG_TAG, "sendMessage detected a malformed SipMessage and can not get a " - + "transaction ID."); - throw new IllegalArgumentException("Could not send SipMessage due to malformed header"); - } - mExecutor.execute(() -> - mMessageCallback.onMessageSendFailure(transactionId, reason)); + mExecutor.execute(() -> mMessageCallback.onMessageSendFailure(transactionId, reason)); } } diff --git a/telephony/java/android/telephony/ims/stub/RcsCapabilityExchangeImplBase.java b/telephony/java/android/telephony/ims/stub/RcsCapabilityExchangeImplBase.java index a117adcfb99a..57616d35f8fa 100644 --- a/telephony/java/android/telephony/ims/stub/RcsCapabilityExchangeImplBase.java +++ b/telephony/java/android/telephony/ims/stub/RcsCapabilityExchangeImplBase.java @@ -441,30 +441,6 @@ public class RcsCapabilityExchangeImplBase { * @param contactUri The URI of the remote user that we wish to get the capabilities of. * @param myCapabilities The capabilities of this device to send to the remote user. * @param callback The callback of this request which is sent from the remote user. - * @hide - */ - // executor used is defined in the constructor. - @SuppressLint("ExecutorRegistration") - public void sendOptionsCapabilityRequest(@NonNull Uri contactUri, - @NonNull List<String> myCapabilities, @NonNull OptionsResponseCallback callback) { - // Stub - to be implemented by service - Log.w(LOG_TAG, "sendOptionsCapabilityRequest called with no implementation."); - try { - callback.onCommandError(COMMAND_CODE_NOT_SUPPORTED); - } catch (ImsException e) { - // Do not do anything, this is a stub implementation. - } - } - - /** - * Push one's own capabilities to a remote user via the SIP OPTIONS presence exchange mechanism - * in order to receive the capabilities of the remote user in response. - * <p> - * The implementer must use {@link OptionsResponseCallback} to send the response of - * this query from the network back to the framework. - * @param contactUri The URI of the remote user that we wish to get the capabilities of. - * @param myCapabilities The capabilities of this device to send to the remote user. - * @param callback The callback of this request which is sent from the remote user. */ // executor used is defined in the constructor. @SuppressLint("ExecutorRegistration") diff --git a/telephony/java/com/android/internal/telephony/DctConstants.java b/telephony/java/com/android/internal/telephony/DctConstants.java index 3d7fe60719ef..db88e80de1b3 100644 --- a/telephony/java/com/android/internal/telephony/DctConstants.java +++ b/telephony/java/com/android/internal/telephony/DctConstants.java @@ -132,4 +132,5 @@ public class DctConstants { public static final String RAT_NAME_LTE = "LTE"; public static final String RAT_NAME_NR_NSA = "NR_NSA"; public static final String RAT_NAME_NR_NSA_MMWAVE = "NR_NSA_MMWAVE"; + public static final String RAT_NAME_NR_SA_MMWAVE = "NR_MMWAVE"; } |