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

Commit ba98498b authored by Thomas Stuart's avatar Thomas Stuart
Browse files

Log when AM gives/removes foreground service delegation

In android U, a new call lifecycle was introduced and specified in
TelecomManger#addCall. Clients MUST post a call-style notification in
order to gain foreground service delegation.

Clients who fail to post a notification will have their media playback
and audio recording suppressed. Its even possible that the application
will be cleaned up if its in the background.

Given the consequences, its important to log when Telecom gives FSD to
debug.

bug: 278310214
Test: manual / BR
Change-Id: I8e86161738d61576ca2e2869fa6086efa7166817
parent 94990ef8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -223,6 +223,8 @@ public class LogUtils {
        public static final String ICS_EXTRAS_CHANGED = "ICS_EXTRAS_CHANGED";
        public static final String FLASH_NOTIFICATION_START = "FLASH_NOTIFICATION_START";
        public static final String FLASH_NOTIFICATION_STOP = "FLASH_NOTIFICATION_STOP";
        public static final String GAINED_FGS_DELEGATION = "GAINED_FGS_DELEGATION";
        public static final String LOST_FGS_DELEGATION = "LOST_FGS_DELEGATION";

        public static class Timings {
            public static final String ACCEPT_TIMING = "accept";
+3 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.server.LocalServices;
import com.android.server.telecom.Call;
import com.android.server.telecom.CallsManagerListenerBase;
import com.android.server.telecom.LogUtils;
import com.android.server.telecom.TelecomSystem;

import java.util.ArrayList;
@@ -182,12 +183,14 @@ public class VoipCallMonitor extends CallsManagerListenerBase {
            ServiceConnection fgsConnection = new ServiceConnection() {
                @Override
                public void onServiceConnected(ComponentName name, IBinder service) {
                    Log.addEvent(call, LogUtils.Events.GAINED_FGS_DELEGATION);
                    mServices.put(handle, this);
                    startMonitorWorks(call);
                }

                @Override
                public void onServiceDisconnected(ComponentName name) {
                    Log.addEvent(call, LogUtils.Events.LOST_FGS_DELEGATION);
                    mServices.remove(handle);
                }
            };