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
This commit is contained in:
Hall Liu
2019-10-11 15:38:29 -07:00
parent 038d1b5b27
commit 31de23da21
4 changed files with 43 additions and 8 deletions

View File

@@ -728,6 +728,7 @@ public final class Call {
}
/** {@hide} */
@TestApi
public String getTelecomCallId() {
return mTelecomCallId;
}
@@ -2137,6 +2138,9 @@ public final class Call {
}
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;