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

Commit 51842b9d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Implement extra key filtering for non-system incallservices" am:...

Merge "Implement extra key filtering for non-system incallservices" am: 2300b032 am: 7a0c2739 am: 5aaa4c02 am: 52cc818b am: 8278ee9b

Change-Id: I28001f301b2f48788b79e7aafa78f3e4ed51dd8e
parents a7d7fe3a 8278ee9b
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -936,7 +936,8 @@ public class InCallController extends CallsManagerListenerBase {
                ParcelableCall parcelableCall = ParcelableCallUtils.toParcelableCall(call,
                        true /* includeVideoProvider */, mCallsManager.getPhoneAccountRegistrar(),
                        info.isExternalCallsSupported(), includeRttCall,
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI);
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI ||
                        info.getType() == IN_CALL_SERVICE_TYPE_NON_UI);
                try {
                    inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall));
                } catch (RemoteException ignored) {
@@ -1000,7 +1001,8 @@ public class InCallController extends CallsManagerListenerBase {
                ParcelableCall parcelableCall = ParcelableCallUtils.toParcelableCall(call,
                        true /* includeVideoProvider */, mCallsManager.getPhoneAccountRegistrar(),
                        info.isExternalCallsSupported(), includeRttCall,
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI);
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI ||
                        info.getType() == IN_CALL_SERVICE_TYPE_NON_UI);
                try {
                    inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall));
                } catch (RemoteException ignored) {
@@ -1030,7 +1032,8 @@ public class InCallController extends CallsManagerListenerBase {
                        false /* supportsExternalCalls */,
                        android.telecom.Call.STATE_DISCONNECTED /* overrideState */,
                        false /* includeRttCall */,
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI ||
                        info.getType() == IN_CALL_SERVICE_TYPE_NON_UI
                        );

                try {
@@ -1541,7 +1544,8 @@ public class InCallController extends CallsManagerListenerBase {
                        mCallsManager.getPhoneAccountRegistrar(),
                        info.isExternalCallsSupported(),
                        includeRttCall,
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI);
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI ||
                        info.getType() == IN_CALL_SERVICE_TYPE_NON_UI);
                inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall));
            } catch (RemoteException ignored) {
            }
@@ -1606,7 +1610,8 @@ public class InCallController extends CallsManagerListenerBase {
                        mCallsManager.getPhoneAccountRegistrar(),
                        info.isExternalCallsSupported(),
                        rttInfoChanged && info.equals(mInCallServiceConnection.getInfo()),
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI);
                        info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI ||
                        info.getType() == IN_CALL_SERVICE_TYPE_NON_UI);
                ComponentName componentName = info.getComponentName();
                IInCallService inCallService = entry.getValue();
                componentsUpdated.add(componentName);
+15 −15
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@ public class ParcelableCallUtils {

    /**
     * A list of extra keys which should be removed from a {@link ParcelableCall} when it is being
     * generated for the purpose of sending to a dialer other than the system dialer.
     * generated for the purpose of sending to a incallservice other than the system incallservice.
     * By convention we only pass keys namespaced with android.*, however there are some keys which
     * should not be passed to non-system dialer apps either.
     * should not be passed to non-system incallservice apps either.
     */
    private static List<String> EXTRA_KEYS_TO_SANITIZE;
    static {
@@ -90,9 +90,9 @@ public class ParcelableCallUtils {
     *      {@link InCallService} which supports external calls or not.
     * @param includeRttCall {@code true} if the RTT call should be included, {@code false}
     *      otherwise.
     * @param isForSystemDialer {@code true} if this call is being parcelled for the system dialer,
     *      {@code false} otherwise.  When parceling for the system dialer, the entire call extras
     *      is included.  When parceling for anything other than the system dialer, some extra key
     * @param isForSystemInCallService {@code true} if this call is being parcelled for the system incallservice,
     *      {@code false} otherwise.  When parceling for the system incallservice, the entire call extras
     *      is included.  When parceling for anything other than the system incallservice, some extra key
     *      values will be stripped for privacy sake.
     */
    public static ParcelableCall toParcelableCall(
@@ -101,10 +101,10 @@ public class ParcelableCallUtils {
            PhoneAccountRegistrar phoneAccountRegistrar,
            boolean supportsExternalCalls,
            boolean includeRttCall,
            boolean isForSystemDialer) {
            boolean isForSystemInCallService) {
        return toParcelableCall(call, includeVideoProvider, phoneAccountRegistrar,
                supportsExternalCalls, CALL_STATE_OVERRIDE_NONE /* overrideState */,
                includeRttCall, isForSystemDialer);
                includeRttCall, isForSystemInCallService);
    }

    /**
@@ -120,9 +120,9 @@ public class ParcelableCallUtils {
     *      {@link InCallService} which supports external calls or not.
     * @param overrideState When not {@link #CALL_STATE_OVERRIDE_NONE}, use the provided state as an
     *      override to whatever is defined in the call.
     * @param isForSystemDialer {@code true} if this call is being parcelled for the system dialer,
     *      {@code false} otherwise.  When parceling for the system dialer, the entire call extras
     *      is included.  When parceling for anything other than the system dialer, some extra key
     * @param isForSystemInCallService {@code true} if this call is being parcelled for the system incallservice,
     *      {@code false} otherwise.  When parceling for the system incallservice, the entire call extras
     *      is included.  When parceling for anything other than the system incallservice, some extra key
     *      values will be stripped for privacy sake.
     * @return The {@link ParcelableCall} containing all call information from the {@link Call}.
     */
@@ -133,7 +133,7 @@ public class ParcelableCallUtils {
            boolean supportsExternalCalls,
            int overrideState,
            boolean includeRttCall,
            boolean isForSystemDialer) {
            boolean isForSystemInCallService) {
        int state;
        if (overrideState == CALL_STATE_OVERRIDE_NONE) {
            state = getParcelableState(call, supportsExternalCalls);
@@ -226,7 +226,7 @@ public class ParcelableCallUtils {
        }

        Bundle extras;
        if (isForSystemDialer) {
        if (isForSystemInCallService) {
            extras = call.getExtras();
        } else {
            extras = sanitizeExtras(call.getExtras());
@@ -279,9 +279,9 @@ public class ParcelableCallUtils {
     *     <li>Caller number verification status (verstat)</li>
     * </ul>
     * All other fields are nulled or set to 0 values.
     * Where the call screening service is part of the system dialer, the
     * Where the call screening service is part of the system incallservice, the
     * {@link Connection#EXTRA_SIP_INVITE} header information is also sent to the call screening
     * service (since the system dialer has access to this anyways).
     * service (since the system incallservice has access to this anyways).
     * @param call The telecom call to send to a call screening service.
     * @param areRestrictedExtrasIncluded {@code true} if the set of restricted extras defined in
     *                                    {@link #RESTRICTED_CALL_SCREENING_EXTRA_KEYS} are to
@@ -343,7 +343,7 @@ public class ParcelableCallUtils {

    /**
     * Sanitize the extras bundle passed in, removing keys which should not be sent to non-system
     * dialer apps.
     * incallservice apps.
     * @param oldExtras Extras bundle to sanitize.
     * @return The sanitized extras bundle.
     */