Update VVM API
+ TelephonyManager.getVisualVoicemailPackageName() uses pinned subId from the manager. + TelephonyManager.getNetworkSpecifier() updated doc to explain what a network specifier is. + TelephonyManager.getCarrierConfig() Annotated with @WorkerThread specified failure behavior. + VisualVoicemailSms.getFields() Doc specified values are carrier dependent. - Hide DEFAULT_* from VisualVociemaliSmsFitelrSettings Test: CTS TelephonyManagerTest Bug: 35766748 Fixes: 35766370 Fixes: 35766489 Change-Id: If48d48a0cf588bcb59c7b77ce6a452d2fda7bfa5 Merged-in: If48d48a0cf588bcb59c7b77ce6a452d2fda7bfa5
This commit is contained in:
@@ -38154,7 +38154,7 @@ package android.telephony {
|
||||
method public int getSimState();
|
||||
method public int getSimState(int);
|
||||
method public java.lang.String getSubscriberId();
|
||||
method public java.lang.String getVisualVoicemailPackageName(android.telecom.PhoneAccountHandle);
|
||||
method public java.lang.String getVisualVoicemailPackageName();
|
||||
method public java.lang.String getVoiceMailAlphaTag();
|
||||
method public java.lang.String getVoiceMailNumber();
|
||||
method public int getVoiceNetworkType();
|
||||
@@ -38290,9 +38290,6 @@ package android.telephony {
|
||||
method public int describeContents();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.VisualVoicemailSmsFilterSettings> CREATOR;
|
||||
field public static final java.lang.String DEFAULT_CLIENT_PREFIX = "//VVM";
|
||||
field public static final int DEFAULT_DESTINATION_PORT = -1; // 0xffffffff
|
||||
field public static final java.util.List<java.lang.String> DEFAULT_ORIGINATING_NUMBERS;
|
||||
field public static final int DESTINATION_PORT_ANY = -1; // 0xffffffff
|
||||
field public static final int DESTINATION_PORT_DATA_SMS = -2; // 0xfffffffe
|
||||
field public final java.lang.String clientPrefix;
|
||||
|
||||
@@ -41368,7 +41368,7 @@ package android.telephony {
|
||||
method public int getSimState(int);
|
||||
method public java.lang.String getSubscriberId();
|
||||
method public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
|
||||
method public java.lang.String getVisualVoicemailPackageName(android.telecom.PhoneAccountHandle);
|
||||
method public java.lang.String getVisualVoicemailPackageName();
|
||||
method public java.lang.String getVoiceMailAlphaTag();
|
||||
method public java.lang.String getVoiceMailNumber();
|
||||
method public int getVoiceNetworkType();
|
||||
@@ -41535,9 +41535,6 @@ package android.telephony {
|
||||
method public int describeContents();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.VisualVoicemailSmsFilterSettings> CREATOR;
|
||||
field public static final java.lang.String DEFAULT_CLIENT_PREFIX = "//VVM";
|
||||
field public static final int DEFAULT_DESTINATION_PORT = -1; // 0xffffffff
|
||||
field public static final java.util.List<java.lang.String> DEFAULT_ORIGINATING_NUMBERS;
|
||||
field public static final int DESTINATION_PORT_ANY = -1; // 0xffffffff
|
||||
field public static final int DESTINATION_PORT_DATA_SMS = -2; // 0xfffffffe
|
||||
field public final java.lang.String clientPrefix;
|
||||
|
||||
@@ -38253,7 +38253,7 @@ package android.telephony {
|
||||
method public int getSimState();
|
||||
method public int getSimState(int);
|
||||
method public java.lang.String getSubscriberId();
|
||||
method public java.lang.String getVisualVoicemailPackageName(android.telecom.PhoneAccountHandle);
|
||||
method public java.lang.String getVisualVoicemailPackageName();
|
||||
method public java.lang.String getVoiceMailAlphaTag();
|
||||
method public java.lang.String getVoiceMailNumber();
|
||||
method public int getVoiceNetworkType();
|
||||
@@ -38389,9 +38389,6 @@ package android.telephony {
|
||||
method public int describeContents();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.VisualVoicemailSmsFilterSettings> CREATOR;
|
||||
field public static final java.lang.String DEFAULT_CLIENT_PREFIX = "//VVM";
|
||||
field public static final int DEFAULT_DESTINATION_PORT = -1; // 0xffffffff
|
||||
field public static final java.util.List<java.lang.String> DEFAULT_ORIGINATING_NUMBERS;
|
||||
field public static final int DESTINATION_PORT_ANY = -1; // 0xffffffff
|
||||
field public static final int DESTINATION_PORT_DATA_SMS = -2; // 0xfffffffe
|
||||
field public final java.lang.String clientPrefix;
|
||||
|
||||
@@ -24,6 +24,8 @@ import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.SdkConstant;
|
||||
import android.annotation.SdkConstant.SdkConstantType;
|
||||
import android.annotation.WorkerThread;
|
||||
import android.annotation.SystemApi;
|
||||
import android.app.ActivityThread;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ContentResolver;
|
||||
@@ -1508,7 +1510,10 @@ public class TelephonyManager {
|
||||
|
||||
|
||||
/**
|
||||
* Returns the network specifier of the subscription ID pinned to the TelephonyManager.
|
||||
* Returns the network specifier of the subscription ID pinned to the TelephonyManager. The
|
||||
* network specifier is used by {@link
|
||||
* android.net.NetworkRequest.Builder#setNetworkSpecifier(String)} to create a {@link
|
||||
* android.net.NetworkRequest} that connects through the subscription.
|
||||
*
|
||||
* @see android.net.NetworkRequest.Builder#setNetworkSpecifier(String)
|
||||
* @see #createForSubscriptionId(int)
|
||||
@@ -1519,7 +1524,9 @@ public class TelephonyManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the carrier config of the subscription ID pinned to the TelephonyManager.
|
||||
* Returns the carrier config of the subscription ID pinned to the TelephonyManager. If an
|
||||
* invalid subscription ID is pinned to the TelephonyManager, the returned config will contain
|
||||
* default values.
|
||||
*
|
||||
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
|
||||
* READ_PHONE_STATE}
|
||||
@@ -1528,6 +1535,7 @@ public class TelephonyManager {
|
||||
* @see #createForSubscriptionId(int)
|
||||
* @see #createForPhoneAccountHandle(PhoneAccountHandle)
|
||||
*/
|
||||
@WorkerThread
|
||||
public PersistableBundle getCarrierConfig() {
|
||||
CarrierConfigManager carrierConfigManager = mContext
|
||||
.getSystemService(CarrierConfigManager.class);
|
||||
@@ -2714,19 +2722,24 @@ public class TelephonyManager {
|
||||
|
||||
|
||||
/**
|
||||
* Returns the package responsible of processing visual voicemail for the phone account.
|
||||
* Returns the package responsible of processing visual voicemail for the subscription ID pinned
|
||||
* to the TelephonyManager. Returns {@code null} when there is no package responsible for
|
||||
* processing visual voicemail for the subscription.
|
||||
*
|
||||
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
|
||||
* READ_PHONE_STATE}
|
||||
*
|
||||
* @see #createForSubscriptionId(int)
|
||||
* @see #createForPhoneAccountHandle(PhoneAccountHandle)
|
||||
* @see VisualVoicemailService
|
||||
*/
|
||||
@Nullable
|
||||
public String getVisualVoicemailPackageName(PhoneAccountHandle phoneAccountHandle) {
|
||||
public String getVisualVoicemailPackageName() {
|
||||
try {
|
||||
ITelephony telephony = getITelephony();
|
||||
if (telephony != null) {
|
||||
return telephony
|
||||
.getVisualVoicemailPackageName(mContext.getOpPackageName(),
|
||||
phoneAccountHandle);
|
||||
.getVisualVoicemailPackageName(mContext.getOpPackageName(), mSubId);
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
|
||||
@@ -63,7 +63,8 @@ public final class VisualVoicemailSms implements Parcelable {
|
||||
|
||||
/**
|
||||
* The key-value pairs sent by the SMS, or {@code null} if the framework cannot parse the SMS as
|
||||
* voicemail but the carrier pattern indicates it is.
|
||||
* voicemail but the carrier pattern indicates it is. The interpretation of the fields is
|
||||
* carrier dependent.
|
||||
*/
|
||||
public Bundle getFields() {
|
||||
return mFields;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package android.telephony;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -55,8 +54,17 @@ public final class VisualVoicemailSmsFilterSettings implements Parcelable {
|
||||
*/
|
||||
public static final int DESTINATION_PORT_DATA_SMS = -2;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public static final String DEFAULT_CLIENT_PREFIX = "//VVM";
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public static final List<String> DEFAULT_ORIGINATING_NUMBERS = Collections.emptyList();
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public static final int DEFAULT_DESTINATION_PORT = DESTINATION_PORT_ANY;
|
||||
|
||||
/**
|
||||
|
||||
@@ -504,8 +504,7 @@ interface ITelephony {
|
||||
boolean isVisualVoicemailEnabled(String callingPackage,
|
||||
in PhoneAccountHandle accountHandle);
|
||||
|
||||
String getVisualVoicemailPackageName(String callingPackage,
|
||||
in PhoneAccountHandle phoneAccountHandle);
|
||||
String getVisualVoicemailPackageName(String callingPackage, int subId);
|
||||
|
||||
// Not oneway, caller needs to make sure the vaule is set before receiving a SMS
|
||||
void enableVisualVoicemailSmsFilter(String callingPackage, int subId,
|
||||
|
||||
Reference in New Issue
Block a user