Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47090c46 authored by Jessica Wagantall's avatar Jessica Wagantall
Browse files

Merge tag 'android-6.0.1_r24' into HEAD

Ticket: CYNGNOS-2213
Android 6.0.1 release 24
parents 51a5dd82 b6bac5ae
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;
        }
+18 −0
Original line number Diff line number Diff line
@@ -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.