diff options
-rw-r--r-- | api/current.txt | 2 | ||||
-rw-r--r-- | mms/java/android/telephony/MmsManager.java | 18 | ||||
-rw-r--r-- | mms/java/com/android/internal/telephony/IMms.aidl | 7 | ||||
-rw-r--r-- | services/core/java/com/android/server/MmsServiceBroker.java | 11 | ||||
-rw-r--r-- | telephony/java/android/telephony/SmsManager.java | 29 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ISms.aidl | 37 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ISmsImplBase.java | 6 |
7 files changed, 48 insertions, 62 deletions
diff --git a/api/current.txt b/api/current.txt index 97361681f1a4..1c136d6ad8c7 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45655,7 +45655,7 @@ package android.telephony { method @Nullable public String createAppSpecificSmsTokenWithPackageInfo(@Nullable String, @NonNull android.app.PendingIntent); method public java.util.ArrayList<java.lang.String> divideMessage(String); method public void downloadMultimediaMessage(android.content.Context, String, android.net.Uri, android.os.Bundle, android.app.PendingIntent); - method public android.os.Bundle getCarrierConfigValues(); + method @Nullable public android.os.Bundle getCarrierConfigValues(); method public static android.telephony.SmsManager getDefault(); method public static int getDefaultSmsSubscriptionId(); method public static android.telephony.SmsManager getSmsManagerForSubscriptionId(int); diff --git a/mms/java/android/telephony/MmsManager.java b/mms/java/android/telephony/MmsManager.java index 4bcf04691652..65542673a607 100644 --- a/mms/java/android/telephony/MmsManager.java +++ b/mms/java/android/telephony/MmsManager.java @@ -97,22 +97,4 @@ public class MmsManager { // Ignore it } } - - /** - * Get carrier-dependent configuration values. - * - * @param subId the subscription id - * @return bundle key/values pairs of configuration values - */ - public Bundle getCarrierConfigValues(int subId) { - try { - IMms iMms = IMms.Stub.asInterface(ServiceManager.getService("imms")); - if (iMms != null) { - return iMms.getCarrierConfigValues(subId); - } - } catch (RemoteException ex) { - // ignore it - } - return null; - } } diff --git a/mms/java/com/android/internal/telephony/IMms.aidl b/mms/java/com/android/internal/telephony/IMms.aidl index fa5073ef1c7e..8be511186800 100644 --- a/mms/java/com/android/internal/telephony/IMms.aidl +++ b/mms/java/com/android/internal/telephony/IMms.aidl @@ -60,13 +60,6 @@ interface IMms { in PendingIntent downloadedIntent); /** - * Get carrier-dependent configuration values. - * - * @param subId the SIM id - */ - Bundle getCarrierConfigValues(int subId); - - /** * Import a text message into system's SMS store * * @param callingPkg the calling app's package name diff --git a/services/core/java/com/android/server/MmsServiceBroker.java b/services/core/java/com/android/server/MmsServiceBroker.java index 92d1da5be7a2..9b1326bc88d7 100644 --- a/services/core/java/com/android/server/MmsServiceBroker.java +++ b/services/core/java/com/android/server/MmsServiceBroker.java @@ -140,11 +140,6 @@ public class MmsServiceBroker extends SystemService { } @Override - public Bundle getCarrierConfigValues(int subId) throws RemoteException { - return null; - } - - @Override public Uri importTextMessage(String callingPkg, String address, int type, String text, long timestampMillis, boolean seen, boolean read) throws RemoteException { return null; @@ -373,12 +368,6 @@ public class MmsServiceBroker extends SystemService { } @Override - public Bundle getCarrierConfigValues(int subId) throws RemoteException { - Slog.d(TAG, "getCarrierConfigValues() by " + getCallingPackageName()); - return getServiceGuarded().getCarrierConfigValues(subId); - } - - @Override public Uri importTextMessage(String callingPkg, String address, int type, String text, long timestampMillis, boolean seen, boolean read) throws RemoteException { if (getAppOpsManager().noteOp(AppOpsManager.OP_WRITE_SMS, Binder.getCallingUid(), diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java index 7215ef8fb4c5..3e576dcc9150 100644 --- a/telephony/java/android/telephony/SmsManager.java +++ b/telephony/java/android/telephony/SmsManager.java @@ -2504,22 +2504,31 @@ public final class SmsManager { public static final String MESSAGE_STATUS_READ = "read"; /** - * Get carrier-dependent configuration values. + * Get carrier-dependent MMS configuration values. * * <p class="note"><strong>Note:</strong> This method is intended for internal use by carrier - * applications or the Telephony framework and will never trigger an SMS disambiguation - * dialog. If this method is called on a device that has multiple active subscriptions, this - * {@link SmsManager} instance has been created with {@link #getDefault()}, and no user-defined - * default subscription is defined, the subscription ID associated with this message will be - * INVALID, which will result in the operation being completed on the subscription associated - * with logical slot 0. Use {@link #getSmsManagerForSubscriptionId(int)} to ensure the - * operation is performed on the correct subscription. + * applications or the Telephony framework and will never trigger an SMS disambiguation dialog. + * If this method is called on a device that has multiple active subscriptions, this {@link + * SmsManager} instance has been created with {@link #getDefault()}, and no user-defined default + * subscription is defined, the subscription ID associated with this message will be INVALID, + * which will result in the operation being completed on the subscription associated with + * logical slot 0. Use {@link #getSmsManagerForSubscriptionId(int)} to ensure the operation is + * performed on the correct subscription. * </p> * - * @return bundle key/values pairs of configuration values + * @return the bundle key/values pairs that contains MMS configuration values */ + @Nullable public Bundle getCarrierConfigValues() { - return MmsManager.getInstance().getCarrierConfigValues(getSubscriptionId()); + try { + ISms iSms = getISmsService(); + if (iSms != null) { + return iSms.getCarrierConfigValuesForSubscriber(getSubscriptionId()); + } + } catch (RemoteException ex) { + // ignore it + } + return null; } /** diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index 9f4d066ff8b4..c07a1711b32e 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -1,18 +1,18 @@ /* -** Copyright 2007, 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. -*/ + * Copyright 2007, 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; @@ -22,7 +22,7 @@ import android.os.Bundle; import com.android.internal.telephony.SmsRawData; /** - * Interface for applications to access the ICC phone book. + * Service interface to handle SMS API requests * * See also SmsManager.java. */ @@ -542,6 +542,13 @@ interface ISms { in List<PendingIntent> deliveryIntents); /** + * Get carrier-dependent configuration values. + * + * @param subId the subscription Id + */ + Bundle getCarrierConfigValuesForSubscriber(int subId); + + /** * Create an app-only incoming SMS request for the calling package. * * If an incoming text contains the token returned by this method the provided diff --git a/telephony/java/com/android/internal/telephony/ISmsImplBase.java b/telephony/java/com/android/internal/telephony/ISmsImplBase.java index 2430d8237d9c..ddd3457b3b4d 100644 --- a/telephony/java/com/android/internal/telephony/ISmsImplBase.java +++ b/telephony/java/com/android/internal/telephony/ISmsImplBase.java @@ -18,6 +18,7 @@ package com.android.internal.telephony; import android.app.PendingIntent; import android.net.Uri; +import android.os.Bundle; import java.util.List; @@ -185,6 +186,11 @@ public class ISmsImplBase extends ISms.Stub { } @Override + public Bundle getCarrierConfigValuesForSubscriber(int subId) { + throw new UnsupportedOperationException(); + } + + @Override public String createAppSpecificSmsToken(int subId, String callingPkg, PendingIntent intent) { throw new UnsupportedOperationException(); } |