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

Commit 4d2013a9 authored by Ayush Sharma's avatar Ayush Sharma
Browse files

Redirect dial/call intents to managed profile

When work profile telephony is enabled(with all sim assigned to managed
profile) set cross-profile intent for call/dial intent to be resolved in
managed profile.

Bug: 258820628
Test: atest
android.devicepolicy.cts.ManagedSubscriptionsPolicyTest

Change-Id: Ib18318b362fbf10a7ffb7fbe32911526203ae83f
parent 6a544edc
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -320,12 +320,26 @@ public class DefaultCrossProfileIntentFiltersUtils {
                MOBILE_NETWORK_SETTINGS);
    }

    /** Call intent with tel scheme */
    private static final DefaultCrossProfileIntentFilter CALL =
            new DefaultCrossProfileIntentFilter.Builder(
                    DefaultCrossProfileIntentFilter.Direction.TO_PROFILE,
                    SKIP_CURRENT_PROFILE,
                    /* letsPersonalDataIntoProfile= */ false)
                    .addAction(Intent.ACTION_CALL)
                    .addCategory(Intent.CATEGORY_DEFAULT)
                    .addDataScheme("tel")
                    .build();

    /**
     * Returns default telephony related intent filters for managed profile.
     */
    public static List<DefaultCrossProfileIntentFilter> getDefaultManagedProfileTelephonyFilters() {
        return Arrays.asList(
                DIAL_DATA,
                DIAL_MIME,
                DIAL_RAW,
                CALL,
                SMS_MMS);
    }