Merge "API fix: getProprietaryCallExtras should not return null" am: 2a15872d99

Change-Id: I3fb8da4b3e643ebb40e48f5e264b96ca11e523aa
This commit is contained in:
Brad Ebinger
2020-03-23 17:26:54 +00:00
committed by Automerger Merge Worker
3 changed files with 10 additions and 6 deletions

View File

@@ -9716,7 +9716,7 @@ package android.telephony.ims {
method public int getEmergencyServiceCategories(); method public int getEmergencyServiceCategories();
method @NonNull public java.util.List<java.lang.String> getEmergencyUrns(); method @NonNull public java.util.List<java.lang.String> getEmergencyUrns();
method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile(); method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile();
method @Nullable public android.os.Bundle getProprietaryCallExtras(); method @NonNull public android.os.Bundle getProprietaryCallExtras();
method public int getRestrictCause(); method public int getRestrictCause();
method public int getServiceType(); method public int getServiceType();
method public static int getVideoStateFromCallType(int); method public static int getVideoStateFromCallType(int);

View File

@@ -3328,7 +3328,7 @@ package android.telephony.ims {
method public int getEmergencyServiceCategories(); method public int getEmergencyServiceCategories();
method @NonNull public java.util.List<java.lang.String> getEmergencyUrns(); method @NonNull public java.util.List<java.lang.String> getEmergencyUrns();
method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile(); method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile();
method @Nullable public android.os.Bundle getProprietaryCallExtras(); method @NonNull public android.os.Bundle getProprietaryCallExtras();
method public int getRestrictCause(); method public int getRestrictCause();
method public int getServiceType(); method public int getServiceType();
method public static int getVideoStateFromCallType(int); method public static int getVideoStateFromCallType(int);

View File

@@ -18,7 +18,6 @@ package android.telephony.ims;
import android.annotation.IntDef; import android.annotation.IntDef;
import android.annotation.NonNull; import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.annotation.TestApi; import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage;
@@ -721,11 +720,16 @@ public final class ImsCallProfile implements Parcelable {
* @return A {@link Bundle} containing proprietary call extras that were not set by the * @return A {@link Bundle} containing proprietary call extras that were not set by the
* platform. * platform.
*/ */
public @Nullable Bundle getProprietaryCallExtras() { public @NonNull Bundle getProprietaryCallExtras() {
if (mCallExtras == null) { if (mCallExtras == null) {
return null; return new Bundle();
} }
return mCallExtras.getBundle(EXTRA_OEM_EXTRAS); Bundle proprietaryExtras = mCallExtras.getBundle(EXTRA_OEM_EXTRAS);
if (proprietaryExtras == null) {
return new Bundle();
}
// Make a copy so users do not accidentally change this copy of the extras.
return new Bundle(proprietaryExtras);
} }
public ImsStreamMediaProfile getMediaProfile() { public ImsStreamMediaProfile getMediaProfile() {