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

Commit 3f7e01f4 authored by Daniel Bright's avatar Daniel Bright Committed by Automerger Merge Worker
Browse files

Merge "Revert "Add CAPABILITY_ALLOWED_NETWORK_TYPES_USED"" am: 3e21e0ab am:...

Merge "Revert "Add CAPABILITY_ALLOWED_NETWORK_TYPES_USED"" am: 3e21e0ab am: 1b919988 am: 1d191d32

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1606541

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic42abca83a96074efcc9fc9df14c7780a71b446b
parents 40321b70 1d191d32
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -11663,7 +11663,6 @@ package android.telephony {
    field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
    field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
    field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
    field public static final String CAPABILITY_ALLOWED_NETWORK_TYPES_USED = "CAPABILITY_ALLOWED_NETWORK_TYPES_USED";
    field public static final String CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE = "CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE";
    field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
    field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
+53 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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 android.telephony;

import android.util.ArraySet;

/**
 * Contains the set of supported capabilities that the Radio Interface supports on this device.
 *
 * @hide
 */
public class RadioInterfaceCapabilities {

    private final ArraySet<String> mSupportedCapabilities;


    public RadioInterfaceCapabilities() {
        mSupportedCapabilities = new ArraySet<>();
    }

    /**
     * Marks a capability as supported
     *
     * @param capabilityName the name of the capability
     */
    public void addSupportedCapability(
            @TelephonyManager.RadioInterfaceCapability String capabilityName) {
        mSupportedCapabilities.add(capabilityName);
    }

    /**
     * Whether the capability is supported
     *
     * @param capabilityName the name of the capability
     */
    public boolean isSupported(String capabilityName) {
        return mSupportedCapabilities.contains(capabilityName);
    }
}
+8 −35
Original line number Diff line number Diff line
@@ -131,10 +131,12 @@ import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
@@ -8497,11 +8499,6 @@ public class TelephonyManager {
     * <p>Requires Permission:
     * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
     * app has carrier privileges (see {@link #hasCarrierPrivileges}).
     * <p>
     * If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
     * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
     * setAllowedNetworkTypesBitmap is used on the radio interface.  Otherwise,
     * setPreferredNetworkTypesBitmap is used instead.
     *
     * @param subId the id of the subscription to set the preferred network type for.
     * @param networkType the preferred network type
@@ -8535,11 +8532,6 @@ public class TelephonyManager {
     * <p>Requires Permission:
     * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
     * app has carrier privileges (see {@link #hasCarrierPrivileges}).
     * <p>
     * If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
     * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
     * setAllowedNetworkTypesBitmap is used on the radio interface.  Otherwise,
     * setPreferredNetworkTypesBitmap is used instead.
     *
     * @param networkTypeBitmask The bitmask of preferred network types.
     * @return true on success; false on any failure.
@@ -8566,11 +8558,6 @@ public class TelephonyManager {
     * Set the allowed network types of the device. This is for carrier or privileged apps to
     * enable/disable certain network types on the device. The user preferred network types should
     * be set through {@link #setPreferredNetworkTypeBitmask}.
     * <p>
     * If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
     * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
     * setAllowedNetworkTypesBitmap is used on the radio interface.  Otherwise,
     * setPreferredNetworkTypesBitmap is used instead.
     *
     * @param allowedNetworkTypes The bitmask of allowed network types.
     * @return true on success; false on any failure.
@@ -8655,12 +8642,12 @@ public class TelephonyManager {
     * {@link #ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G}
     * </ol>
     * This API will result in allowing an intersection of allowed network types for all reasons,
     * including the configuration done through other reasons.
     * <p>
     * If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
     * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
     * setAllowedNetworkTypesBitmap is used on the radio interface.  Otherwise,
     * setPreferredNetworkTypesBitmap is used instead.
     * including the configuration done through {@link setAllowedNetworkTypes}.
     * While this API and {@link setAllowedNetworkTypes} is controlling allowed network types
     * on device, user preference will still be set through {@link #setPreferredNetworkTypeBitmask}.
     * Thus resultant network type configured on modem will be an intersection of the network types
     * from setAllowedNetworkTypesForReason, {@link setAllowedNetworkTypes}
     * and {@link #setPreferredNetworkTypeBitmask}.
     *
     * @param reason the reason the allowed network type change is taking place
     * @param allowedNetworkTypes The bitmask of allowed network types.
@@ -14894,24 +14881,10 @@ public class TelephonyManager {
    public static final String CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE =
            "CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE";
    /**
     * Indicates whether {@link #setPreferredNetworkType}, {@link
     * #setPreferredNetworkTypeBitmask}, {@link #setAllowedNetworkTypes} and
     * {@link #setAllowedNetworkTypesForReason} rely on
     * setAllowedNetworkTypesBitmap instead of setPreferredNetworkTypesBitmap on the radio
     * interface.
     *
     * @hide
     */
    @SystemApi
    public static final String CAPABILITY_ALLOWED_NETWORK_TYPES_USED =
            "CAPABILITY_ALLOWED_NETWORK_TYPES_USED";
    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @StringDef(prefix = "CAPABILITY_", value = {
            CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE,
            CAPABILITY_ALLOWED_NETWORK_TYPES_USED,
    })
    public @interface RadioInterfaceCapability {}