Merge "Create the ID for each gating key. Modify the names and descriptions per Compat team requirement."

This commit is contained in:
Shuo Qian
2020-01-31 20:08:33 +00:00
committed by Gerrit Code Review
2 changed files with 7 additions and 6 deletions

View File

@@ -135,11 +135,12 @@ public final class PreciseDataConnectionState implements Parcelable {
} }
/** /**
* To check the SDK version for {@link PreciseDataConnectionState#getDataConnectionState}. * Used for checking if the SDK version for
* {@code PreciseDataConnectionState#getDataConnectionState} is above Q.
*/ */
@ChangeId @ChangeId
@EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q) @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q)
private static final long GET_DATA_CONNECTION_STATE_CODE_CHANGE = 147600208L; private static final long GET_DATA_CONNECTION_STATE_R_VERSION = 148535736L;
/** /**
* Returns the state of data connection that supported the apn types returned by * Returns the state of data connection that supported the apn types returned by
@@ -152,7 +153,7 @@ public final class PreciseDataConnectionState implements Parcelable {
@SystemApi @SystemApi
public @DataState int getDataConnectionState() { public @DataState int getDataConnectionState() {
if (mState == TelephonyManager.DATA_DISCONNECTING if (mState == TelephonyManager.DATA_DISCONNECTING
&& !Compatibility.isChangeEnabled(GET_DATA_CONNECTION_STATE_CODE_CHANGE)) { && !Compatibility.isChangeEnabled(GET_DATA_CONNECTION_STATE_R_VERSION)) {
return TelephonyManager.DATA_CONNECTED; return TelephonyManager.DATA_CONNECTED;
} }

View File

@@ -5209,11 +5209,11 @@ public class TelephonyManager {
public static final int DATA_DISCONNECTING = 4; public static final int DATA_DISCONNECTING = 4;
/** /**
* To check the SDK version for {@link TelephonyManager#getDataState}. * Used for checking if the SDK version for {@link TelephonyManager#getDataState} is above Q.
*/ */
@ChangeId @ChangeId
@EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q) @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q)
private static final long GET_DATA_STATE_CODE_CHANGE = 147600208L; private static final long GET_DATA_STATE_R_VERSION = 148534348L;
/** /**
* Returns a constant indicating the current data connection state * Returns a constant indicating the current data connection state
@@ -5233,7 +5233,7 @@ public class TelephonyManager {
int state = telephony.getDataStateForSubId( int state = telephony.getDataStateForSubId(
getSubId(SubscriptionManager.getActiveDataSubscriptionId())); getSubId(SubscriptionManager.getActiveDataSubscriptionId()));
if (state == TelephonyManager.DATA_DISCONNECTING if (state == TelephonyManager.DATA_DISCONNECTING
&& !Compatibility.isChangeEnabled(GET_DATA_STATE_CODE_CHANGE)) { && !Compatibility.isChangeEnabled(GET_DATA_STATE_R_VERSION)) {
return TelephonyManager.DATA_CONNECTED; return TelephonyManager.DATA_CONNECTED;
} }