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

Commit da439bf6 authored by Hai Zhang's avatar Hai Zhang
Browse files

Add config for default holders of call redirection and call screening.

Test: presubmit
Fixes: 144105784
Change-Id: I6dd0234b8d4175194e17a831cb084cd904bc4546
parent 13645ce9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@
    <!--- @see android.telecom.CallRedirectionService -->
    <role
        name="android.app.role.CALL_REDIRECTION"
        behavior="CallRedirectionRoleBehavior"
        description="@string/role_call_redirection_description"
        exclusive="true"
        label="@string/role_call_redirection_label"
@@ -397,6 +398,7 @@
    <!--- @see android.telecom.CallScreeningService -->
    <role
        name="android.app.role.CALL_SCREENING"
        behavior="CallScreeningRoleBehavior"
        description="@string/role_call_screening_description"
        exclusive="true"
        label="@string/role_call_screening_label"
+36 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.permissioncontroller.role.model;

import android.content.Context;

import androidx.annotation.NonNull;

import java.util.List;

/**
 * Class for behavior of the call redirection role.
 */
public class CallRedirectionRoleBehavior implements RoleBehavior {

    @NonNull
    @Override
    public List<String> getDefaultHolders(@NonNull Role role, @NonNull Context context) {
        return ExclusiveDefaultHolderMixin.getDefaultHolders(role, "config_defaultCallRedirection",
                context);
    }
}
+36 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.permissioncontroller.role.model;

import android.content.Context;

import androidx.annotation.NonNull;

import java.util.List;

/**
 * Class for behavior of the call screening role.
 */
public class CallScreeningRoleBehavior implements RoleBehavior {

    @NonNull
    @Override
    public List<String> getDefaultHolders(@NonNull Role role, @NonNull Context context) {
        return ExclusiveDefaultHolderMixin.getDefaultHolders(role, "config_defaultCallScreening",
                context);
    }
}