summaryrefslogtreecommitdiffstats
path: root/src/com/android/server/telecom/CreateConnectionProcessor.java
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2015-02-14 15:44:55 -0800
committerEtan Cohen <etancohen@google.com>2015-03-02 11:31:23 -0800
commit91fc8099a0690a3367eb206788c9c25ceff31875 (patch)
tree628c5215b3a8dc06ed6dd077747ef42f5ce67d78 /src/com/android/server/telecom/CreateConnectionProcessor.java
parent78a5e6b9c1595c81f72d7a822617cb78db224e48 (diff)
downloadandroid_packages_services_Telecomm-91fc8099a0690a3367eb206788c9c25ceff31875.tar.gz
android_packages_services_Telecomm-91fc8099a0690a3367eb206788c9c25ceff31875.tar.bz2
android_packages_services_Telecomm-91fc8099a0690a3367eb206788c9c25ceff31875.zip
Fix connection manager bugs related to work profiles
When calling TelecomManager.addNewIncomingCall with an account that's was not registered we would crash. Fix was to check for a null phone account. Various TelecomManager APIs would throw security exceptions when called from a work profile. Fix was to: - switch to using APIs that allowed the user to be specified. For example, using queryIntentServicesAsUse instead of getServiceInfo - don't look for work profiles if the calling user isn't the owner. The default connection manager (set using a config.xml overlay) didn't work with work profiles. Fix was to allow the default connection manager to resolve against the calling process's user handle. BUG: 19300886, 19301690, 19301359 Change-Id: I49d75b69dcfc829b74a5483d7a011f17d8d06838
Diffstat (limited to 'src/com/android/server/telecom/CreateConnectionProcessor.java')
-rw-r--r--src/com/android/server/telecom/CreateConnectionProcessor.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/server/telecom/CreateConnectionProcessor.java b/src/com/android/server/telecom/CreateConnectionProcessor.java
index eec14277..31114dfd 100644
--- a/src/com/android/server/telecom/CreateConnectionProcessor.java
+++ b/src/com/android/server/telecom/CreateConnectionProcessor.java
@@ -267,6 +267,10 @@ final class CreateConnectionProcessor {
// Connection managers are only allowed to manage SIM subscriptions.
PhoneAccount targetPhoneAccount = mPhoneAccountRegistrar.getPhoneAccount(
targetPhoneAccountHandle);
+ if (targetPhoneAccount == null) {
+ Log.d(this, "shouldSetConnectionManager, phone account not found");
+ return false;
+ }
boolean isSimSubscription = (targetPhoneAccount.getCapabilities() &
PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) != 0;
if (!isSimSubscription) {
@@ -326,7 +330,8 @@ final class CreateConnectionProcessor {
if (mShouldUseConnectionManager && callManagerHandle != null) {
PhoneAccount callManager = mPhoneAccountRegistrar
.getPhoneAccount(callManagerHandle);
- if (callManager.hasCapabilities(PhoneAccount.CAPABILITY_PLACE_EMERGENCY_CALLS)) {
+ if (callManager != null && callManager.hasCapabilities(
+ PhoneAccount.CAPABILITY_PLACE_EMERGENCY_CALLS)) {
CallAttemptRecord callAttemptRecord = new CallAttemptRecord(callManagerHandle,
mPhoneAccountRegistrar.
getDefaultOutgoingPhoneAccount(mCall.getHandle().getScheme())