Merge "Add support for network identified emergency calls."

This commit is contained in:
Tyler Gunn
2018-09-24 22:50:50 +00:00
committed by Gerrit Code Review
7 changed files with 54 additions and 2 deletions

View File

@@ -1884,6 +1884,27 @@ public class TelecomManager {
}
}
/**
* Determines if there is an ongoing emergency call. This can be either an outgoing emergency
* call, as identified by the dialed number, or because a call was identified by the network
* as an emergency call.
* @return {@code true} if there is an ongoing emergency call, {@code false} otherwise.
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public boolean isInEmergencyCall() {
try {
if (isServiceConnected()) {
return getTelecomService().isInEmergencyCall();
}
} catch (RemoteException e) {
Log.e(TAG, "RemoteException isInEmergencyCall: " + e);
return false;
}
return false;
}
private ITelecomService getTelecomService() {
if (mTelecomServiceOverride != null) {
return mTelecomServiceOverride;