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

Commit 7ebd0f98 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update API doc for accidentally exposed NETWORK_TYPE_BITMASK_LTE_CA"...

Merge "Update API doc for accidentally exposed NETWORK_TYPE_BITMASK_LTE_CA" am: 2ca9a7ae am: 99afbf9a am: e63ea889 am: db044ff1

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



Change-Id: Ib12881303edb15edc5da99d58ee893efa9daf770
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b3c2e049 db044ff1
Loading
Loading
Loading
Loading
+21 −0
Original line number Original line Diff line number Diff line
@@ -9290,6 +9290,7 @@ public class TelephonyManager {
        try {
        try {
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null) {
            if (telephony != null) {
                networkTypeBitmask = checkNetworkTypeBitmask(networkTypeBitmask);
                return telephony.setAllowedNetworkTypesForReason(getSubId(),
                return telephony.setAllowedNetworkTypesForReason(getSubId(),
                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER, networkTypeBitmask);
                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER, networkTypeBitmask);
            }
            }
@@ -9299,6 +9300,20 @@ public class TelephonyManager {
        return false;
        return false;
    }
    }
    /**
     * If {@link #NETWORK_TYPE_BITMASK_LTE_CA} bit is set, convert it to NETWORK_TYPE_BITMASK_LTE.
     *
     * @param networkTypeBitmask The networkTypeBitmask being checked
     * @return The checked/converted networkTypeBitmask
     */
    private long checkNetworkTypeBitmask(@NetworkTypeBitMask long networkTypeBitmask) {
        if ((networkTypeBitmask & NETWORK_TYPE_BITMASK_LTE_CA) != 0) {
            networkTypeBitmask ^= NETWORK_TYPE_BITMASK_LTE_CA;
            networkTypeBitmask |= NETWORK_TYPE_BITMASK_LTE;
        }
        return networkTypeBitmask;
    }
    /**
    /**
     * Set the allowed network types of the device. This is for carrier or privileged apps to
     * 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
     * enable/disable certain network types on the device. The user preferred network types should
@@ -9325,6 +9340,7 @@ public class TelephonyManager {
        try {
        try {
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null) {
            if (telephony != null) {
                allowedNetworkTypes = checkNetworkTypeBitmask(allowedNetworkTypes);
                return telephony.setAllowedNetworkTypesForReason(getSubId(),
                return telephony.setAllowedNetworkTypesForReason(getSubId(),
                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_CARRIER, allowedNetworkTypes);
                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_CARRIER, allowedNetworkTypes);
            }
            }
@@ -9410,6 +9426,7 @@ public class TelephonyManager {
        try {
        try {
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null) {
            if (telephony != null) {
                allowedNetworkTypes = checkNetworkTypeBitmask(allowedNetworkTypes);
                telephony.setAllowedNetworkTypesForReason(getSubId(), reason,
                telephony.setAllowedNetworkTypesForReason(getSubId(), reason,
                        allowedNetworkTypes);
                        allowedNetworkTypes);
            } else {
            } else {
@@ -13727,7 +13744,11 @@ public class TelephonyManager {
     */
     */
    public static final long NETWORK_TYPE_BITMASK_LTE = (1 << (NETWORK_TYPE_LTE -1));
    public static final long NETWORK_TYPE_BITMASK_LTE = (1 << (NETWORK_TYPE_LTE -1));
    /**
    /**
     * NOT USED; this bitmask is exposed accidentally, will be deprecated in U.
     * If used, will be converted to {@link #NETWORK_TYPE_BITMASK_LTE}.
     * network type bitmask indicating the support of radio tech LTE CA (carrier aggregation).
     * network type bitmask indicating the support of radio tech LTE CA (carrier aggregation).
     *
     * @see #NETWORK_TYPE_BITMASK_LTE
     */
     */
    public static final long NETWORK_TYPE_BITMASK_LTE_CA = (1 << (NETWORK_TYPE_LTE_CA -1));
    public static final long NETWORK_TYPE_BITMASK_LTE_CA = (1 << (NETWORK_TYPE_LTE_CA -1));