Loading src/com/android/server/telecom/CallsManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading src/com/android/server/telecom/TelecomServiceImpl.java +18 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -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 { Loading Loading @@ -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. Loading Loading
src/com/android/server/telecom/CallsManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading
src/com/android/server/telecom/TelecomServiceImpl.java +18 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -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 { Loading Loading @@ -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. Loading