Add SDK compatibility code for new call states
Add code that translates the new call states to old call states for
in-call UIs that don't yet support background call screening.
Test: CTS
Bug: 140317205
Change-Id: I104f5f7ab3e3dc075e1d9ed5c64fcd924f9a977b
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index 5e71416..3f348a4 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -728,6 +728,7 @@
}
/** {@hide} */
+ @TestApi
public String getTelecomCallId() {
return mTelecomCallId;
}
@@ -2137,6 +2138,9 @@
}
int state = parcelableCall.getState();
+ if (mTargetSdkVersion < Phone.SDK_VERSION_R && state == Call.STATE_SIMULATED_RINGING) {
+ state = Call.STATE_RINGING;
+ }
boolean stateChanged = mState != state;
if (stateChanged) {
mState = state;