diff options
author | Nancy Chen <nancychen@google.com> | 2014-09-05 16:38:49 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-09-05 20:33:05 -0700 |
commit | ea38cca14964a5ee658899b0bafbc48017d556cd (patch) | |
tree | cb0772498d073be180f9516f88958770ae77d491 /telecomm | |
parent | 3512bcd3af103d35c5c3503cecc05fbec053c91f (diff) | |
download | frameworks_base-ea38cca14964a5ee658899b0bafbc48017d556cd.zip frameworks_base-ea38cca14964a5ee658899b0bafbc48017d556cd.tar.gz frameworks_base-ea38cca14964a5ee658899b0bafbc48017d556cd.tar.bz2 |
Make changes to Telecomm API per review guidelines.
Make changes to Telecomm API per review guidelines in bug:
* Rename componentName to packageName and getComponentName to
getPackageName in StatusHints
* Hide "ROUTE_ALL" and fix misspelling in AudioState
* Change getHandle to getAddress and remove getHandlePresentation in
ConnectionRequest
Bug: 17329632
Change-Id: I8b3666cc22d24f470c940825c77a7b4d0701dc16
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 879ff66..b820fc9 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; } @@ -171,7 +171,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 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 2dc6910..d9c0eb4 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -747,7 +747,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 0b6badb..01a0b3f 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); } } |