diff --git a/api/system-current.txt b/api/system-current.txt index cdb83c6fb89ef..f07f0c309346d 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6027,7 +6027,7 @@ package android.telephony { } public class PhoneStateListener { - method public void onCallAttributesChanged(android.telephony.CallAttributes); + method public void onCallAttributesChanged(@NonNull android.telephony.CallAttributes); method public void onCallDisconnectCauseChanged(int, int); method public void onPreciseCallStateChanged(android.telephony.PreciseCallState); method public void onPreciseDataConnectionStateChanged(android.telephony.PreciseDataConnectionState); diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 1798f388ab273..cbfcd6035d5eb 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -206,9 +206,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { private Map> mEmergencyNumberList; - private CallQuality mCallQuality; + private CallQuality mCallQuality = new CallQuality(); - private CallAttributes mCallAttributes; + private CallAttributes mCallAttributes = new CallAttributes(new PreciseCallState(), + TelephonyManager.NETWORK_TYPE_UNKNOWN, new CallQuality()); private int[] mSrvccState; diff --git a/telephony/java/android/telephony/CallQuality.java b/telephony/java/android/telephony/CallQuality.java index b27f6b44370f1..cbe6228471306 100644 --- a/telephony/java/android/telephony/CallQuality.java +++ b/telephony/java/android/telephony/CallQuality.java @@ -92,6 +92,10 @@ public final class CallQuality implements Parcelable { mCodecType = in.readInt(); } + /** @hide **/ + public CallQuality() { + } + /** * Constructor. * diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index 9fee5932dadc3..af324debbd577 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -701,7 +701,7 @@ public class PhoneStateListener { * @hide */ @SystemApi - public void onCallAttributesChanged(CallAttributes callAttributes) { + public void onCallAttributesChanged(@NonNull CallAttributes callAttributes) { // default implementation empty }