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

Commit 3bf0528c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow privileged apps to accept and end VOIP calls." into main

parents fafe1854 61512276
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);
}