API changes in GatewayInfo, Response, and PropertyPresentation (1/4)

* GatewayInfo: handle -> address, becomes SystemApi
* Response: hidden
* PropertyPresentation: class goes away, constants move to
  TelecommManager

Bug: 17329632

Change-Id: I6577ed95ed1535aaf66dfa1853eee85ec6c506d2
diff --git a/api/current.txt b/api/current.txt
index 0efa148..181de4f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28329,9 +28329,9 @@
 
   public class GatewayInfo implements android.os.Parcelable {
     method public int describeContents();
-    method public android.net.Uri getGatewayHandle();
+    method public android.net.Uri getGatewayAddress();
     method public java.lang.String getGatewayProviderPackageName();
-    method public android.net.Uri getOriginalHandle();
+    method public android.net.Uri getOriginalAddress();
     method public boolean isEmpty();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
@@ -28392,14 +28392,6 @@
     field public static final int SWAP_CONFERENCE = 8; // 0x8
   }
 
-  public class PropertyPresentation {
-    ctor public PropertyPresentation();
-    field public static final int ALLOWED = 1; // 0x1
-    field public static final int PAYPHONE = 4; // 0x4
-    field public static final int RESTRICTED = 2; // 0x2
-    field public static final int UNKNOWN = 3; // 0x3
-  }
-
   public final class RemoteConference {
     method public final void addCallback(android.telecomm.RemoteConference.Callback);
     method public void disconnect();
@@ -28474,11 +28466,6 @@
     method public void onStatusHintsChanged(android.telecomm.RemoteConnection, android.telecomm.StatusHints);
   }
 
-  public abstract interface Response {
-    method public abstract void onError(IN, int, java.lang.String);
-    method public abstract void onResult(IN, OUT...);
-  }
-
   public final class StatusHints implements android.os.Parcelable {
     ctor public StatusHints(android.content.ComponentName, java.lang.CharSequence, int, android.os.Bundle);
     method public int describeContents();
@@ -28515,8 +28502,12 @@
     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_PHONE_ACCOUNT_HANDLE = "android.telecomm.extra.PHONE_ACCOUNT_HANDLE";
-    field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.telecomm.extra.START_CALL_WITH_SPEAKERPHONE";
+    field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.intent.extra.PHONE_ACCOUNT_HANDLE";
+    field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE";
+    field public static final int PRESENTATION_ALLOWED = 1; // 0x1
+    field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
+    field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
+    field public static final int PRESENTATION_UNKNOWN = 3; // 0x3
   }
 
 }
diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java
index c3aa2a0..129880f 100644
--- a/telecomm/java/android/telecomm/Call.java
+++ b/telecomm/java/android/telecomm/Call.java
@@ -108,7 +108,7 @@
 
         /**
          * @return The presentation requirements for the handle. See
-         * {@link PropertyPresentation} for valid values.
+         * {@link TelecommManager} for valid values.
          */
         public int getHandlePresentation() {
             return mHandlePresentation;
@@ -123,7 +123,7 @@
 
         /**
          * @return The presentation requirements for the caller display name. See
-         * {@link PropertyPresentation} for valid values.
+         * {@link TelecommManager} for valid values.
          */
         public int getCallerDisplayNamePresentation() {
             return mCallerDisplayNamePresentation;
diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java
index 6df117e..4644902 100644
--- a/telecomm/java/android/telecomm/Connection.java
+++ b/telecomm/java/android/telecomm/Connection.java
@@ -492,7 +492,8 @@
     }
 
     /**
-     * @return The {@link PropertyPresentation} which controls how the handle is shown.
+     * @return The presentation requirements for the handle.
+     *         See {@link TelecommManager} for valid values.
      */
     public final int getHandlePresentation() {
         return mHandlePresentation;
@@ -506,8 +507,8 @@
     }
 
     /**
-     * @return The {@link PropertyPresentation} which controls how the caller display name is
-     *         shown.
+     * @return The presentation requirements for the handle.
+     *         See {@link TelecommManager} for valid values.
      */
     public final int getCallerDisplayNamePresentation() {
         return mCallerDisplayNamePresentation;
@@ -664,8 +665,8 @@
      * Sets the value of the {@link #getHandle()} property.
      *
      * @param handle The new handle.
-     * @param presentation The {@link PropertyPresentation} which controls how the handle is
-     *         shown.
+     * @param presentation The presentation requirements for the handle.
+     *        See {@link TelecommManager} for valid values.
      */
     public final void setHandle(Uri handle, int presentation) {
         Log.d(this, "setHandle %s", handle);
@@ -680,8 +681,8 @@
      * Sets the caller display name (CNAP).
      *
      * @param callerDisplayName The new display name.
-     * @param presentation The {@link PropertyPresentation} which controls how the name is
-     *         shown.
+     * @param presentation The presentation requirements for the handle.
+     *        See {@link TelecommManager} for valid values.
      */
     public final void setCallerDisplayName(String callerDisplayName, int presentation) {
         Log.d(this, "setCallerDisplayName %s", callerDisplayName);
diff --git a/telecomm/java/android/telecomm/GatewayInfo.java b/telecomm/java/android/telecomm/GatewayInfo.java
index b95e6b6..a720284 100644
--- a/telecomm/java/android/telecomm/GatewayInfo.java
+++ b/telecomm/java/android/telecomm/GatewayInfo.java
@@ -16,6 +16,7 @@
 
 package android.telecomm;
 
+import android.annotation.SystemApi;
 import android.net.Uri;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -33,14 +34,15 @@
 public class GatewayInfo implements Parcelable {
 
     private final String mGatewayProviderPackageName;
-    private final Uri mGatewayHandle;
-    private final Uri mOriginalHandle;
+    private final Uri mGatewayAddress;
+    private final Uri mOriginalAddress;
 
     /** @hide */
-    public GatewayInfo(String packageName, Uri gatewayUri, Uri originalHandle) {
+    @SystemApi
+    public GatewayInfo(String packageName, Uri gatewayUri, Uri originalAddress) {
         mGatewayProviderPackageName = packageName;
-        mGatewayHandle = gatewayUri;
-        mOriginalHandle = originalHandle;
+        mGatewayAddress = gatewayUri;
+        mOriginalAddress = originalAddress;
     }
 
     /**
@@ -51,21 +53,21 @@
     }
 
     /**
-     * Gateway provider handle to use when actually placing the call.
+     * Gateway provider address to use when actually placing the call.
      */
-    public Uri getGatewayHandle() {
-        return mGatewayHandle;
+    public Uri getGatewayAddress() {
+        return mGatewayAddress;
     }
 
     /**
-     * The actual call handle that the user is trying to connect to via the gateway.
+     * The actual call address that the user is trying to connect to via the gateway.
      */
-    public Uri getOriginalHandle() {
-        return mOriginalHandle;
+    public Uri getOriginalAddress() {
+        return mOriginalAddress;
     }
 
     public boolean isEmpty() {
-        return TextUtils.isEmpty(mGatewayProviderPackageName) || mGatewayHandle == null;
+        return TextUtils.isEmpty(mGatewayProviderPackageName) || mGatewayAddress == null;
     }
 
     /** Implement the Parcelable interface */
@@ -76,8 +78,8 @@
         public GatewayInfo createFromParcel(Parcel source) {
             String gatewayPackageName = source.readString();
             Uri gatewayUri = Uri.CREATOR.createFromParcel(source);
-            Uri originalHandle = Uri.CREATOR.createFromParcel(source);
-            return new GatewayInfo(gatewayPackageName, gatewayUri, originalHandle);
+            Uri originalAddress = Uri.CREATOR.createFromParcel(source);
+            return new GatewayInfo(gatewayPackageName, gatewayUri, originalAddress);
         }
 
         @Override
@@ -100,7 +102,7 @@
     @Override
     public void writeToParcel(Parcel destination, int flags) {
         destination.writeString(mGatewayProviderPackageName);
-        mGatewayHandle.writeToParcel(destination, 0);
-        mOriginalHandle.writeToParcel(destination, 0);
+        mGatewayAddress.writeToParcel(destination, 0);
+        mOriginalAddress.writeToParcel(destination, 0);
     }
 }
diff --git a/telecomm/java/android/telecomm/ParcelableCall.java b/telecomm/java/android/telecomm/ParcelableCall.java
index a2aa192..f7fc125 100644
--- a/telecomm/java/android/telecomm/ParcelableCall.java
+++ b/telecomm/java/android/telecomm/ParcelableCall.java
@@ -153,7 +153,9 @@
         return mHandle;
     }
 
-    /** The {@link PropertyPresentation} which controls how the handle is shown. */
+    /**
+     * The presentation requirements for the handle. See {@link TelecommManager} for valid values.
+     */
     public int getHandlePresentation() {
         return mHandlePresentation;
     }
@@ -163,7 +165,10 @@
         return mCallerDisplayName;
     }
 
-    /** The {@link PropertyPresentation} which controls how the caller display name is shown. */
+    /**
+     * The presentation requirements for the caller display name.
+     * See {@link TelecommManager} for valid values.
+     */
     public int getCallerDisplayNamePresentation() {
         return mCallerDisplayNamePresentation;
     }
diff --git a/telecomm/java/android/telecomm/PropertyPresentation.java b/telecomm/java/android/telecomm/PropertyPresentation.java
deleted file mode 100644
index fe97b3d..0000000
--- a/telecomm/java/android/telecomm/PropertyPresentation.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2014, 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 android.telecomm;
-
-/**
- * Defines how properties such as phone numbers and names are displayed to the user.
- */
-public class PropertyPresentation {
-    /** Property is displayed normally. */
-    public static final int ALLOWED = 1;
-
-    /** Property was blocked. */
-    public static final int RESTRICTED = 2;
-
-    /** Presentation was not specified or is unknown. */
-    public static final int UNKNOWN = 3;
-
-    /** Property should be displayed as a pay phone. */
-    public static final int PAYPHONE = 4;
-}
diff --git a/telecomm/java/android/telecomm/RemoteConnection.java b/telecomm/java/android/telecomm/RemoteConnection.java
index 31afb4b..6c43008 100644
--- a/telecomm/java/android/telecomm/RemoteConnection.java
+++ b/telecomm/java/android/telecomm/RemoteConnection.java
@@ -135,8 +135,8 @@
          *
          * @param connection The {@code RemoteConnection} invoking this method.
          * @param handle The new handle of the {@code RemoteConnection}.
-         * @param presentation The {@link PropertyPresentation} which controls how the
-         *         handle is shown.
+         * @param presentation The presentation requirements for the handle.
+         *        See {@link TelecommManager} for valid values.
          */
         public void onHandleChanged(RemoteConnection connection, Uri handle, int presentation) {}
 
@@ -146,8 +146,8 @@
          *
          * @param connection The {@code RemoteConnection} invoking this method.
          * @param callerDisplayName The new caller display name of the {@code RemoteConnection}.
-         * @param presentation The {@link PropertyPresentation} which controls how the
-         *         caller display name is shown.
+         * @param presentation The presentation requirements for the handle.
+         *        See {@link TelecommManager} for valid values.
          */
         public void onCallerDisplayNameChanged(
                 RemoteConnection connection, String callerDisplayName, int presentation) {}
@@ -349,7 +349,7 @@
 
     /**
      * @return The presentation requirements for the handle. See
-     * {@link PropertyPresentation} for valid values.
+     * {@link TelecommManager} for valid values.
      */
     public int getHandlePresentation() {
         return mHandlePresentation;
@@ -364,7 +364,7 @@
 
     /**
      * @return The presentation requirements for the caller display name. See
-     * {@link PropertyPresentation} for valid values.
+     * {@link TelecommManager} for valid values.
      */
     public int getCallerDisplayNamePresentation() {
         return mCallerDisplayNamePresentation;
diff --git a/telecomm/java/android/telecomm/Response.java b/telecomm/java/android/telecomm/Response.java
index f879756..ad78ebd 100644
--- a/telecomm/java/android/telecomm/Response.java
+++ b/telecomm/java/android/telecomm/Response.java
@@ -17,10 +17,7 @@
 package android.telecomm;
 
 /**
- * <strong>OBSOLETE</strong> Used to inform a client of asynchronously returned results.
- * <p>
- * <strong>TODO:</strong> Remove onCreateConferenceConnection() async method
- * then delete this interface.
+ * @hide
  */
 public interface Response<IN, OUT> {
 
diff --git a/telecomm/java/android/telecomm/TelecommManager.java b/telecomm/java/android/telecomm/TelecommManager.java
index 5e9e6d0..41ba787 100644
--- a/telecomm/java/android/telecomm/TelecommManager.java
+++ b/telecomm/java/android/telecomm/TelecommManager.java
@@ -238,6 +238,23 @@
     public static final String EXTRA_TTY_PREFERRED_MODE =
             "android.telecomm.intent.extra.TTY_PREFERRED";
 
+    /**
+     * The following 4 constants define how properties such as phone numbers and names are
+     * displayed to the user.
+     */
+
+    /** Property is displayed normally. */
+    public static final int PRESENTATION_ALLOWED = 1;
+
+    /** Property was blocked. */
+    public static final int PRESENTATION_RESTRICTED = 2;
+
+    /** Presentation was not specified or is unknown. */
+    public static final int PRESENTATION_UNKNOWN = 3;
+
+    /** Property should be displayed as a pay phone. */
+    public static final int PRESENTATION_PAYPHONE = 4;
+
     private static final String TAG = "TelecommManager";
 
     private static final String TELECOMM_SERVICE_NAME = "telecomm";