Merge "[IMS]Add bitrate and bandwidth into ImsStreamMediaProfile" am: 15075fcca0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1478280 Change-Id: I02a791584a66c1d1571046c5ab026423e2d3aadc
This commit is contained in:
@@ -11735,6 +11735,17 @@ package android.telephony.euicc {
|
|||||||
|
|
||||||
package android.telephony.ims {
|
package android.telephony.ims {
|
||||||
|
|
||||||
|
public final class AudioCodecAttributes implements android.os.Parcelable {
|
||||||
|
ctor public AudioCodecAttributes(float, @NonNull android.util.Range<java.lang.Float>, float, @NonNull android.util.Range<java.lang.Float>);
|
||||||
|
method public int describeContents();
|
||||||
|
method public float getBandwidthKhz();
|
||||||
|
method @NonNull public android.util.Range<java.lang.Float> getBandwidthRangeKhz();
|
||||||
|
method public float getBitrateKbps();
|
||||||
|
method @NonNull public android.util.Range<java.lang.Float> getBitrateRangeKbps();
|
||||||
|
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||||
|
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.AudioCodecAttributes> CREATOR;
|
||||||
|
}
|
||||||
|
|
||||||
public final class ImsCallForwardInfo implements android.os.Parcelable {
|
public final class ImsCallForwardInfo implements android.os.Parcelable {
|
||||||
ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
|
ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
@@ -12103,6 +12114,7 @@ package android.telephony.ims {
|
|||||||
ctor public ImsStreamMediaProfile(int, int, int, int, int);
|
ctor public ImsStreamMediaProfile(int, int, int, int, int);
|
||||||
method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
|
method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
|
method @Nullable public android.telephony.ims.AudioCodecAttributes getAudioCodecAttributes();
|
||||||
method public int getAudioDirection();
|
method public int getAudioDirection();
|
||||||
method public int getAudioQuality();
|
method public int getAudioQuality();
|
||||||
method public int getRttMode();
|
method public int getRttMode();
|
||||||
@@ -12110,6 +12122,7 @@ package android.telephony.ims {
|
|||||||
method public int getVideoQuality();
|
method public int getVideoQuality();
|
||||||
method public boolean isReceivingRttAudio();
|
method public boolean isReceivingRttAudio();
|
||||||
method public boolean isRttCall();
|
method public boolean isRttCall();
|
||||||
|
method public void setAudioCodecAttributes(@NonNull android.telephony.ims.AudioCodecAttributes);
|
||||||
method public void setReceivingRttAudio(boolean);
|
method public void setReceivingRttAudio(boolean);
|
||||||
method public void setRttMode(int);
|
method public void setRttMode(int);
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
|
|||||||
@@ -10617,6 +10617,17 @@ package android.telephony.euicc {
|
|||||||
|
|
||||||
package android.telephony.ims {
|
package android.telephony.ims {
|
||||||
|
|
||||||
|
public final class AudioCodecAttributes implements android.os.Parcelable {
|
||||||
|
ctor public AudioCodecAttributes(float, @NonNull android.util.Range<java.lang.Float>, float, @NonNull android.util.Range<java.lang.Float>);
|
||||||
|
method public int describeContents();
|
||||||
|
method public float getBandwidthKhz();
|
||||||
|
method @NonNull public android.util.Range<java.lang.Float> getBandwidthRangeKhz();
|
||||||
|
method public float getBitrateKbps();
|
||||||
|
method @NonNull public android.util.Range<java.lang.Float> getBitrateRangeKbps();
|
||||||
|
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||||
|
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.AudioCodecAttributes> CREATOR;
|
||||||
|
}
|
||||||
|
|
||||||
public final class ImsCallForwardInfo implements android.os.Parcelable {
|
public final class ImsCallForwardInfo implements android.os.Parcelable {
|
||||||
ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
|
ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
@@ -10985,6 +10996,7 @@ package android.telephony.ims {
|
|||||||
ctor public ImsStreamMediaProfile(int, int, int, int, int);
|
ctor public ImsStreamMediaProfile(int, int, int, int, int);
|
||||||
method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
|
method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
|
method @Nullable public android.telephony.ims.AudioCodecAttributes getAudioCodecAttributes();
|
||||||
method public int getAudioDirection();
|
method public int getAudioDirection();
|
||||||
method public int getAudioQuality();
|
method public int getAudioQuality();
|
||||||
method public int getRttMode();
|
method public int getRttMode();
|
||||||
@@ -10992,6 +11004,7 @@ package android.telephony.ims {
|
|||||||
method public int getVideoQuality();
|
method public int getVideoQuality();
|
||||||
method public boolean isReceivingRttAudio();
|
method public boolean isReceivingRttAudio();
|
||||||
method public boolean isRttCall();
|
method public boolean isRttCall();
|
||||||
|
method public void setAudioCodecAttributes(@NonNull android.telephony.ims.AudioCodecAttributes);
|
||||||
method public void setReceivingRttAudio(boolean);
|
method public void setReceivingRttAudio(boolean);
|
||||||
method public void setRttMode(int);
|
method public void setRttMode(int);
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2020 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.telephony.ims;
|
||||||
|
|
||||||
|
parcelable AudioCodecAttributes;
|
||||||
131
telephony/java/android/telephony/ims/AudioCodecAttributes.java
Normal file
131
telephony/java/android/telephony/ims/AudioCodecAttributes.java
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 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.telephony.ims;
|
||||||
|
|
||||||
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.SystemApi;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.util.Range;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parcelable object to handle audio codec attributes.
|
||||||
|
* It provides the audio codec bitrate, bandwidth and their upper/lower bound.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public final class AudioCodecAttributes implements Parcelable {
|
||||||
|
// The audio codec bitrate in kbps.
|
||||||
|
private float mBitrateKbps;
|
||||||
|
// The range of the audio codec bitrate in kbps.
|
||||||
|
private Range<Float> mBitrateRangeKbps;
|
||||||
|
// The audio codec bandwidth in kHz.
|
||||||
|
private float mBandwidthKhz;
|
||||||
|
// The range of the audio codec bandwidth in kHz.
|
||||||
|
private Range<Float> mBandwidthRangeKhz;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param bitrateKbps The audio codec bitrate in kbps.
|
||||||
|
* @param bitrateRangeKbps The range of the audio codec bitrate in kbps.
|
||||||
|
* @param bandwidthKhz The audio codec bandwidth in kHz.
|
||||||
|
* @param bandwidthRangeKhz The range of the audio codec bandwidth in kHz.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public AudioCodecAttributes(float bitrateKbps, @NonNull Range<Float> bitrateRangeKbps,
|
||||||
|
float bandwidthKhz, @NonNull Range<Float> bandwidthRangeKhz) {
|
||||||
|
mBitrateKbps = bitrateKbps;
|
||||||
|
mBitrateRangeKbps = bitrateRangeKbps;
|
||||||
|
mBandwidthKhz = bandwidthKhz;
|
||||||
|
mBandwidthRangeKhz = bandwidthRangeKhz;
|
||||||
|
}
|
||||||
|
|
||||||
|
private AudioCodecAttributes(Parcel in) {
|
||||||
|
mBitrateKbps = in.readFloat();
|
||||||
|
mBitrateRangeKbps = new Range<>(in.readFloat(), in.readFloat());
|
||||||
|
mBandwidthKhz = in.readFloat();
|
||||||
|
mBandwidthRangeKhz = new Range<>(in.readFloat(), in.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(@NonNull Parcel out, int flags) {
|
||||||
|
out.writeFloat(mBitrateKbps);
|
||||||
|
out.writeFloat(mBitrateRangeKbps.getLower());
|
||||||
|
out.writeFloat(mBitrateRangeKbps.getUpper());
|
||||||
|
out.writeFloat(mBandwidthKhz);
|
||||||
|
out.writeFloat(mBandwidthRangeKhz.getLower());
|
||||||
|
out.writeFloat(mBandwidthRangeKhz.getUpper());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final @NonNull Creator<AudioCodecAttributes> CREATOR =
|
||||||
|
new Creator<AudioCodecAttributes>() {
|
||||||
|
@Override
|
||||||
|
public AudioCodecAttributes createFromParcel(Parcel in) {
|
||||||
|
return new AudioCodecAttributes(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AudioCodecAttributes[] newArray(int size) {
|
||||||
|
return new AudioCodecAttributes[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the exact value of the audio codec bitrate in kbps.
|
||||||
|
*/
|
||||||
|
public float getBitrateKbps() {
|
||||||
|
return mBitrateKbps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the range of the audio codec bitrate in kbps
|
||||||
|
*/
|
||||||
|
public @NonNull Range<Float> getBitrateRangeKbps() {
|
||||||
|
return mBitrateRangeKbps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the exact value of the audio codec bandwidth in kHz.
|
||||||
|
*/
|
||||||
|
public float getBandwidthKhz() {
|
||||||
|
return mBandwidthKhz;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the range of the audio codec bandwidth in kHz.
|
||||||
|
*/
|
||||||
|
public @NonNull Range<Float> getBandwidthRangeKhz() {
|
||||||
|
return mBandwidthRangeKhz;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "{ bitrateKbps=" + mBitrateKbps
|
||||||
|
+ ", bitrateRangeKbps=" + mBitrateRangeKbps
|
||||||
|
+ ", bandwidthKhz=" + mBandwidthKhz
|
||||||
|
+ ", bandwidthRangeKhz=" + mBandwidthRangeKhz + " }";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.Nullable;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
@@ -89,6 +90,9 @@ public final class ImsStreamMediaProfile implements Parcelable {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public int mAudioDirection;
|
public int mAudioDirection;
|
||||||
|
// Audio codec attributes
|
||||||
|
private AudioCodecAttributes mAudioCodecAttributes;
|
||||||
|
|
||||||
// Video related information
|
// Video related information
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public int mVideoQuality;
|
public int mVideoQuality;
|
||||||
@@ -190,6 +194,7 @@ public final class ImsStreamMediaProfile implements Parcelable {
|
|||||||
public void copyFrom(ImsStreamMediaProfile profile) {
|
public void copyFrom(ImsStreamMediaProfile profile) {
|
||||||
mAudioQuality = profile.mAudioQuality;
|
mAudioQuality = profile.mAudioQuality;
|
||||||
mAudioDirection = profile.mAudioDirection;
|
mAudioDirection = profile.mAudioDirection;
|
||||||
|
mAudioCodecAttributes = profile.mAudioCodecAttributes;
|
||||||
mVideoQuality = profile.mVideoQuality;
|
mVideoQuality = profile.mVideoQuality;
|
||||||
mVideoDirection = profile.mVideoDirection;
|
mVideoDirection = profile.mVideoDirection;
|
||||||
mRttMode = profile.mRttMode;
|
mRttMode = profile.mRttMode;
|
||||||
@@ -198,12 +203,13 @@ public final class ImsStreamMediaProfile implements Parcelable {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "{ audioQuality=" + mAudioQuality +
|
return "{ audioQuality=" + mAudioQuality
|
||||||
", audioDirection=" + mAudioDirection +
|
+ ", audioDirection=" + mAudioDirection
|
||||||
", videoQuality=" + mVideoQuality +
|
+ ", audioCodecAttribute=" + mAudioCodecAttributes
|
||||||
", videoDirection=" + mVideoDirection +
|
+ ", videoQuality=" + mVideoQuality
|
||||||
", rttMode=" + mRttMode +
|
+ ", videoDirection=" + mVideoDirection
|
||||||
", hasRttAudioSpeech=" + mIsReceivingRttAudio + " }";
|
+ ", rttMode=" + mRttMode
|
||||||
|
+ ", hasRttAudioSpeech=" + mIsReceivingRttAudio + " }";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -215,6 +221,7 @@ public final class ImsStreamMediaProfile implements Parcelable {
|
|||||||
public void writeToParcel(Parcel out, int flags) {
|
public void writeToParcel(Parcel out, int flags) {
|
||||||
out.writeInt(mAudioQuality);
|
out.writeInt(mAudioQuality);
|
||||||
out.writeInt(mAudioDirection);
|
out.writeInt(mAudioDirection);
|
||||||
|
out.writeTypedObject(mAudioCodecAttributes, flags);
|
||||||
out.writeInt(mVideoQuality);
|
out.writeInt(mVideoQuality);
|
||||||
out.writeInt(mVideoDirection);
|
out.writeInt(mVideoDirection);
|
||||||
out.writeInt(mRttMode);
|
out.writeInt(mRttMode);
|
||||||
@@ -224,6 +231,7 @@ public final class ImsStreamMediaProfile implements Parcelable {
|
|||||||
private void readFromParcel(Parcel in) {
|
private void readFromParcel(Parcel in) {
|
||||||
mAudioQuality = in.readInt();
|
mAudioQuality = in.readInt();
|
||||||
mAudioDirection = in.readInt();
|
mAudioDirection = in.readInt();
|
||||||
|
mAudioCodecAttributes = in.readTypedObject(AudioCodecAttributes.CREATOR);
|
||||||
mVideoQuality = in.readInt();
|
mVideoQuality = in.readInt();
|
||||||
mVideoDirection = in.readInt();
|
mVideoDirection = in.readInt();
|
||||||
mRttMode = in.readInt();
|
mRttMode = in.readInt();
|
||||||
@@ -274,6 +282,23 @@ public final class ImsStreamMediaProfile implements Parcelable {
|
|||||||
return mAudioDirection;
|
return mAudioDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the audio codec attributes {@link AudioCodecAttributes} which may be {@code null} if
|
||||||
|
* ImsService doesn't support this information.
|
||||||
|
* @return audio codec attributes
|
||||||
|
*/
|
||||||
|
public @Nullable AudioCodecAttributes getAudioCodecAttributes() {
|
||||||
|
return mAudioCodecAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the audio codec attributes {@link AudioCodecAttributes} which includes bitrate and
|
||||||
|
* bandwidth information.
|
||||||
|
*/
|
||||||
|
public void setAudioCodecAttributes(@NonNull AudioCodecAttributes audioCodecAttributes) {
|
||||||
|
mAudioCodecAttributes = audioCodecAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
public int getVideoQuality() {
|
public int getVideoQuality() {
|
||||||
return mVideoQuality;
|
return mVideoQuality;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user