From ae11b299df363fce86b710ced478e9ca4bf2e18b Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 23 May 2022 17:18:46 -0700 Subject: [PATCH] Traffic descriptor only data profile should be enabled If a data profile only contains traffic descriptor, and has no APN setting, it should be considered enabled. Fix: 233557423 Test: Manual + atest DataProfileTest Merged-In: Ied26cbba3bde8491bfd6299a2724fc2c5b26c026 Change-Id: Ied26cbba3bde8491bfd6299a2724fc2c5b26c026 --- telephony/java/android/telephony/data/DataProfile.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/telephony/java/android/telephony/data/DataProfile.java b/telephony/java/android/telephony/data/DataProfile.java index 0b361dcef3955..dfa0b5d5a672e 100644 --- a/telephony/java/android/telephony/data/DataProfile.java +++ b/telephony/java/android/telephony/data/DataProfile.java @@ -232,13 +232,14 @@ public final class DataProfile implements Parcelable { } /** - * @return True if the profile is enabled. + * @return {@code true} if the profile is enabled. If the profile only has a + * {@link TrafficDescriptor}, but no {@link ApnSetting}, then this profile is always enabled. */ public boolean isEnabled() { if (mApnSetting != null) { return mApnSetting.isEnabled(); } - return false; + return true; } /** @@ -534,7 +535,7 @@ public final class DataProfile implements Parcelable { @Type private int mType = -1; - private boolean mEnabled; + private boolean mEnabled = true; @ApnType private int mSupportedApnTypesBitmask;