Merge "Create new DataEnabledReasons for for DataSettingsManager" am: e2fd8e3dcf

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

Change-Id: I31061cd144c380d75ffec615829cc39daac60b6f
This commit is contained in:
Jack Yu
2022-03-09 17:44:10 +00:00
committed by Automerger Merge Worker
3 changed files with 31 additions and 2 deletions

View File

@@ -41759,8 +41759,10 @@ package android.telephony {
field public static final int DATA_DISCONNECTED = 0; // 0x0 field public static final int DATA_DISCONNECTED = 0; // 0x0
field public static final int DATA_DISCONNECTING = 4; // 0x4 field public static final int DATA_DISCONNECTING = 4; // 0x4
field public static final int DATA_ENABLED_REASON_CARRIER = 2; // 0x2 field public static final int DATA_ENABLED_REASON_CARRIER = 2; // 0x2
field public static final int DATA_ENABLED_REASON_OVERRIDE = 4; // 0x4
field public static final int DATA_ENABLED_REASON_POLICY = 1; // 0x1 field public static final int DATA_ENABLED_REASON_POLICY = 1; // 0x1
field public static final int DATA_ENABLED_REASON_THERMAL = 3; // 0x3 field public static final int DATA_ENABLED_REASON_THERMAL = 3; // 0x3
field public static final int DATA_ENABLED_REASON_UNKNOWN = -1; // 0xffffffff
field public static final int DATA_ENABLED_REASON_USER = 0; // 0x0 field public static final int DATA_ENABLED_REASON_USER = 0; // 0x0
field public static final int DATA_HANDOVER_IN_PROGRESS = 5; // 0x5 field public static final int DATA_HANDOVER_IN_PROGRESS = 5; // 0x5
field public static final int DATA_SUSPENDED = 3; // 0x3 field public static final int DATA_SUSPENDED = 3; // 0x3

View File

@@ -1409,10 +1409,11 @@ public class TelephonyCallback {
* *
* @param enabled {@code true} if data is enabled, otherwise disabled. * @param enabled {@code true} if data is enabled, otherwise disabled.
* @param reason Reason for data enabled/disabled. * @param reason Reason for data enabled/disabled.
* See {@link TelephonyManager.DataEnabledReason}. * See {@link TelephonyManager.DataEnabledChangedReason}.
*/ */
@RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE)
void onDataEnabledChanged(boolean enabled, @TelephonyManager.DataEnabledReason int reason); void onDataEnabledChanged(boolean enabled,
@TelephonyManager.DataEnabledChangedReason int reason);
} }
/** /**

View File

@@ -12542,6 +12542,25 @@ public class TelephonyManager {
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface DataEnabledReason{} public @interface DataEnabledReason{}
/** @hide */
@IntDef({
DATA_ENABLED_REASON_UNKNOWN,
DATA_ENABLED_REASON_USER,
DATA_ENABLED_REASON_POLICY,
DATA_ENABLED_REASON_CARRIER,
DATA_ENABLED_REASON_THERMAL,
DATA_ENABLED_REASON_OVERRIDE
})
@Retention(RetentionPolicy.SOURCE)
public @interface DataEnabledChangedReason{}
/**
* To indicate that data was enabled or disabled due to an unknown reason.
* Note that this is not a valid reason for {@link #setDataEnabledForReason(int, boolean)} and
* is only used to indicate that data enabled was changed.
*/
public static final int DATA_ENABLED_REASON_UNKNOWN = -1;
/** /**
* To indicate that user enabled or disabled data. * To indicate that user enabled or disabled data.
*/ */
@@ -12568,6 +12587,13 @@ public class TelephonyManager {
*/ */
public static final int DATA_ENABLED_REASON_THERMAL = 3; public static final int DATA_ENABLED_REASON_THERMAL = 3;
/**
* To indicate data was enabled or disabled due to {@link MobileDataPolicy} overrides.
* Note that this is not a valid reason for {@link #setDataEnabledForReason(int, boolean)} and
* is only used to indicate that data enabled was changed due to an override.
*/
public static final int DATA_ENABLED_REASON_OVERRIDE = 4;
/** /**
* Control of data connection and provide the reason triggering the data connection control. * Control of data connection and provide the reason triggering the data connection control.
* This can be called for following reasons * This can be called for following reasons