Merge "API changes in GatewayInfo, Response, and PropertyPresentation (1/4)" into lmp-dev

This commit is contained in:
Nancy Chen
2014-09-11 17:06:27 +00:00
committed by Android (Google) Code Review
9 changed files with 67 additions and 88 deletions

View File

@@ -28320,9 +28320,9 @@ package android.telecomm {
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;
@@ -28383,14 +28383,6 @@ package android.telecomm {
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();
@@ -28465,11 +28457,6 @@ package android.telecomm {
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();
@@ -28506,8 +28493,12 @@ package android.telecomm {
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
}
}

View File

@@ -108,7 +108,7 @@ public final class Call {
/**
* @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 @@ public final class Call {
/**
* @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;

View File

@@ -492,7 +492,8 @@ public abstract class Connection {
}
/**
* @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 @@ public abstract class Connection {
}
/**
* @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 @@ public abstract class Connection {
* 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 @@ public abstract class Connection {
* 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);

View File

@@ -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 @@ import android.text.TextUtils;
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 @@ public class GatewayInfo implements Parcelable {
}
/**
* 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 class GatewayInfo implements Parcelable {
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 @@ public class GatewayInfo implements Parcelable {
@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);
}
}

View File

@@ -153,7 +153,9 @@ public final class ParcelableCall implements Parcelable {
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 @@ public final class ParcelableCall implements Parcelable {
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;
}

View File

@@ -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;
}

View File

@@ -138,8 +138,8 @@ public final class RemoteConnection {
*
* @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) {}
@@ -149,8 +149,8 @@ public final class RemoteConnection {
*
* @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) {}
@@ -544,7 +544,7 @@ public final class RemoteConnection {
/**
* @return The presentation requirements for the handle. See
* {@link PropertyPresentation} for valid values.
* {@link TelecommManager} for valid values.
*/
public int getHandlePresentation() {
return mHandlePresentation;
@@ -559,7 +559,7 @@ public final class RemoteConnection {
/**
* @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;

View File

@@ -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> {

View File

@@ -238,6 +238,23 @@ public class TelecommManager {
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";