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

Commit 8efc0323 authored by Yorke Lee's avatar Yorke Lee
Browse files

Create default InCallService with Context.BIND_IMPORTANT

Docs suggest that this is good to do when starting a service from an 
activity. 

Performance is too affected by b/18338152 to get accurate measurements
right now, but this change doesn't seem to hurt (~50ms faster across 
9 runs, 3 runs per reboot).

Bug: 18373617

Change-Id: I235120f23ab972157653c9863f99511adbac747b
parent d95ef5fc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -314,8 +314,11 @@ public final class InCallController extends CallsManagerListenerBase {
                        Intent intent = new Intent(InCallService.SERVICE_INTERFACE);
                        intent.setComponent(componentName);

                        if (mContext.bindServiceAsUser(intent, inCallServiceConnection,
                                Context.BIND_AUTO_CREATE, UserHandle.CURRENT)) {
                        final int bindFlags = mInCallComponentName.equals(componentName)
                                ? Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT
                                : Context.BIND_AUTO_CREATE;
                        if (mContext.bindServiceAsUser(intent, inCallServiceConnection, bindFlags,
                                UserHandle.CURRENT)) {
                            mServiceConnections.put(componentName, inCallServiceConnection);
                        }
                    }