summaryrefslogtreecommitdiffstats
path: root/src/com/android/server/telecom/ConnectionServiceWrapper.java
diff options
context:
space:
mode:
authorEvan Charlton <evanc@google.com>2014-11-25 14:08:53 -0800
committerEvan Charlton <evanc@google.com>2014-12-05 15:21:46 -0800
commit105d977687d1d0de7cd9420fc140b01404261df1 (patch)
tree3ee18590453a03e952f9f252453dbd06324c42aa /src/com/android/server/telecom/ConnectionServiceWrapper.java
parent4ec83c0245771e63665494cc29cc27e5567209bc (diff)
downloadandroid_packages_services_Telecomm-105d977687d1d0de7cd9420fc140b01404261df1.tar.gz
android_packages_services_Telecomm-105d977687d1d0de7cd9420fc140b01404261df1.tar.bz2
android_packages_services_Telecomm-105d977687d1d0de7cd9420fc140b01404261df1.zip
Track (and use) UserHandle to make connections
When binding to services, use the UserHandle which registered the PhoneAccount in order to ensure that the correct user receives the Intent. Also make sure that TelecomManager does not leak PhoneAccounts across profiles, unless the caller is a system-privileged app. PhoneAccounts will not leak across users, even for system-privileged apps. Bug: 17421902 Bug: 17421044 Change-Id: I673904a7ae038c88688bba62642e93174e55c308
Diffstat (limited to 'src/com/android/server/telecom/ConnectionServiceWrapper.java')
-rw-r--r--src/com/android/server/telecom/ConnectionServiceWrapper.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/com/android/server/telecom/ConnectionServiceWrapper.java
index 6d044f56..c3462723 100644
--- a/src/com/android/server/telecom/ConnectionServiceWrapper.java
+++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java
@@ -24,6 +24,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
+import android.os.UserHandle;
import android.telecom.AudioState;
import android.telecom.Connection;
import android.telecom.ConnectionRequest;
@@ -591,13 +592,15 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
* @param connectionServiceRepository Connection service repository.
* @param phoneAccountRegistrar Phone account registrar
* @param context The context.
+ * @param userHandle The {@link UserHandle} to use when binding.
*/
ConnectionServiceWrapper(
ComponentName componentName,
ConnectionServiceRepository connectionServiceRepository,
PhoneAccountRegistrar phoneAccountRegistrar,
- Context context) {
- super(ConnectionService.SERVICE_INTERFACE, componentName, context);
+ Context context,
+ UserHandle userHandle) {
+ super(ConnectionService.SERVICE_INTERFACE, componentName, context, userHandle);
mConnectionServiceRepository = connectionServiceRepository;
phoneAccountRegistrar.addListener(new PhoneAccountRegistrar.Listener() {
// TODO -- Upon changes to PhoneAccountRegistrar, need to re-wire connections
@@ -957,7 +960,8 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
PhoneAccount account = mPhoneAccountRegistrar.getPhoneAccount(handle);
if ((account.getCapabilities() & PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) != 0) {
ConnectionServiceWrapper service =
- mConnectionServiceRepository.getService(handle.getComponentName());
+ mConnectionServiceRepository.getService(handle.getComponentName(),
+ handle.getUserHandle());
if (service != null) {
simServices.add(service);
}