Merge "Create default InCallService with Context.BIND_IMPORTANT" into lmp-mr1-dev
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index 700bbd6..9498d4c 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -316,8 +316,11 @@
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);
}
}