diff options
author | Nancy Chen <nancychen@google.com> | 2014-09-08 17:38:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-08 17:38:58 +0000 |
commit | 6faad7e5b6cca97744293e55db7a48d81eff6e47 (patch) | |
tree | d978132a04c6f13c65e55dbe70e631230c55be9c /telecomm | |
parent | 5f5df97df96895c92f0d067c90d527aab2d7f1e3 (diff) | |
parent | ea38cca14964a5ee658899b0bafbc48017d556cd (diff) | |
download | frameworks_base-6faad7e5b6cca97744293e55db7a48d81eff6e47.zip frameworks_base-6faad7e5b6cca97744293e55db7a48d81eff6e47.tar.gz frameworks_base-6faad7e5b6cca97744293e55db7a48d81eff6e47.tar.bz2 |
Merge "Make changes to Telecomm API per review guidelines." into lmp-dev
Diffstat (limited to 'telecomm')
6 files changed, 31 insertions, 43 deletions
diff --git a/telecomm/java/android/telecomm/AudioState.java b/telecomm/java/android/telecomm/AudioState.java index a5fda79..314704b 100644 --- a/telecomm/java/android/telecomm/AudioState.java +++ b/telecomm/java/android/telecomm/AudioState.java @@ -34,7 +34,7 @@ public final class AudioState implements Parcelable { /** Direct the audio stream through a wired headset. */ public static final int ROUTE_WIRED_HEADSET = 0x00000004; - /** Direct the audio stream through the device's spakerphone. */ + /** Direct the audio stream through the device's speakerphone. */ public static final int ROUTE_SPEAKER = 0x00000008; /** @@ -43,7 +43,10 @@ public final class AudioState implements Parcelable { */ public static final int ROUTE_WIRED_OR_EARPIECE = ROUTE_EARPIECE | ROUTE_WIRED_HEADSET; - /** Bit mask of all possible audio routes. */ + /** Bit mask of all possible audio routes. + * + * @hide + */ public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET | ROUTE_SPEAKER; diff --git a/telecomm/java/android/telecomm/Conference.java b/telecomm/java/android/telecomm/Conference.java index c838b48..f9c3ac3 100644 --- a/telecomm/java/android/telecomm/Conference.java +++ b/telecomm/java/android/telecomm/Conference.java @@ -54,7 +54,7 @@ public abstract class Conference { mPhoneAccount = phoneAccount; } - public final PhoneAccountHandle getPhoneAccount() { + public final PhoneAccountHandle getPhoneAccountHandle() { return mPhoneAccount; } @@ -183,7 +183,7 @@ public abstract class Conference { } /** - * Tears down the conference object and any of it's current connections. + * Tears down the conference object and any of its current connections. */ public final void destroy() { Log.d(this, "destroying conference : %s", this); diff --git a/telecomm/java/android/telecomm/ConnectionRequest.java b/telecomm/java/android/telecomm/ConnectionRequest.java index 39ae59a..d5a6aa5 100644 --- a/telecomm/java/android/telecomm/ConnectionRequest.java +++ b/telecomm/java/android/telecomm/ConnectionRequest.java @@ -29,31 +29,25 @@ public final class ConnectionRequest implements Parcelable { // TODO: Token to limit recursive invocations private final PhoneAccountHandle mAccountHandle; - private final Uri mHandle; - private final int mHandlePresentation; + private final Uri mAddress; private final Bundle mExtras; private final int mVideoState; /** * @param accountHandle The accountHandle which should be used to place the call. * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect. - * @param handlePresentation The {@link PropertyPresentation} which controls how the handle - * is shown. * @param extras Application-specific extra data. */ public ConnectionRequest( PhoneAccountHandle accountHandle, Uri handle, - int handlePresentation, Bundle extras) { - this(accountHandle, handle, handlePresentation, extras, VideoProfile.VideoState.AUDIO_ONLY); + this(accountHandle, handle, extras, VideoProfile.VideoState.AUDIO_ONLY); } /** * @param accountHandle The accountHandle which should be used to place the call. * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect. - * @param handlePresentation The {@link PropertyPresentation} which controls how the handle - * is shown. * @param extras Application-specific extra data. * @param videoState Determines the video state for the connection. * @hide @@ -61,20 +55,17 @@ public final class ConnectionRequest implements Parcelable { public ConnectionRequest( PhoneAccountHandle accountHandle, Uri handle, - int handlePresentation, Bundle extras, int videoState) { mAccountHandle = accountHandle; - mHandle = handle; - mHandlePresentation = handlePresentation; + mAddress = handle; mExtras = extras; mVideoState = videoState; } private ConnectionRequest(Parcel in) { mAccountHandle = in.readParcelable(getClass().getClassLoader()); - mHandle = in.readParcelable(getClass().getClassLoader()); - mHandlePresentation = in.readInt(); + mAddress = in.readParcelable(getClass().getClassLoader()); mExtras = in.readParcelable(getClass().getClassLoader()); mVideoState = in.readInt(); } @@ -87,12 +78,7 @@ public final class ConnectionRequest implements Parcelable { /** * The handle (e.g., phone number) to which the {@link Connection} is to connect. */ - public Uri getHandle() { return mHandle; } - - /** - * The {@link PropertyPresentation} which controls how the handle is shown. - */ - public int getHandlePresentation() { return mHandlePresentation; } + public Uri getAddress() { return mAddress; } /** * Application-specific extra data. Used for passing back information from an incoming @@ -118,9 +104,9 @@ public final class ConnectionRequest implements Parcelable { @Override public String toString() { return String.format("ConnectionRequest %s %s", - mHandle == null + mAddress == null ? Uri.EMPTY - : Connection.toLogSafePhoneNumber(mHandle.toString()), + : Connection.toLogSafePhoneNumber(mAddress.toString()), mExtras == null ? "" : mExtras); } @@ -147,8 +133,7 @@ public final class ConnectionRequest implements Parcelable { @Override public void writeToParcel(Parcel destination, int flags) { destination.writeParcelable(mAccountHandle, 0); - destination.writeParcelable(mHandle, 0); - destination.writeInt(mHandlePresentation); + destination.writeParcelable(mAddress, 0); destination.writeParcelable(mExtras, 0); destination.writeInt(mVideoState); } diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java index 833aa26..39365b6 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -781,7 +781,7 @@ public abstract class ConnectionService extends Service { } } ParcelableConference parcelableConference = new ParcelableConference( - conference.getPhoneAccount(), + conference.getPhoneAccountHandle(), conference.getState(), conference.getCapabilities(), connectionIds); diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java index 79193c2..8ad0ad0 100644 --- a/telecomm/java/android/telecomm/RemoteConnectionService.java +++ b/telecomm/java/android/telecomm/RemoteConnectionService.java @@ -325,8 +325,7 @@ final class RemoteConnectionService { final String id = UUID.randomUUID().toString(); final ConnectionRequest newRequest = new ConnectionRequest( request.getAccountHandle(), - request.getHandle(), - request.getHandlePresentation(), + request.getAddress(), request.getExtras(), request.getVideoState()); try { diff --git a/telecomm/java/android/telecomm/StatusHints.java b/telecomm/java/android/telecomm/StatusHints.java index f7c4f2f..ff96a5b 100644 --- a/telecomm/java/android/telecomm/StatusHints.java +++ b/telecomm/java/android/telecomm/StatusHints.java @@ -32,23 +32,24 @@ import java.util.Objects; */ public final class StatusHints implements Parcelable { - private final ComponentName mComponentName; + private final ComponentName mPackageName; private final CharSequence mLabel; private final int mIconResId; private final Bundle mExtras; - public StatusHints(ComponentName componentName, CharSequence label, int iconResId, Bundle extras) { - mComponentName = componentName; + public StatusHints(ComponentName packageName, CharSequence label, int iconResId, + Bundle extras) { + mPackageName = packageName; mLabel = label; mIconResId = iconResId; mExtras = extras; } /** - * @return A component used to load the icon. + * @return A package used to load the icon. */ - public ComponentName getComponentName() { - return mComponentName; + public ComponentName getPackageName() { + return mPackageName; } /** @@ -88,7 +89,7 @@ public final class StatusHints implements Parcelable { @Override public void writeToParcel(Parcel out, int flags) { - out.writeParcelable(mComponentName, flags); + out.writeParcelable(mPackageName, flags); out.writeCharSequence(mLabel); out.writeInt(mIconResId); out.writeParcelable(mExtras, 0); @@ -106,7 +107,7 @@ public final class StatusHints implements Parcelable { }; private StatusHints(Parcel in) { - mComponentName = in.readParcelable(getClass().getClassLoader()); + mPackageName = in.readParcelable(getClass().getClassLoader()); mLabel = in.readCharSequence(); mIconResId = in.readInt(); mExtras = in.readParcelable(getClass().getClassLoader()); @@ -115,16 +116,16 @@ public final class StatusHints implements Parcelable { private Drawable getIcon(Context context, int resId) { Context packageContext; try { - packageContext = context.createPackageContext(mComponentName.getPackageName(), 0); + packageContext = context.createPackageContext(mPackageName.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { - Log.e(this, e, "Cannot find package %s", mComponentName.getPackageName()); + Log.e(this, e, "Cannot find package %s", mPackageName.getPackageName()); return null; } try { return packageContext.getDrawable(resId); } catch (MissingResourceException e) { Log.e(this, e, "Cannot find icon %d in package %s", - resId, mComponentName.getPackageName()); + resId, mPackageName.getPackageName()); return null; } } @@ -133,7 +134,7 @@ public final class StatusHints implements Parcelable { public boolean equals(Object other) { if (other != null && other instanceof StatusHints) { StatusHints otherHints = (StatusHints) other; - return Objects.equals(otherHints.getComponentName(), getComponentName()) && + return Objects.equals(otherHints.getPackageName(), getPackageName()) && Objects.equals(otherHints.getLabel(), getLabel()) && otherHints.getIconResId() == getIconResId() && Objects.equals(otherHints.getExtras(), getExtras()); @@ -143,7 +144,7 @@ public final class StatusHints implements Parcelable { @Override public int hashCode() { - return Objects.hashCode(mComponentName) + Objects.hashCode(mLabel) + mIconResId + + return Objects.hashCode(mPackageName) + Objects.hashCode(mLabel) + mIconResId + Objects.hashCode(mExtras); } } |