Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea38cca1 authored by Nancy Chen's avatar Nancy Chen
Browse files

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
parent 3512bcd3
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -28216,7 +28216,6 @@ package android.telecomm {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
    field public static final int ROUTE_ALL = 15; // 0xf
    field public static final int ROUTE_BLUETOOTH = 2; // 0x2
    field public static final int ROUTE_EARPIECE = 1; // 0x1
    field public static final int ROUTE_SPEAKER = 8; // 0x8
@@ -28233,7 +28232,7 @@ package android.telecomm {
    method public void destroy();
    method public final int getCapabilities();
    method public final java.util.List<android.telecomm.Connection> getConnections();
    method public final android.telecomm.PhoneAccountHandle getPhoneAccount();
    method public final android.telecomm.PhoneAccountHandle getPhoneAccountHandle();
    method public final int getState();
    method public void onDisconnect();
    method public void onHold();
@@ -28306,12 +28305,11 @@ package android.telecomm {
  }
  public final class ConnectionRequest implements android.os.Parcelable {
    ctor public ConnectionRequest(android.telecomm.PhoneAccountHandle, android.net.Uri, int, android.os.Bundle);
    ctor public ConnectionRequest(android.telecomm.PhoneAccountHandle, android.net.Uri, android.os.Bundle);
    method public int describeContents();
    method public android.telecomm.PhoneAccountHandle getAccountHandle();
    method public android.net.Uri getAddress();
    method public android.os.Bundle getExtras();
    method public android.net.Uri getHandle();
    method public int getHandlePresentation();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
  }
@@ -28489,11 +28487,11 @@ package android.telecomm {
  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();
    method public android.content.ComponentName getComponentName();
    method public android.os.Bundle getExtras();
    method public android.graphics.drawable.Drawable getIcon(android.content.Context);
    method public int getIconResId();
    method public java.lang.CharSequence getLabel();
    method public android.content.ComponentName getPackageName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
  }
+5 −2
Original line number Diff line number Diff line
@@ -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;

+2 −2
Original line number Diff line number Diff line
@@ -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);
+8 −23
Original line number Diff line number Diff line
@@ -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);
    }
+1 −1
Original line number Diff line number Diff line
@@ -747,7 +747,7 @@ public abstract class ConnectionService extends Service {
                }
            }
            ParcelableConference parcelableConference = new ParcelableConference(
                    conference.getPhoneAccount(),
                    conference.getPhoneAccountHandle(),
                    conference.getState(),
                    conference.getCapabilities(),
                    connectionIds);
Loading