OSDN Git Service

Add a notion of the subscription number
authorEvan Charlton <evanc@google.com>
Thu, 17 Jul 2014 23:59:18 +0000 (16:59 -0700)
committerEvan Charlton <evanc@google.com>
Sat, 19 Jul 2014 21:22:31 +0000 (21:22 +0000)
Expose the actual subscription number so that it can be exposed when
necessary (such as during emergency calls, when it doesn't match the
line 1 number).

Bug: 13333595
Change-Id: I0d3b2cfcea08aeba760c392c116303f21beb70d3

api/current.txt
telecomm/java/android/telecomm/PhoneAccount.java
telecomm/java/android/telecomm/PhoneAccountMetadata.java
telecomm/java/android/telecomm/TelecommConstants.java

index 9336473..f20c720 100644 (file)
@@ -28608,7 +28608,7 @@ package android.telecomm {
   }
 
   public class PhoneAccountMetadata implements android.os.Parcelable {
-    ctor public PhoneAccountMetadata(android.telecomm.PhoneAccount, android.net.Uri, int, int, java.lang.String, java.lang.String, boolean);
+    ctor public PhoneAccountMetadata(android.telecomm.PhoneAccount, android.net.Uri, java.lang.String, int, int, java.lang.String, java.lang.String, boolean);
     method public int describeContents();
     method public android.telecomm.PhoneAccount getAccount();
     method public int getCapabilities();
@@ -28617,6 +28617,7 @@ package android.telecomm {
     method public int getIconResId();
     method public java.lang.String getLabel();
     method public java.lang.String getShortDescription();
+    method public java.lang.String getSubscriptionNumber();
     method public boolean isVideoCallingSupported();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final int CAPABILITY_CALL_PROVIDER = 2; // 0x2
@@ -28720,10 +28721,10 @@ package android.telecomm {
     field public static final java.lang.String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL";
     field public static final char DTMF_CHARACTER_PAUSE = 44; // 0x002c ','
     field public static final char DTMF_CHARACTER_WAIT = 59; // 0x003b ';'
+    field public static final java.lang.String EXTRA_CALL_BACK_NUMBER = "android.telecomm.extra.CALL_BACK_NUMBER";
     field public static final java.lang.String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecomm.extra.CALL_DISCONNECT_CAUSE";
     field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecomm.extra.CALL_DISCONNECT_MESSAGE";
     field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE";
-    field public static final java.lang.String EXTRA_EMERGENCY_CALL_BACK_NUMBER = "android.telecomm.extra.EMERGENCY_CALL_BACK_NUMBER";
     field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.intent.extra.INCOMING_CALL_EXTRAS";
     field public static final java.lang.String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT";
     field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE";
index edfd846..4d7638b 100644 (file)
@@ -73,8 +73,6 @@ public class PhoneAccount implements Parcelable {
         return new StringBuilder().append(mComponentName)
                     .append(", ")
                     .append(mId)
-                    .append(", ")
-                    .append(", ")
                     .toString();
     }
 
index 8993170..c52a6fc 100644 (file)
@@ -66,6 +66,7 @@ public class PhoneAccountMetadata implements Parcelable {
 
     private final PhoneAccount mAccount;
     private final Uri mHandle;
+    private final String mSubscriptionNumber;
     private final int mCapabilities;
     private final int mIconResId;
     private final String mLabel;
@@ -75,6 +76,7 @@ public class PhoneAccountMetadata implements Parcelable {
     public PhoneAccountMetadata(
             PhoneAccount account,
             Uri handle,
+            String subscriptionNumber,
             int capabilities,
             int iconResId,
             String label,
@@ -82,6 +84,7 @@ public class PhoneAccountMetadata implements Parcelable {
             boolean supportsVideoCalling) {
         mAccount = account;
         mHandle = handle;
+        mSubscriptionNumber = subscriptionNumber;
         mCapabilities = capabilities;
         mIconResId = iconResId;
         mLabel = label;
@@ -111,6 +114,17 @@ public class PhoneAccountMetadata implements Parcelable {
     }
 
     /**
+     * The subscription number associated with the underlying transport. This may differ from the
+     * {@link #getHandle()} number; for example, if the number used to talk to the network is not
+     * the same number that will be on the remote party's caller ID display.
+     *
+     * @return The subscription number, suitable for display to the user.
+     */
+    public String getSubscriptionNumber() {
+        return mSubscriptionNumber;
+    }
+
+    /**
      * The capabilities of this {@code PhoneAccount}.
      *
      * @return A bit field of flags describing this {@code PhoneAccount}'s capabilities.
@@ -195,6 +209,7 @@ public class PhoneAccountMetadata implements Parcelable {
     public void writeToParcel(Parcel out, int flags) {
         out.writeParcelable(mAccount, 0);
         out.writeParcelable(mHandle, 0);
+        out.writeString(mSubscriptionNumber);
         out.writeInt(mCapabilities);
         out.writeInt(mIconResId);
         out.writeString(mLabel);
@@ -218,6 +233,7 @@ public class PhoneAccountMetadata implements Parcelable {
     private PhoneAccountMetadata(Parcel in) {
         mAccount = in.readParcelable(getClass().getClassLoader());
         mHandle = in.readParcelable(getClass().getClassLoader());
+        mSubscriptionNumber = in.readString();
         mCapabilities = in.readInt();
         mIconResId = in.readInt();
         mLabel = in.readString();
index 0ede387..0ae0c83 100644 (file)
@@ -111,14 +111,15 @@ public final class TelecommConstants {
             "android.telecomm.extra.CONNECTION_SERVICE";
 
     /**
-     * The number which emergency services will use to return calls, if necessary. The in-call UI
-     * will take care of displaying this to the user.
+     * The number which the party on the other side of the line will see (and use to return the
+     * call).
      * <p>
-     * Note that this should only be populated for emergency numbers, and if the number emergency
-     * services will see is different than the user's known phone number.
+     * {@link android.telecomm.ConnectionService}s which interact with
+     * {@link android.telecomm.RemoteConnection}s should only populate this if the
+     * {@link android.telephony.TelephonyManager#getLine1Number()} value, as that is the user's
+     * expected caller ID.
      */
-    public static final String EXTRA_EMERGENCY_CALL_BACK_NUMBER =
-            "android.telecomm.extra.EMERGENCY_CALL_BACK_NUMBER";
+    public static final String EXTRA_CALL_BACK_NUMBER = "android.telecomm.extra.CALL_BACK_NUMBER";
 
     /**
      * The dual tone multi-frequency signaling character sent to indicate the dialing system should