Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4940b647 authored by Sanket Padawe's avatar Sanket Padawe Committed by android-build-merger
Browse files

Merge "Add permission check for old call handover apis." am: e8fc3d23 am: 7a97ee9a

am: 440bd9cb

Change-Id: Ibd08720dba54949234376d5a5ca021c722330091
parents dc8e5268 440bd9cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1408,7 +1408,7 @@ public final class Call {
     * @param extras Bundle containing extra information associated with the event.
     */
    public void sendCallEvent(String event, Bundle extras) {
        mInCallAdapter.sendCallEvent(mTelecomCallId, event, extras);
        mInCallAdapter.sendCallEvent(mTelecomCallId, event, mTargetSdkVersion, extras);
    }

    /**
+3 −2
Original line number Diff line number Diff line
@@ -286,11 +286,12 @@ public final class InCallAdapter {
     *
     * @param callId The callId to send the event for.
     * @param event The event.
     * @param targetSdkVer Target sdk version of the app calling this api
     * @param extras Extras associated with the event.
     */
    public void sendCallEvent(String callId, String event, Bundle extras) {
    public void sendCallEvent(String callId, String event, int targetSdkVer, Bundle extras) {
        try {
            mAdapter.sendCallEvent(callId, event, extras);
            mAdapter.sendCallEvent(callId, event, targetSdkVer, extras);
        } catch (RemoteException ignored) {
        }
    }
+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -1440,6 +1441,13 @@ public class TelecomManager {
    public void addNewIncomingCall(PhoneAccountHandle phoneAccount, Bundle extras) {
        try {
            if (isServiceConnected()) {
                if (extras != null && extras.getBoolean(EXTRA_IS_HANDOVER) &&
                        mContext.getApplicationContext().getApplicationInfo().targetSdkVersion >
                                Build.VERSION_CODES.O_MR1) {
                    Log.e("TAG", "addNewIncomingCall failed. Use public api " +
                            "acceptHandover for API > O-MR1");
                    // TODO add "return" after DUO team adds support for new handover API
                }
                getTelecomService().addNewIncomingCall(
                        phoneAccount, extras == null ? new Bundle() : extras);
            }
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ oneway interface IInCallAdapter {

    void pullExternalCall(String callId);

    void sendCallEvent(String callId, String event, in Bundle extras);
    void sendCallEvent(String callId, String event, int targetSdkVer, in Bundle extras);

    void putExtras(String callId, in Bundle extras);