Make services singletons
Support for multiple users to make phone calls
Forward incoming calls to the current user
Change-Id: If5317aedaf1dac4631892af87167b71463356ccd
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8af1758..195b5c7 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -87,6 +87,7 @@
<uses-permission android:name="android.permission.USE_SIP" />
<uses-permission android:name="android.permission.REBOOT" />
<uses-permission android:name="android.permission.UPDATE_LOCK" />
+ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<uses-permission android:name="com.android.smspush.WAPPUSH_MANAGER_BIND" />
<uses-permission android:name="android.permission.MANAGE_USERS" />
@@ -555,17 +556,20 @@
<service android:name="HfaService" android:exported="false"/>
<!-- Telecomm integration -->
- <service android:name="com.android.services.telephony.TelephonyCallServiceProvider">
+ <service android:name="com.android.services.telephony.TelephonyCallServiceProvider"
+ android:singleUser="true">
<intent-filter>
<action android:name="android.telecomm.CallServiceProvider" />
</intent-filter>
</service>
- <service android:name="com.android.services.telephony.TelephonyCallServiceSelector">
+ <service android:name="com.android.services.telephony.TelephonyCallServiceSelector"
+ android:singleUser="true">
<intent-filter>
<action android:name="android.telecomm.CallServiceSelector" />
</intent-filter>
</service>
<service
+ android:singleUser="true"
android:name="com.android.services.telephony.GsmConnectionService"
android:label="@string/gsm_connection_service_label">
<intent-filter>
@@ -573,6 +577,7 @@
</intent-filter>
</service>
<service
+ android:singleUser="true"
android:name="com.android.services.telephony.CdmaConnectionService"
android:label="@string/cdma_connection_service_label">
<intent-filter>
@@ -580,6 +585,7 @@
</intent-filter>
</service>
<service
+ android:singleUser="true"
android:name="com.android.services.telephony.SipConnectionService"
android:label="@string/sip_connection_service_label">
<intent-filter>
diff --git a/src/com/android/services/telephony/IncomingCallNotifier.java b/src/com/android/services/telephony/IncomingCallNotifier.java
index 7b8c2cc..37f3224 100644
--- a/src/com/android/services/telephony/IncomingCallNotifier.java
+++ b/src/com/android/services/telephony/IncomingCallNotifier.java
@@ -23,6 +23,7 @@
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
+import android.os.UserHandle;
import android.telecomm.CallService;
import android.telecomm.CallServiceDescriptor;
import android.telecomm.TelecommConstants;
@@ -110,6 +111,6 @@
intent.putExtra(TelecommConstants.EXTRA_CALL_SERVICE_DESCRIPTOR, builder.build());
Log.d(this, "Sending incoming call intent: %s", intent);
- context.startActivity(intent);
+ context.startActivityAsUser(intent, UserHandle.CURRENT);
}
}