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

Commit 61512276 authored by Grant Menke's avatar Grant Menke
Browse files

Allow privileged apps to accept and end VOIP calls.

This change updates relevant docs to describe that TelecomManager APIs allow privileged app invocations to accept and end VOIP calls. This CL also adds support for checking if an app is the sytem UI app which is considered privileged. This functionality was requested by the accessibility team in order to support their talkback double tap gesture feature.

Bug: 353579043
Flag: com.android.server.telecom.flags.allow_system_apps_resolve_voip_calls
Test: atest TelecomServiceImplTest
Change-Id: Ia0a8dbd7bcdd88b5a8cc4b0f908f935d77f6c734
parent 2bbce862
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.pm.PackageManagerInternal;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -63,7 +64,10 @@ public class TelecomLoaderService extends SystemService {
            // as this loader (process="system") that's redundant here.
            try {
                ITelecomLoader telecomLoader = ITelecomLoader.Stub.asInterface(service);
                ITelecomService telecomService = telecomLoader.createTelecomService(mServiceRepo);
                PackageManagerInternal packageManagerInternal =
                        LocalServices.getService(PackageManagerInternal.class);
                ITelecomService telecomService = telecomLoader.createTelecomService(mServiceRepo,
                        packageManagerInternal.getSystemUiServiceComponent().getPackageName());

                SmsApplication.getDefaultMmsApplication(mContext, false);
                ServiceManager.addService(Context.TELECOM_SERVICE, telecomService.asBinder());
+8 −1
Original line number Diff line number Diff line
@@ -2049,11 +2049,15 @@ public class TelecomManager {
    /**
     * Ends the foreground call on the device.
     * <p>
     * If there is a ringing call, calling this method rejects the ringing call.  Otherwise the
     * If there is a ringing call, calling this method rejects the ringing call. Otherwise, the
     * foreground call is ended.
     * <p>
     * Note: this method CANNOT be used to end ongoing emergency calls and will return {@code false}
     * if an attempt is made to end an emergency call.
     * <p>
     * Note: If the foreground call on this device is self-managed, this method will only end
     * the call if the caller of this method is privileged (i.e. system, shell, or root) or system
     * UI.
     *
     * @return {@code true} if there is a call which will be rejected or terminated, {@code false}
     * otherwise.
@@ -2082,6 +2086,9 @@ public class TelecomManager {
     * the incoming call requests.  This means, for example, that an incoming call requesting
     * {@link VideoProfile#STATE_BIDIRECTIONAL} will be answered, accepting that state.
     *
     * If the ringing incoming call is self-managed, this method will only accept the call if the
     * caller of this method is privileged (i.e. system, shell, or root) or system UI.
     *
     * @deprecated Companion apps for wearable devices should use the {@link InCallService} API
     * instead.
     */
+1 −1
Original line number Diff line number Diff line
@@ -24,5 +24,5 @@ import com.android.internal.telecom.IInternalServiceRetriever;
 * Allows the TelecomLoaderService to pass additional dependencies required for creation.
 */
interface ITelecomLoader {
    ITelecomService createTelecomService(IInternalServiceRetriever retriever);
    ITelecomService createTelecomService(IInternalServiceRetriever retriever, String sysUiName);
}