diff options
author | Jessica Wagantall <jwagantall@cyngn.com> | 2016-04-05 12:31:48 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-04-05 12:31:48 -0700 |
commit | 47090c463f56593e508364f93c74cd7d088a0082 (patch) | |
tree | ce7f27c0f6bc1fe3204804b4f6fc856984458f0c | |
parent | 51a5dd82580b66d4a4e55178347e4fe8126995f5 (diff) | |
parent | b6bac5ae4852b25813385cecd28b57d251706320 (diff) | |
download | android_packages_services_Telecomm-47090c463f56593e508364f93c74cd7d088a0082.tar.gz android_packages_services_Telecomm-47090c463f56593e508364f93c74cd7d088a0082.tar.bz2 android_packages_services_Telecomm-47090c463f56593e508364f93c74cd7d088a0082.zip |
Merge tag 'android-6.0.1_r24' into HEAD
Ticket: CYNGNOS-2213
Android 6.0.1 release 24
-rw-r--r-- | src/com/android/server/telecom/CallsManager.java | 8 | ||||
-rw-r--r-- | src/com/android/server/telecom/TelecomServiceImpl.java | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java index a91a10af..61d1f9d7 100644 --- a/src/com/android/server/telecom/CallsManager.java +++ b/src/com/android/server/telecom/CallsManager.java @@ -27,6 +27,7 @@ import android.os.Message; import android.os.SystemProperties; import android.os.Trace; import android.provider.CallLog.Calls; +import android.provider.Settings; import android.telecom.CallAudioState; import android.telecom.Conference; import android.telecom.Connection; @@ -1324,6 +1325,13 @@ public class CallsManager extends Call.ListenerBase implements VideoProviderProx * Returns true if telecom supports adding another top-level call. */ boolean canAddCall() { + boolean isDeviceProvisioned = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.DEVICE_PROVISIONED, 0) != 0; + if (!isDeviceProvisioned) { + Log.d(TAG, "Device not provisioned, canAddCall is false."); + return false; + } + if (getFirstCallWithState(OUTGOING_CALL_STATES) != null) { return false; } diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java index 8948fa85..f3214de6 100644 --- a/src/com/android/server/telecom/TelecomServiceImpl.java +++ b/src/com/android/server/telecom/TelecomServiceImpl.java @@ -44,6 +44,7 @@ import android.telecom.TelecomManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.text.TextUtils; +import android.util.EventLog; // TODO: Needed for move to system service: import com.android.internal.R; import com.android.internal.telecom.ITelecomService; @@ -781,6 +782,7 @@ public class TelecomServiceImpl { phoneAccountHandle.getComponentName().getPackageName()); // Make sure it doesn't cross the UserHandle boundary enforceUserHandleMatchesCaller(phoneAccountHandle); + enforcePhoneAccountIsRegisteredEnabled(phoneAccountHandle); } long token = Binder.clearCallingIdentity(); @@ -816,6 +818,7 @@ public class TelecomServiceImpl { // Make sure it doesn't cross the UserHandle boundary enforceUserHandleMatchesCaller(phoneAccountHandle); + enforcePhoneAccountIsRegisteredEnabled(phoneAccountHandle); long token = Binder.clearCallingIdentity(); try { @@ -1095,6 +1098,21 @@ public class TelecomServiceImpl { return false; } + // Enforce that the PhoneAccountHandle being passed in is both registered to the current user + // and enabled. + private void enforcePhoneAccountIsRegisteredEnabled(PhoneAccountHandle phoneAccountHandle) { + PhoneAccount phoneAccount = mPhoneAccountRegistrar.getPhoneAccountCheckCallingUser( + phoneAccountHandle); + if (phoneAccount == null) { + EventLog.writeEvent(0x534e4554, "26864502", Binder.getCallingUid(), "R"); + throw new SecurityException("This PhoneAccountHandle is not registered for this user!"); + } + if (!phoneAccount.isEnabled()) { + EventLog.writeEvent(0x534e4554, "26864502", Binder.getCallingUid(), "E"); + throw new SecurityException("This PhoneAccountHandle is not enabled for this user!"); + } + } + private void enforcePhoneAccountModificationForPackage(String packageName) { // TODO: Use a new telecomm permission for this instead of reusing modify. |